https://bugs.exim.org/show_bug.cgi?id=2406

            Bug ID: 2406
           Summary: Non-greedy multiline match appears to be greedy
           Product: PCRE
           Version: 10.33 (PCRE2)
          Hardware: x86
                OS: All
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

I am using pcre2-10.33.tar.gz with this test file:

-----------
Date=A
Key=AAA-BBB-CCC
RECORD

Date=B
Key=NONE
RECORD

Date=C
Key=AAA-BBB-ZZZ
RECORD
----------

Using the following reports two matches, as expected, but the second match
seems to incorporate Date=B, whereas my expectation using the non-greedy match
*? is that the output should only include Date=C:

$ pcre2grep -M '(?s)Date=.*?\nKey=AAA-BBB-' /tmp/foo.txt
Date=A
Key=AAA-BBB-CCC
Date=B
Key=NONE
RECORD

Date=C
Key=AAA-BBB-ZZZ

-- 
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