On Thu, 2004-05-20 at 21:22, Rich Fernandez wrote:
> I'm unclear about how alternation works in a regex.
>
> Say I want to find either "foo" or "bar" within a string. I don't care which
> one I match, only that I make a match.
> Would this be correct: /foo|bar/
>
> Should they be grouped thusl
, May 20, 2004 4:23 PM
To: '[EMAIL PROTECTED]'
Subject: regex alternation question
I'm unclear about how alternation works in a regex.
Say I want to find either "foo" or "bar" within a string. I don't care which
one I match, only that I make a match.
Would
I'm unclear about how alternation works in a regex.
Say I want to find either "foo" or "bar" within a string. I don't care which
one I match, only that I make a match.
Would this be correct: /foo|bar/
Should they be grouped thusly: /(foo|bar)/
What about /(?:foo|bar)/ ?
Specifically, I k