https://bugs.exim.org/show_bug.cgi?id=2211
Bug ID: 2211
Summary: Possible bug in pcredemo when checking for an empty
match with patterns involving \K in lookarounds
Product: PCRE
Version: N/A
Hardware: x86
OS: Windows
Status: NEW
Severity: bug
Priority: medium
Component: Documentation
Assignee: ph10@???
Reporter: tattarakis@???
CC: pcre-dev@???
Hi Philip!
It appears that mIRC, regex101, and even PHP are mishandling global matches
with patterns involving \K in lookarounds, and I believe I've traced the
problem to the following bit of code in pcredemo:
[code]
/* If the previous match was for an empty string, we are finished if we are
at the end of the subject. Otherwise, arrange to run another match at the
same point to see if a non-empty match can be found. */
if (ovector[0] == ovector[1])
[/code]
Because the user can distort ovector[0] by using \K in lookarounds such as
"(?<=\K.)" and "(?=.\K)", I believe some cases of empty matches are going
undetected.
I think the solution would be to instead compare ovector[1] to the initial
start_offset value, which cannot be altered.
Thank you as always!
- John
--
You are receiving this mail because:
You are on the CC list for the bug.