[Mono-bugs] [Bug 525313] New: Regex does not function the same as MS.Net

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Jul 26 13:17:15 EDT 2009


           Summary: Regex does not function the same as MS.Net
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.2.x
          Platform: i386
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: st4rnin3 at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:
Gecko/2009061622 Mandriva/ (2009.1) Firefox/3.0.11

I am having some issues with Regex processing.  It seems that the Mono engine
and the .NET engine get different results.

The code below works just fine on my Windows PC, but gets no matches on my
Linux System.  

I am using Mandriva 2009 Spring, with the 2.2 version of Mono.  I have not
downloaded the latest 2.4 release. I was trying not to have to manually install
on Mandriva (2.2 is the latest in their package system)

I have taken a snippet of code (with some hard coded data) for demonstration
            string sData =
001-00000151 :LastNameHolder;FirstnameHolder :Address Holder";

            string sPattern;
            sPattern = @"---+\r\n(?<AccountNumber>\d{3}-\d{8}).*?";

            MatchCollection mc;
            mc = Regex.Matches(sData, sPattern, RegexOptions.IgnoreCase |
            label1.Text = string.Format("{0} matches found", mc.Count);


--Dan Gentry

Reproducible: Always

Steps to Reproduce:
1.Run code listed above
Actual Results:  
0 matches found (on Linux System)

Expected Results:  
1 match found (as on Windows System)

Configure bugmail: http://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