[Mono-bugs] [Bug 53032][Min] New - System.Text.RegularExpression.Match has broken Groups, when match failed
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Sun, 18 Jan 2004 16:01:28 -0500 (EST)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by nazgul@omega.pl.
http://bugzilla.ximian.com/show_bug.cgi?id=53032
--- shadow/53032 2004-01-18 16:01:28.000000000 -0500
+++ shadow/53032.tmp.867 2004-01-18 16:01:28.000000000 -0500
@@ -0,0 +1,50 @@
+Bug#: 53032
+Product: Mono/Class Libraries
+Version: unspecified
+OS:
+OS Details: Mandrake 9.2, mono 0.29
+Status: NEW
+Resolution:
+Severity:
+Priority: Minor
+Component: System
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: nazgul@omega.pl
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: System.Text.RegularExpression.Match has broken Groups, when match failed
+
+Description of Problem:
+/////////////////////////////////////////
+using System.Text.RegularExpressions;
+
+class X {
+
+ static int Main ()
+ {
+ Regex r = new Regex ("(?<a>c)");
+ Match m = r.Match("a");
+ for (int i = 0; i < m.Groups.Count; i++)
+ System.Console.WriteLine (m.Groups[i].ToString());
+ return 0;
+ }
+}
+/////////////////////////////////////////////
+
+Steps to reproduce the problem:
+compile and run above program with
+mcs test.cs
+mono text.exe
+
+Actual Results:
+Unhandled Exception: System.NullReferenceException: A null value was
+found where an object instance was required
+
+Expected Results:
+blank line in output (group(s) should contain empty string), at least
+compared to Microsoft .Net framework
+
+How often does this happen?
+Always