https://bugzilla.novell.com/show_bug.cgi?id=467369
Summary: Regex bug with groups
Classification: Mono
Product: Mono: Class Libraries
Version: SVN
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: CORLIB
AssignedTo: [email protected]
ReportedBy: [email protected]
QAContact: [email protected]
Found By: ---
Running the following snippet:
<<<
using System;
using System.Text.RegularExpressions;
class Test {
static void Main ()
{
var regex = new
Regex("(?:(?<w>\\d+)[.](?<adp>\\d+))|(?:(?<w>\\d+)\\s+(?<n>\\d+)/(?<d>\\d+))|(?:(?<n>\\d+)/(?<d>\\d+))|(?<w>\\d+)");
string text = "2";
var m = regex.Matches (text);
foreach (Match match in m) {
Console.WriteLine ("w: {0}, adp: {1}", match.Groups ["w"].Value,
match.Groups ["adp"].Value);
Console.WriteLine ("n: {0}, d: {1}", match.Groups ["n"].Value,
match.Groups ["d"].Value);
}
}
}
<<<
net prints:
w: 2, adp:
n: , d:
Mono prints:
C:\Tmp>test
w: 2, adp:
n: 2, d:
So something is different with the `n' group.
--
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.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs