2 using System.Text.RegularExpressions;
4 namespace MonoTests.System.Text.RegularExpressions {
8 public RegexOptions options;
11 public string expected;
13 public RegexTrial (string pattern, RegexOptions options, string input, string expected) {
14 this.pattern = pattern;
15 this.options = options;
17 this.expected = expected;
20 public string Expected {
21 get { return expected; }
24 public string Execute () {
27 Regex re = new Regex (pattern, options);
28 Match m = re.Match (input);
33 for (int i = 0; i < m.Groups.Count; ++ i) {
34 Group group = m.Groups[i];
36 result += " Group[" + i + "]=";
37 foreach (Capture cap in group.Captures) {
38 result += "(" + cap.Index + "," + cap.Length + ")";
52 public override string ToString () {
54 "Matching input '" + input +
55 "' against pattern '" + pattern +
56 "' with options '" + options + "'.";
69 public void Add (string str) {
70 for (int i = 0; i < str.Length; ++ i)
74 public void Add (uint n) {
78 public void Add (ulong n, int bits) {
79 ulong mask = 1ul << (bits - 1);
80 for (int i = 0; i < bits; ++ i) {
81 Add ((n & mask) != 0);
86 public void Add (bool bit) {
87 bool top = (sum & 0x80000000) != 0;
89 sum ^= bit ? (uint)1 : (uint)0;
96 private readonly uint key = 0x04c11db7;