perlvar lists @- and @+, but you still need a while loop to capture them:
#!/usr/local/bin/perl use strict; use Data::Dumper; my $str = 'abacadabra'; my @matches; push @matches, [ map { substr $str, $-[$_], $+[$_]-$-[$_] } 1..$#+ ] while $str =~ /([ac])([bd])/g; print Dumper \@matches;
In reply to Re: global regex returning a list of arrays?
by Corion
in thread global regex returning a list of arrays?
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |