$user_string = "[SYN, ACK]"; if ($x =~ /\Q$user_string\E/) { print("match\n"); } else { print("no match\n"); }