Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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.

Replies are listed 'Best First'.
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 pondering the Monastery: (14)
As of 2016-06-29 20:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (387 votes). Check out past polls.