[pcre-dev] [Bug 2406] New: Non-greedy multiline match appear…

Pàgina inicial
Delete this message
Autor: admin
Data:  
A: pcre-dev
Assumpte: [pcre-dev] [Bug 2406] New: Non-greedy multiline match appears to be greedy
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: ph10@???
          Reporter: earl_chew@???
                CC: pcre-dev@???


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.