[Mono-bugs] [Bug 421795] New: Regex GroupCollection incorrectly handles numeric group names

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Aug 30 18:46:22 EDT 2008


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


           Summary: Regex GroupCollection incorrectly handles numeric group
                    names
           Product: Mono: Class Libraries
           Version: 2.0
          Platform: x86-64
        OS/Version: openSUSE 10.3
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: philippe at activa.be
         QAContact: mono-bugs at lists.ximian.com
          Found By: Other


Description of Problem:

In a regex of the form "(?<100>test)", the match group collection should match
the group "100" when Match.Groups[100] is called. The only way to make this
work is by calling Match.Groups["100"]

Steps to reproduce the problem:

/////======================================

Match m = Regex.Match("test","(?<100>test)");

Assert.IsTrue(m.Groups["100"].Success); // successful
Assert.IsTrue(m.Groups[100].Success); // fails!

/////======================================

The MSDN documentation is not very clear about how this should work, but both
tests succeed when run on the MS .NET Framework


-- 
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