I haven't fully evaluated or tested your code, but a couple of comments and, if I understood correctly, the answer to your question:
my $regex = qr{ (?<foo> fo+ ) }msx; "barfooobar" =~ $regex; print "<",$+{foo},">\n"; # prints "<fooo>"
In reply to Re: Regex result being defined when it shouldn't be(?)
by haukex
in thread Regex result being defined when it shouldn't be(?)
by chenhonkhonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |