![]() |
|
Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
Greetings, noble monks -- I have a quandry:
Say you have a string and a few patterns to try matching, something like this (it's dinky, please forgive):
$string = "clintonesque"; What I want to know is _which_ of those three things ($m1, $m2, $m3) it matched first. Can it be done, or am I delusional? I should note that I'd like to put all of the match patterns into one monster regexp, instead of if/else-ing my way through a series of them. (Honestly, I don't know why; this was a suggestion from a more experienced engineer, in the interest of conserving computer juice with some pre-compiling.) The FAQs/resources don't offer any aid, and other Perl wizards say it can't be done. I would be intensely grateful for any ideas... Thanks! In reply to Returning _which_ pattern matched...? by Boudicca
|
|