[Mono-bugs] [Bug 72166][Nor] New - Regex.Replace issue when replacement string contains backslashes
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Thu, 3 Feb 2005 02:39:51 -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=72166
--- shadow/72166 2005-02-03 02:39:51.000000000 -0500
+++ shadow/72166.tmp.12404 2005-02-03 02:39:51.000000000 -0500
@@ -0,0 +1,42 @@
+Bug#: 72166
+Product: Mono: Class Libraries
+Version: 1.1
+OS:
+OS Details:
+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: Regex.Replace issue when replacement string contains backslashes
+
+The behaviour of the Monno Regex.Replace method does not match that of
+MS.NET when the replacement string contains backslashes.
+
+To reproduce this issue, compile and run the following code:
+
+using System;
+using System.Text.RegularExpressions;
+
+public class EntryPoint {
+ public static void Main() {
+ Console.WriteLine(Regex.Replace(@"a", "a", @"\\"));
+ }
+}
+
+Actual Result:
+
+\ (single backslash)
+
+Expected Result:
+
+\\ (double backslash)
+
+This works fine on MS.NET, and fails on both Mono 1.0.5 Windows/Linux and
+Mono SVN head (Windows/Linux) with both ICU enabled and disabled.