Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^8: Regexp not capturing in named subrules

by diotalevi (Canon)
on Sep 16, 2009 at 18:56 UTC ( #795698=note: print w/ replies, xml ) Need Help??


in reply to Re^7: Regexp not capturing in named subrules
in thread Regexp not capturing in named subrules

Oh, hey. I didn't find that earlier because it seems to be misfiled under the (?(condition)yes-pattern|no-pattern) section but it goes on to answer my original question

From perlre:

/(?<NAME>(?&NAME_PAT)) (?(DEFINE) (?<NAME_PAT>....) )/x

Note that capture buffers matched inside of recursion are not accessible after the recursion returns, so the extra layer of capturing buffers is necessary. Thus $+{NAME_PAT} would not be defined even though $+{NAME} would be.


Comment on Re^8: Regexp not capturing in named subrules
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (10)
As of 2014-10-21 15:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (105 votes), past polls