[pcre-dev] [Bug 947] New: Very weird bug.

Top Page
Delete this message
Author: Reko Tiira
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 947] New: Very weird bug.
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=947
           Summary: Very weird bug.
           Product: PCRE
           Version: 8.0
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
        AssignedTo: ph10@???
        ReportedBy: reko@???
                CC: pcre-dev@???



I can't really summarize it better. Let's post an example:

Here's a regexp:

^(xa|=?\1a){2}$

Here's a string to match against:

xa=xaaa

It matches although it really shouldn't. Tested with other regex engines such
as JGSoft and .NET and they deal with this correctly. Also I think that older
versions of PCRE also dealt with this correctly because RegexBuddy (which uses
PCRE 6.x I think) doesn't have this issue. So my guess is that this bug has
been introduced sometime after that.

If you change =? to just =:
^(xa|=\1a){2}$

Then it fails like it should. But they should both fail, because making the =
optional shouldn't change the behavior of the regexp against this particular
string.


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