I tried to look into Tie::Hash::NamedCapture, the "Pragmatic Module" used to implement %+ and %- but stopped at the XS barrier
I looked at this as well, specifically at FIRSTKEY and NEXTKEY in NamedCapture.xs, because I was hoping that maybe the iteration order would be the same as the order of the capture groups, but sadly that doesn't seem to be the case. Anyway, its implementation appears to use named_buff_iter in regcomp.c, and the central function here appears to be reg_named_buff_nextkey. But that's as far as I've gotten in my research, my understanding of the internals isn't good enough to see if there's an "easy" way to access the capture group name to number mapping.
In reply to Re: [RE] match positions of named captures?
by haukex
in thread [RE] match positions of named captures?
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |