From: Ævar Arnfjörð Bjarmason Date: Thu, 10 Apr 2008 00:38:52 +0000 (+0000) Subject: Re: [perl #52672] regexp failure: (?=) turns into OPFAIL X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=89c6a13e141e02cc3af670ab47c1d41ac4e81ba0;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #52672] regexp failure: (?=) turns into OPFAIL From: "Ævar Arnfjörð Bjarmason" Message-ID: <51dd1af80804091738r15d37763lf900d59f8bcc5e81@mail.gmail.com> p4raw-id: //depot/perl@33667 --- diff --git a/regcomp.c b/regcomp.c index 05b54ee..07d5535 100644 --- 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 == ')') { diff --git a/t/op/re_tests b/t/op/re_tests index 3df3745..6894458 100644 --- a/t/op/re_tests +++ b/t/op/re_tests @@ -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