this will work:
ereg_replace(" *: *",":",$b);
I don't know why you use an OR!
If you only wanted to know WHY this doesn't work:
the searchstrings overlap (abc is poisitioned BEFORE cde - so the parser
only will see abc in abcdefghiabcdefghi but not cde in XdefghiXdefghi!!
$a="abcdefghi";
$a.=$a;
echo ereg_replace("abc|def","X",$a)."\n";
echo ereg_replace("def|abc","X",$a)."\n";
echo ereg_replace("abc|cde","X",$a)."\n";
echo ereg_replace("cde|abc","X",$a)."\n";
OUTPUT:
XXghiXXghi
XXghiXXghi
XdefghiXdefghi
XdefghiXdefghi
michi
> php 3.xx
>
> $a="to be or not : to to be";
>
> $b=ereg_replace(" *:",":",$b);
> $b=ereg_replace(": *",":",$b);
>
> works and
>
> $b=ereg_replace(" *:|: *",":",$b);
>
> does not work. I've had this problem before and ended
> up using two or more statments rather than one.
--
Sent through GMX FreeMail - http://www.gmx.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]