[pcre-dev] [Bug 2332] New: Different greed of subpattern and…

Kezdőlap
Üzenet törlése
Szerző: admin
Dátum:  
Címzett: pcre-dev
Tárgy: [pcre-dev] [Bug 2332] New: Different greed of subpattern and defined subrouting
https://bugs.exim.org/show_bug.cgi?id=2332

            Bug ID: 2332
           Summary: Different greed of subpattern and defined subrouting
           Product: PCRE
           Version: 10.22 (PCRE2)
          Hardware: All
                OS: All
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
          Assignee: ph10@???
          Reporter: david@???
                CC: pcre-dev@???


(I am not sure whether this is related to Bug 2232 …)

For this input string "pokus." these patterns produces different results,
although from my point of view it should not be different.

1) pattern "word following with dot": 
'~   (?<word> \w+ )*    \.   ~xi'


result in PCRE & PCRE2:
0: pokus.
1: pokus

Yes, this is expected.


2) pattern rewritten to use DEFINE:

'~
    (?(DEFINE) (?<word> \w+ ) )
    (?&word)*   \.
~xi'


result in PCRE & PCRE 2:
0: .



3) pattern rewritten to use DEFINE with additional (irrelevant?) subpattern
'~
    (?(DEFINE) (?<word> \w+ ) )
    ( (?&word)* )   \.
~xi'


result in PCRE 8.38:
0: pokus.
1: <unset>
2: pokus

result in PCRE2 10.22:
0: .
1: <unset>
2:

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