Re: [perl #52672] regexp failure: (?=) turns into OPFAIL
Ævar Arnfjörð Bjarmason [Thu, 10 Apr 2008 00:38:52 +0000 (00:38 +0000)]
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Message-ID: <51dd1af80804091738r15d37763lf900d59f8bcc5e81@mail.gmail.com>

p4raw-id: //depot/perl@33667

regcomp.c
t/op/re_tests

index 05b54ee..07d5535 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -5691,6 +5691,8 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
                 RExC_seen |= REG_SEEN_LOOKBEHIND;
                RExC_parse++;
            case '=':           /* (?=...) */
+               RExC_seen_zerolen++;
+                       break;
            case '!':           /* (?!...) */
                RExC_seen_zerolen++;
                if (*RExC_parse == ')') {
index 3df3745..6894458 100644 (file)
@@ -414,6 +414,7 @@ a[-]?c      ac      y       $&      ac
 '(abc)\1'i     ABCABC  y       $1      ABC
 '([a-c]*)\1'i  ABCABC  y       $1      ABC
 a(?!b).        abad    y       $&      ad
+(?=)a  a       y       $&      a
 a(?=d).        abad    y       $&      ad
 a(?=c|d).      abad    y       $&      ad
 a(?:b|c|d)(.)  ace     y       $1      e