[Mono-bugs] [Bug 54797][Nor] New - Invalid ArgumentException in Regex constructor

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 24 Feb 2004 11:54:53 -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 gert.driesen@pandora.be.

http://bugzilla.ximian.com/show_bug.cgi?id=54797

--- shadow/54797	2004-02-24 11:54:53.000000000 -0500
+++ shadow/54797.tmp.30485	2004-02-24 11:54:53.000000000 -0500
@@ -0,0 +1,54 @@
+Bug#: 54797
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: Gentoo 1.4 & Windows 2003
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gert.driesen@pandora.be               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Invalid ArgumentException in Regex constructor
+
+When passing ^[\s\0]*$ to the Cegex constructor the following exception is 
+thrown :
+
+Unhandled Exception: System.ArgumentException: parsing "^[\s\0]*$" - 
+Unterminated [] set.
+Parameter name: ^[\s\0]*$
+in <0x004d7> 
+System.Text.RegularExpressions.Syntax.Parser:ParseCharacterClass 
+(System.Text.RegularExpressions.RegexOptions)
+in <0x0036b> System.Text.RegularExpressions.Syntax.Parser:ParseGroup 
+(System.Text.RegularExpressions.Syntax.Group,System.Text.RegularExpressions
+.RegexOptions,System.Text.RegularExpressions.Syntax.Assertion)
+in <0x0007b> 
+System.Text.RegularExpressions.Syntax.Parser:ParseRegularExpression
+ (string,System.Text.RegularExpressions.RegexOptions)
+in <0x0008d> System.Text.RegularExpressions.Regex:.ctor 
+(string,System.Text.RegularExpressions.RegexOptions)
+in <0x00012> System.Text.RegularExpressions.Regex:.ctor (string)
+in <0x00025> RegexIssue.Test:Main ()
+
+You can reproduce it using the following code fragment :
+
+using System;
+using System.Text.RegularExpressions;
+
+namespace RegexIssue {
+	public class Test {
+		public static void Main() {
+            		Regex r = new Regex(@"^[\s\0]*$");
+            		Console.WriteLine("Whitespace only? " + r.Match(" 
+\0").Success);
+		}
+	}
+}
+
+This works fine on MS.NET.