summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/regcomp.c b/regcomp.c
index 89b3e53bab..0407e69787 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -2646,7 +2646,8 @@ tryagain:
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,
@@ -2959,7 +2960,8 @@ S_regclass(pTHX)
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,
@@ -3443,7 +3445,8 @@ S_regclassutf8(pTHX)
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,