[pcre-dev] [Bug 2446] New: Positive lookbehind assertions wi…

Top Page

Reply to this message
Author: admin
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 2446] New: Positive lookbehind assertions with nested assertions behave differently in PCRE and PCRE2
https://bugs.exim.org/show_bug.cgi?id=2446

            Bug ID: 2446
           Summary: Positive lookbehind assertions with nested assertions
                    behave differently in PCRE and PCRE2
           Product: PCRE
           Version: 10.32 (PCRE2)
          Hardware: x86-64
                OS: Linux
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
          Assignee: ph10@???
          Reporter: pako@???
                CC: pcre-dev@???


In PHP 7.2, which uses PCRE 8.41, the following call:

preg_split("/(?<='(?!t(?<=n't)))/ui", "n't", null, PREG_SPLIT_NO_EMPTY)

returns the following array:

[
0 => n't
]

However in PHP 7.3, which uses PCRE 10.32, the result for the same call is
different:

[
0 => n',
1 => t
]

It seems that the positive lookbehind assertion is treated differently. It
looks like a bug in PCRE2, as other regular expression implementations (for
example, in Java) behave in the same way as PCRE1 for this expression.

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