my @match = qw(; : -); my $match = join('|', map { "\Q$_" } @match); if ('random-text' =~ /$match/) { print "yep\n"; } else { print "nope\n"; }