if ($str =~ /(\\x{[A-F\d]+})/i){ // error by perl -Tcw if ($str =~ /^(\d{2,4})[^\d](\d{2})/){ // no error by perl -Tcw