Συντάκτης: Ralf Junker
Ημερομηνία:
Υ/ο: pcre-dev@exim.org
Αντικείμενο: Re: [pcre-dev] Regression: Lookbehind assertions with fixed number
of repetitions
On 14.11.2011 21:10, Sheri wrote:
> Your patterns work fine with 8.20 release version here. Have you tried
> them in pcretest?
Thanks for testing! I investigated further and realized that the problem
only manifests if the PCRE_CASELESS compile option is set.
With this, the error also shows in pcretest. The 1st example with the
PCRE_CASELESS modifier produces the compile error, the 2nd passes as
expected:
/(?<=a{2})b/i
aab
/(?<=a{2})b/
aab
It appears that exact caseless repeats are not checked in
find_fixedlength(). The following change to pcre_compile.c seems to fix it:
/* Handle exact repetitions. The count is already in characters, but we
need to skip over a multibyte character in UTF8 mode. */
case OP_EXACT:
case OP_EXACTI: // Added this line - was it missing?
branchlength += GET2(cc,1);
cc += 4;
Is my assumption correct? Could someone else test as well?
Ralf