Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Finding match offsets of named captures in 5.10 regex

by JavaFan (Canon)
on Sep 27, 2008 at 21:11 UTC ( #714060=note: print w/ replies, xml ) Need Help??


in reply to Finding match offsets of named captures in 5.10 regex

Every named capture is numbered as well. So if you have a capture called 'foo', and it's the third capture, you find the offsets in $- [2] and $+ [2]. There isn't a hash with the indexes.


Comment on Re: Finding match offsets of named captures in 5.10 regex
Select or Download Code
Re^2: Finding match offsets of named captures in 5.10 regex
by JadeNB (Chaplain) on Sep 28, 2008 at 18:40 UTC
    It seems that the whole point of using named captures is not wanting to have to keep track of the position of those captures, so maybe this way of getting at it isn't so useful. Is there any programmatic way to translate from named captures to the corresponding numbers?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2014-10-23 00:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (123 votes), past polls