(W) You used a backslash-character combination which is not recognized
by Perl. This combination appears in an interpolated variable or a
-C<'>-delimited regular expression.
+C<'>-delimited regular expression. The character was understood literally.
+
+=item /%s/: Unrecognized escape \\%c in character class passed through
+
+(W) You used a backslash-character combination which is not recognized
+by Perl inside character classes. The character was understood literally.
=item /%s/ should probably be written as "%s"
=item Unrecognized escape \\%c passed through
(W) You used a backslash-character combination which is not recognized
-by Perl.
+by Perl. The character was understood literally.
=item Unterminated attribute parameter in attribute list
(W) You used a backslash-character combination which is not recognized
by Perl. This combination appears in an interpolated variable or a
-C<'>-delimited regular expression.
+C<'>-delimited regular expression. The character was understood literally.
+
+=item /%s/: Unrecognized escape \\%c in character class passed through
+
+(W) You used a backslash-character combination which is not recognized
+by Perl inside character classes. The character was understood literally.
=item /%s/ should probably be written as "%s"
default:
if (!SIZE_ONLY && ckWARN(WARN_UNSAFE) && isALPHA(*p))
Perl_warner(aTHX_ WARN_UNSAFE,
- "/%.127s/: Unrecognized escape \\%c passed through",
- PL_regprecomp,
- *p);
+ "/%.127s/: Unrecognized escape \\%c passed through",
+ PL_regprecomp,
+ *p);
goto normal_default;
}
break;
value = scan_oct(--PL_regcomp_parse, 3, &numlen);
PL_regcomp_parse += numlen;
break;
+ default:
+ if (!SIZE_ONLY && ckWARN(WARN_UNSAFE) && isALPHA(value))
+ Perl_warner(aTHX_ WARN_UNSAFE,
+ "/%.127s/: Unrecognized escape \\%c in character class passed through",
+ PL_regprecomp,
+ value);
+ break;
}
}
if (namedclass > OOB_NAMEDCLASS) {
value = scan_oct(--PL_regcomp_parse, 3, &numlen);
PL_regcomp_parse += numlen;
break;
+ default:
+ if (!SIZE_ONLY && ckWARN(WARN_UNSAFE) && isALPHA(value))
+ Perl_warner(aTHX_ WARN_UNSAFE,
+ "/%.127s/: Unrecognized escape \\%c in character class passed through",
+ PL_regprecomp,
+ value);
+ break;
}
}
if (namedclass > OOB_NAMEDCLASS) {
/%.127s/: false [] range \"%*.*s\" in regexp [S_regclassutf8]
+ /%.127s/: Unrecognized escape \\%c in character class passed through" [S_regclass]
+
+ /%.127s/: Unrecognized escape \\%c in character class passed through" [S_regclassutf8]
+
__END__
# regcomp.c [S_regpiece]
use warnings 'unsafe' ;
########
# regcomp.c [S_regatom]
use warnings 'unsafe' ;
-$a =~ /\m/ ;
+$a =~ /a\mb\b/ ;
no warnings 'unsafe' ;
+$a =~ /a\mb\b/ ;
EXPECT
Unrecognized escape \m passed through at - line 3.
########
/[[:digit:]-b]/: false [] range "[:digit:]-" in regexp at - line 11.
/[[:alpha:]-[:digit:]]/: false [] range "[:alpha:]-" in regexp at - line 12.
/[[:digit:]-[:alpha:]]/: false [] range "[:digit:]-" in regexp at - line 13.
+########
+# regcomp.c [S_regclass S_regclassutf8]
+use warnings 'unsafe' ;
+$a =~ /[a\zb]/ ;
+no warnings 'unsafe' ;
+$a =~ /[a\zb]/ ;
+EXPECT
+/[a\zb]/: Unrecognized escape \z in character class passed through at - line 3.