You could also allow for referencing the whole match as 0 with:
$str =~ $regex; my @matches = map substr( $str, $-[$_], $+[$_] - $-[$_] ), 0..$#-;
In reply to Re^2: Double interpolation of captured substrings
by Fletch
in thread Double interpolation of captured substrings
by bobf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |