[Mono-bugs] [Bug 474154] New: Regex.Match(string, int, int) behaves differently than Microsoft's implementation.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Feb 9 19:02:29 EST 2009


https://bugzilla.novell.com/show_bug.cgi?id=474154


           Summary: Regex.Match(string, int, int) behaves differently than
                    Microsoft's implementation.
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.2.x
          Platform: Macintosh
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: dmitchell at logos.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_5; en-us)
AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1

Certain regular expressions will behave differently on Mono when calling
Regex.Match(string, int, int). In particular the expression

new Regex("^quick$").Match("The quick brown fox jumps over the lazy dog.", 4,
5).Success

evaluates to true in Microsoft's implementation, but false in Mono. It appears
that in Microsoft's implementation, the results of the method are comparable to
calling string.Substring() on the string being passed in, except that indexes
are still reported in terms of the original string.

As a side note, the expression

new Regex("^quick").Match("The quick brown fox jumps over the lazy dog.",
4).Success

evaluates to false both in Microsoft's implementation and in Mono. Any fix to
the former should not break the latter.

Reproducible: Always

Steps to Reproduce:
1. Paste the code into a test application that prints the result of the
expression
2. Run it
Actual Results:  
The first expression evaluates to true in Microsoft's implementation, but false
in Mono.
The second expression evaluates to false in both implementations.

Expected Results:  
The first expression should evaluate to true in Mono, and the second expression
should evaluate to false in Mono.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list