#! perl use strict; use warnings; use Data::Dump; my $string = 'The quick brown fox jumps over the house of the lazy dog'; my @matches = $string =~ /(?=(the .*? dog))/gi; dd \@matches;