We need a more detailed example than that in order to be able to help you. I
can't see any pattern in the examples you gave us so it's very likely that
the expression we would develope would be wrong.
Either way.. this might be what you're looking for:
<?php
$string = "var1: val11 val12 ... val1N var2: val21 val22 ... val2M ... varI:
valI1 ... valIJ";
$new_string = ereg_replace(" ([a-zA-Z0-9]+)\:", "\n\\1:", $string);
echo $new_string;
?>
--
Erik Andersson ( E.N.E IT - Australia )
http://www.eneit.com/
- Australian, high quality web hosting from AU$4.95, all features included.
"Sebastian Araya" <ar*****@numisys.com.ar> wrote in message
news:67**************************@posting.google.c om...
Hello,
I'm trying to regex an expression like this:
var1: val11 val12 ... val1N var2: val21 val22 ... val2M ... varI: valI1
.... valIJ
to get a something like this:
var1: val11 val12 ... val1N
var2: val21 val22 ... val2M
.
.
.
varI: valI1 ... valIJ
for example a multiple array.
Any ideas...? Thanks,
Sebastián Araya