Click to See Complete Forum and Search --> : Regular expressions


Bootsman123
01-28-2004, 03:23 AM
I have this string:
aaa (bbb)

I want to store 'aaa' in a $var1 and store 'bbb' in a $var2, but I just can't succeed in letting preg_replace work.

ermau
01-28-2004, 05:40 AM
Will that always be the format of the string?

If so, try this pattern:
'/(.+?)/s\((.+?)\)/is'