my $string = 'foo foo fooo'; while( $string =~ /(fo+)/g) { my $match = Regex::Object->collect(); push @matches, $match; }