my $tag = q{}; if ($str =~ m/\Q$tag\E/) { print "«$str» contains «$tag»\n"; }