Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: A question of 'or' in a Regexby BrowserUk (Patriarch) |
on May 28, 2003 at 15:58 UTC ( [id://261345]=note: print w/replies, xml ) | Need Help?? |
If your strings are stand-alone, then using anchors (\A & \Z (or ^ & $ unless your using the /m option)) will work fine, but if your trying to detect matches for this regex within the context of a larger string, then you can acheive this using a few zero-width assertions.
Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
In Section
Seekers of Perl Wisdom
|
|