Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Finding match offsets of named captures in 5.10 regex

by JavaFan (Canon)
on Sep 27, 2008 at 21:11 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://714060]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2024-04-19 17:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found