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: p...@hermes.cam.ac.uk
          Reporter: david.lanzenber...@ergon.ch
                CC: pcre-dev@exim.org

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.
-- 
## List details at https://lists.exim.org/mailman/listinfo/pcre-dev 

Reply via email to