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 know that the second one remembers which one is found and
the third one doesn't. But is the first example wrong? 
 
TIA
 
richf

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to