[Mono-bugs] [Bug 350547] New: RegEx malfunction in mono
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Sun Dec 23 09:55:14 EST 2007
https://bugzilla.novell.com/show_bug.cgi?id=350547
Summary: RegEx malfunction in mono
Product: Mono: Class Libraries
Version: 1.2.6
Platform: x86-64
OS/Version: Linux
Status: NEW
Severity: Normal
Priority: P5 - None
Component: Sys.Core
AssignedTo: mono-bugs at ximian.com
ReportedBy: yhdezalvarez at gmail.com
QAContact: mono-bugs at ximian.com
CC: yhdezalvarez at gmail.com
Found By: Other
Description of Problem:
Testcase (regexTest.cs):
using System;
using System.Text.RegularExpressions;
namespace regexTest
{
class Program
{
static void Main(string[] args)
{
Regex R0 = new
Regex(@"\./(?<d>([^/]+/){0}(?<u>([^/]+/){0}[^/]+))/(?<f>.+)");
Regex R1 = new
Regex(@"\./(?<d>([^/]+/){0}(?<u>([^/]+/){1}[^/]+))/(?<f>.+)");
Regex R2 = new
Regex(@"\./(?<d>([^/]+/){1}(?<u>([^/]+/){0}[^/]+))/(?<f>.+)");
Regex R3 = new
Regex(@"\./(?<d>([^/]+/){1}(?<u>([^/]+/){1}[^/]+))/(?<f>.+)");
Regex R4 = new
Regex(@"\./(?<d>([^/]+/){2}(?<u>([^/]+/){2}[^/]+))/(?<f>.+)");
string str = "./dir1/dir2/dir3/dir4/dir5/dir6";
Console.WriteLine("{0}", R0.Match(str).Groups["u"].Value);
Console.WriteLine("{0}", R1.Match(str).Groups["u"].Value);
Console.WriteLine("{0}", R2.Match(str).Groups["u"].Value);
Console.WriteLine("{0}", R3.Match(str).Groups["u"].Value);
Console.WriteLine("{0}", R4.Match(str).Groups["u"].Value);
}
}
}
Steps to reproduce the problem:
mcs regexTest.cs; mono regexTest.exe
Actual Results:
dir5
dir4/dir5
dir2/dir3/dir4/dir5
dir2/dir3
dir3/dir4/dir5
Expected Results:
dir1
dir1/dir2
dir2
dir2/dir3
dir3/dir4/dir5
How often does this happen?
Always
Additional Information:
OS: Gentoo x86_64
Package: dev-lang/mono-1.2.6
net 2.0 (windows), VS2005 compiled binary: results OK
net 2.0 (windows), mcs compiled binary: results OK
mono (linux), VS2005 compiled binary: bogus results;
mono (linux), mcs compiled binary: bogus results;
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list