[PHP] Re: not sure why regex is doing this

2004-01-09 Thread Justin Patrin
while (eregi(',\s*,',$query)): $query = preg_replace('/,\s*,/',',NULL,', $query, -1); endwhile; Please don't mix the regex engines like that...it could lead to much suffering. instead of eregi, use preg_match. -- paperCrane -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit

[PHP] Re: not sure why regex is doing this

2004-01-09 Thread Pavel Janda
Hi again, I am not sure, that it is the clearest way, how to do it, but I've tried this: As you can see, I've added more ","s to your string to try, if it works good and it seems, that yes... PJ "Craig" <[EMAIL PROTECTED]> píse v diskusním príspevku news:[EMAIL PROTECTED] > Hi, > > I have a

[PHP] Re: not sure why regex is doing this

2004-01-09 Thread Pavel Janda
Hi Craig, the mistake is in regex, because you replace only the pair of "," with ",NULL,"... So in case, that there are tree "," in row, there is only one pair and it means one replacing.. For example, when your string is like this: (12345) //two pair of ",," the result is (12345,NULL,,NULL,)