[Mono-bugs] [Bug 44830][Nor] New - Wrong behaviour of Regex.Split()

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Sun, 15 Jun 2003 07:08:52 -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 primey@gmx.net.

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

--- shadow/44830	Sun Jun 15 07:08:52 2003
+++ shadow/44830.tmp.24761	Sun Jun 15 07:08:52 2003
@@ -0,0 +1,68 @@
+Bug#: 44830
+Product: Mono/Class Libraries
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: primey@gmx.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Wrong behaviour of Regex.Split()
+
+Description of Problem:
+
+public string[] Split(string input, int count);
+
+When the maximum number of array element is specified, mono cuts all
+following elements, although it should add them to the last element as
+the Microsoft specification says:
+
+"If count is specified, the string is split into at most count strings (the 
+last string containing the unsplit remainder of the string)"
+
+
+Steps to reproduce the problem:
+
+using System;
+using System.Text.RegularExpressions;
+
+public class RegexTest
+{
+	public static void Main(string[] args)
+	{
+		Regex r = new Regex(":");
+		if (args.Length > 0)
+		{
+			string[] parts = r.Split(args[0], 2);
+			foreach (string s in parts)
+			{
+				Console.WriteLine("Part: " + s);
+			}
+		}
+	}
+} 
+
+Actual Results:
+
+prime@debian:~/source/RegexTest$ mono regextest.exe a:b:c                
+Part: a
+Part: b
+
+
+Expected Results:
+
+D:\Private\Source\RegexTest>regextest a:b:c
+Part: a
+Part: b:c
+
+How often does this happen? 
+always
+
+Additional Information: