FAIL("Missing right brace on \\x{}");
else if (UTF) {
numlen = 1; /* allow underscores */
- ender = (UV)scan_hex(p + 1, e - p, &numlen);
+ ender = (UV)scan_hex(p + 1, e - p - 1, &numlen);
/* numlen is generous */
if (numlen + len >= 127) {
p--;
FAIL("trailing \\ in regexp");
/* FALL THROUGH */
default:
- if (!SIZE_ONLY && ckWARN(WARN_REGEXP) && isALPHA(*p))
+ if (!SIZE_ONLY && ckWARN(WARN_REGEXP) &&
+ isALPHA(*p) && *p != '_')
Perl_warner(aTHX_ WARN_REGEXP,
"/%.127s/: Unrecognized escape \\%c passed through",
PL_regprecomp,
PL_regcomp_parse += numlen;
break;
default:
- if (!SIZE_ONLY && ckWARN(WARN_REGEXP) && isALPHA(value))
+ if (!SIZE_ONLY && ckWARN(WARN_REGEXP) &&
+ isALPHA(value) && value != (UV)'_')
Perl_warner(aTHX_ WARN_REGEXP,
"/%.127s/: Unrecognized escape \\%c in character class passed through",
PL_regprecomp,
PL_regcomp_parse += numlen;
break;
default:
- if (!SIZE_ONLY && ckWARN(WARN_REGEXP) && isALPHA(value))
+ if (!SIZE_ONLY && ckWARN(WARN_REGEXP) &&
+ isALPHA(value) && value != (U32)'_')
Perl_warner(aTHX_ WARN_REGEXP,
"/%.127s/: Unrecognized escape \\%c in character class passed through",
PL_regprecomp,