Page 1 of 1

PHP RegEx: (a|b)*c --> Could it return just 'c'?

Posted: Wed May 03, 2006 12:44 am
by CallumD
I am on a RegEx tutorial and it's stating that:

"(a|b)*c": a string that has a sequence of alternating a's and b's ending in a c.

Given that the asterisk (*) means zero or more, wouldn't this type of string search also just return every instance of 'c'?

Posted: Wed May 03, 2006 12:52 am
by feyd
Try it. :)

Posted: Wed May 03, 2006 1:00 am
by CallumD
Is there a program I can download to test POSIX regular expressions?

I am on my work computer, not my home computer which has a home server set up to test PHP scripts...

Posted: Wed May 03, 2006 1:14 am
by feyd
There is an application referenced in our own regex board that may be of interest.

viewtopic.php?t=33106

Posted: Wed May 03, 2006 10:23 am
by pickle
Moved to Regex board.