https://bugs.exim.org/show_bug.cgi?id=2232
Bug ID: 2232
Summary: Whitespace after subpattern definition seems to
disable backtracking
Product: PCRE
Version: 10.30 (PCRE2)
Hardware: x86
OS: Linux
Status: NEW
Severity: bug
Priority: medium
Component: Code
Assignee: ph10@???
Reporter: david.lanzenberger@???
CC: pcre-dev@???
Consider the following pattern:
(?(DEFINE)(?<optional_a>a?))^(?&optional_a)a$
As expected (with the new PCRE2 10.30 subpattern backtracking), it matches the
subject strings "a" and "aa". However, if we insert a new line after the
definition of optional_a, the pattern matches only the string "aa":
(?(DEFINE)(?<optional_a>a?)
)^(?&optional_a)a$
As a workaround, one can use (?x) as follows:
(?(DEFINE)(?x)(?<optional_a>a?)
)^(?&optional_a)a$
--
You are receiving this mail because:
You are on the CC list for the bug.