my @strings = qw(blah blubb hallo welt hallohallohallo hallihallo); my $re = qr{^(?!hallo\z)}; print "$_\n" for grep /$re/, @strings;