diff options
-rw-r--r-- | regcomp.c | 5 | ||||
-rw-r--r-- | regexp.h | 1 |
2 files changed, 4 insertions, 2 deletions
@@ -4442,7 +4442,7 @@ Perl_re_compile(pTHX_ SV * const pattern, U32 pm_flags) SvFLAGS(rx) |= SvUTF8(pattern); *p++='('; *p++='?'; if (has_minus) { /* If a default, cover it using the caret */ - *p++='^'; + *p++= DEFAULT_PAT_MOD; } if (has_p) *p++ = KEEPCOPY_PAT_MOD; /*'p'*/ @@ -6120,7 +6120,8 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth) RExC_parse--; /* for vFAIL to print correctly */ vFAIL("Sequence (? incomplete"); break; - case '^': /* Use default flags with the exceptions that follow */ + case DEFAULT_PAT_MOD: /* Use default flags with the exceptions + that follow */ has_use_defaults = TRUE; STD_PMMOD_FLAGS_CLEAR(&RExC_flags); goto parse_flags; @@ -247,6 +247,7 @@ and check for NULL. * for compatibility reasons with Regexp::Common which highjacked (?k:...) * for its own uses. So 'k' is out as well. */ +#define DEFAULT_PAT_MOD '^' /* Short for all the default modifiers */ #define EXEC_PAT_MOD 'e' #define KEEPCOPY_PAT_MOD 'p' #define ONCE_PAT_MOD 'o' |