[Mono-bugs] [Bug 71591][Nor] New - Regex {} problem

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 21 Jan 2005 17:19:44 -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 cleonard@go.ro.

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

--- shadow/71591	2005-01-21 17:19:44.000000000 -0500
+++ shadow/71591.tmp.7056	2005-01-21 17:19:44.000000000 -0500
@@ -0,0 +1,65 @@
+Bug#: 71591
+Product: Mono: Class Libraries
+Version: 1.0
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: cleonard@go.ro               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Regex {} problem
+
+Description of Problem:
+Mono doesn't like the following regex: @"\${(?<var>[\w|_]+)}", because the
+{} is not escaped. This seems like a legitimate error, but ms.net allows it.
+
+I found this code in some .net app but I don't know anything about regexps,
+so I can't say a lot about it. 
+
+Somebody has to look into this, check on ms.net, and if appropiate fix it
+in mono. This might be a bug in ms.net
+
+Steps to reproduce the problem:
+Compile and run the following
+
+public class Program
+{
+    static void Main()
+    {
+        new System.Text.RegularExpressions.Regex(@"\${(?<var>[\w|_]+)}");
+    }
+}
+
+Actual Results:
+This message on stdout
+Unhandled Exception: System.ArgumentException: parsing
+"\${(?<var>[\w|_]+)}" - Illegal {x,y}
+Parameter name: \${(?<var>[\w|_]+)}
+in <0x00242>
+System.Text.RegularExpressions.Syntax.Parser:ParseRepetitionBounds
+(int&,int&,System.Text.RegularExpressions.RegexOptions)
+in <0x00721> System.Text.RegularExpressions.Syntax.Parser:ParseGroup
+(System.Text.RegularExpressions.Syntax.Group,System.Text.RegularExpressions.RegexOptions,System.Text.RegularExpressions.Syntax.Assertion)
+in <0x00087>
+System.Text.RegularExpressions.Syntax.Parser:ParseRegularExpression
+(string,System.Text.RegularExpressions.RegexOptions)
+in <0x00094> System.Text.RegularExpressions.Regex:.ctor
+(string,System.Text.RegularExpressions.RegexOptions)
+in <0x00012> System.Text.RegularExpressions.Regex:.ctor (string)
+in <0x00022> Program:Main ()
+
+Expected Results:
+It shouldn't do anything, obviousely
+
+How often does this happen? 
+Always
+
+Additional Information:
+This is mono 1.0.4 package on debian, but I don't think it's relevant