Re: [PHP] Inane ereg_replace question

2001-03-03 Thread mailing_list
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;

[PHP] Inane ereg_replace question

2001-03-03 Thread rm
I have to get rid of any spaces on either side of the : mark. Can anyone explain why 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 en