[pcre-dev] [Bug 760] New: Named patterns with same index con…

Kezdőlap
Üzenet törlése
Szerző: Stan Vassilev
Dátum:  
Címzett: pcre-dev
Új témák: [pcre-dev] [Bug 760] Named patterns with same index conflict
Tárgy: [pcre-dev] [Bug 760] New: Named patterns with same index conflict
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=760
           Summary: Named patterns with same index conflict
           Product: PCRE
           Version: N/A
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
        AssignedTo: ph10@???
        ReportedBy: sv4php@???
                CC: pcre-dev@???



Check this bug reported on PHP (by me):

http://bugs.php.net/bug.php?id=46068

This bug is caused by the inability of PCRE to differentiate and/or report
named subpatterns that share numerican index, through its current interface.

PCRE would report all three named patterns as "1" (which is correct due to the
use of the switch group (?| ... | ... )), but will not report which one
matched, and only one of them can match.

Instead, the report is ordered alphabetically and hence PHP just reports "zoo"
in the example above, the last item in the list.

I'd suggest a flag is maintained internally or additional information / calls
are introduced to handle this special case for named subpatterns in a switch
group, so that implementers can report the correct name and fix this bug.
Thanks.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email