[pcre-dev] [Bug 2182] Lookahead behaving as though a match …

Pàgina inicial
Delete this message
Autor: admin
Data:  
A: pcre-dev
Assumpte: [pcre-dev] [Bug 2182] Lookahead behaving as though a match succeeded in a null-matching repeated group
https://bugs.exim.org/show_bug.cgi?id=2182

Philip Hazel <ph10@???> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WONTFIX
             Status|NEW                         |RESOLVED


--- Comment #3 from Philip Hazel <ph10@???> ---
Your examples do work as expected in PCRE2 release 10.30:

PCRE2 version 10.31-RC1 2017-09-12
/^(?:(?=(\1?+a))(?=aaa$).){1,2}/
aaa
0: a
1: a

/^a(?:(?<=(.))[^c])*c/
abc
0: abc
1: a

They do appear to be broken in PCRE1 and I think this is a duplicate of #1887,
which says this: "Somehow, when declaring a capturing group inside an
assertion, the capturing group isn't reset when backtracking." The Change Log
for PCRE2 release 10.30 says this: "The main interpreter, pcre2_match(), has
been refactored into a new version that does not use recursive function calls
(and therefore the stack) for remembering backtracking positions. This makes
--disable-stack-for-recursion a NOOP. The new implementation allows
backtracking into recursive group calls in patterns, making it more compatible
with Perl, and also fixes some other hard-to-do issues such as #1887 in
Bugzilla."

PCRE1 (the 8.xx series) is obsolescent (PCRE2 has been out nearly 3 years now)
and I'm afraid that only straightforward issues will now get fixed in PCRE1.

--
You are receiving this mail because:
You are on the CC list for the bug.