my @sentences = ( 'This is a sentence', 'This is another sentence', ); my $matches = grep /\bthis is\b/i , @sentences;