Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: Determining which pattern matched

by rubasov (Friar)
on Apr 05, 2010 at 22:42 UTC ( #832939=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Determining which pattern matched
in thread Determining which pattern matched

I've just wanted to demonstrate the technic without much clutter, but you're absolutely right. I should take care to demonstrate the best practice which is using local our instead of my along with (?{ }).

Here's a great thread explaining the reason behind this for the interested monks (including ikegami's notes): Regexes: finding ALL matches (including overlap).


Comment on Re^3: Determining which pattern matched
Select or Download Code
Replies are listed 'Best First'.
Re^4: Determining which pattern matched
by ikegami (Pope) on Apr 06, 2010 at 00:24 UTC
    My comments in that thread were on an entirely different matter (handling backtracking through (?{}), which isn't an issue in the code here), but blokhead mentioned the issue with lexicals in that thread.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://832939]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (15)
As of 2015-07-28 15:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (257 votes), past polls