The results of captures inside the recursion aren't available outside the recursion. See the last paragraph for the DEFINE in perlre. %- will have keys for the names of the bits in DEFINE, but their values will always be undef.
You need to capture the parts you want and name them yourself (similar to the example in perlre):
my $number_re = qr{ (?(DEFINE) (?<int_pat> \d+ ) ) (?<int>(?&int_pat)) }x;
In reply to Re: 5.10 named capture in DEFINE regex
by brian_d_foy
in thread 5.10 named capture in DEFINE regex
by philcrow
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |