while ($string =~ /(?=(patter))/g) { do_something_with($1); }