http://www.perlmonks.org?node_id=1016057


in reply to offset of named capture buffer

Per perlre:

"(?<NAME>pattern)"
    A named capture group. Identical in every respect to normal
    capturing parentheses "()" but for the additional fact ...

Don't know if this helps much, but if you already know the ordinal number of the capture group associated with a named capture, then  @- @+ work exactly as advertised. (But it sounds as if you want to go from the named group to its capture group ordinal.)

>perl -wMstrict -le "my $s = 'xxx fooooo yyy'; ;; $s =~ m{ (x+) .*? (?<FOO>fo+) .*? (y+) }xms; ;; print qq{'$1' '$+{FOO}' '$3'}; print qq{'$1' '$2' '$3'}; print qq{/fo+/ at $-[2] to $+[2]}; " 'xxx' 'fooooo' 'yyy' 'xxx' 'fooooo' 'yyy' /fo+/ at 4 to 10