You've got the offsets you need in @- and @+, you just need to use them to pull it out.
my @matches = do { local $str = $_; map { substr( $str, $-[$_], $+[$_] + - $-[$_] ) } 1..$#-; }
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re: Get all captured substrings after a substitution
by Fletch
in thread Get all captured substrings after a substitution
by Polynomial
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |