[Mono-bugs] [Bug 41350][Wis] New - System.Text.RegularExpressions.Regex constructor throws exeption with "."

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Mon, 14 Apr 2003 21:06:07 -0400 (EDT)


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 jonpryor@vt.edu.

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

--- shadow/41350	Mon Apr 14 21:06:07 2003
+++ shadow/41350.tmp.4526	Mon Apr 14 21:06:07 2003
@@ -0,0 +1,69 @@
+Bug#: 41350
+Product: Mono/Class Libraries
+Version: unspecified
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jonpryor@vt.edu               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: System.Text.RegularExpressions.Regex constructor throws exeption with "."
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+I can't create a regular expression which matches the "any" string, '.'. 
+Attempting to do so results in a System.InvalidCastException.
+
+Steps to reproduce the problem:
+1. Compile the following code:
+
+    // rma.cs: Regex Match All
+    // Does '.' actually work?
+    using System;
+    using System.Text.RegularExpressions;
+
+    class Test
+    {
+      public static void Main ()
+      {
+        Regex re = new Regex (".");
+        Console.WriteLine ("Matches(\"hello!\")={0}",
+          re.Match ("hello!").Success);
+      }
+    }
+
+2. Run the resulting executable: ./rma.exe
+
+Actual Results:
+
+Unhandled Exception: System.InvalidCastException: Cannot cast from source
+type to destination type
+in <0x00035> 00 System.Text.RegularExpressions.PatternCompiler:BeginLink
+(System.Text.RegularExpressions.LinkRef)
+in <0x00015> 00 System.Text.RegularExpressions.PatternCompiler:EmitAnchor
+(int,System.Text.RegularExpressions.LinkRef)
+in <0x000f1> 00 System.Text.RegularExpressions.Syntax.RegularExpression:Compile
+(System.Text.RegularExpressions.ICompiler,bool)
+in <0x0012c> 00 System.Text.RegularExpressions.Regex:.ctor
+(string,System.Text.RegularExpressions.RegexOptions)
+in <0x00019> 00 System.Text.RegularExpressions.Regex:.ctor (string)
+in <0x00031> 00 .Test:Main ()
+
+Expected Results:
+
+No exception, and ``Matches("hello!")=True'' printed.
+
+How often does this happen? 
+
+Always.
+
+Additional Information: