[pcre-dev] [Bug 2211] Possible bug in pcredemo when checking…

Top Page
Delete this message
Author: admin
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 2211] Possible bug in pcredemo when checking for an empty match with patterns involving \K in lookarounds
https://bugs.exim.org/show_bug.cgi?id=2211

Philip Hazel <ph10@???> changed:

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


--- Comment #1 from Philip Hazel <ph10@???> ---
Perl gets it wrong too, but when I checked pcre2test, I found that it gets it
right. There is additional code in pcre2test specifically for these cases. I
have now put similar code into pcre2demo.c. There are two cases, corresponding
to your two patterns: (1) For "(?<=.\K)" the end of the match is at the
original start, even though the length is non-zero. The solution is to behave
as if for an empty string. (2) For "(?=.\K)" the end of the match is before the
start. The solution in pcre2test is to print a message and then output from end
to start instead of from start to end. In pcre2demo I made it do this as well,
but then abort.

Note that I have modified pcre2demo, not pcredemo. PCRE2 has been out nearly 3
years now and I'm only fixing serious and relatively easily fixable bugs in
PCRE1.

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