use strict ; use warnings ; my @stopwords = qw{ sous } ; my $string = "sous sous-alimentation" ; my ($rx) = map qr/(?:$_)/, join "|", map qr/\b\Q$_\E\b(?!\-)/, @stopwords; $string =~ s/$rx//g ; print $string ; __END__ sous-alimentation