foreach ('abc' =~ /.+?/a) { print "$_\n"; } __END__ a ab abc b bc c #### use Regexp::AllMatches; my $matcher = Regexp::AllMatches->new(STRING => qr/PATTERN/); while (my ($match) = $matcher->next) { print "$match\n"; } #### * new * clone * next #### * prematch ($`) * match ($&) * postmatch ($`) * group ($<*digits*>) * groups #### * curr * prev * reset * all