// (c) 2002
using System.Collections.Generic;
-using System.Threading.Tasks;
+using System.Linq;
using Xunit;
namespace System.Text.RegularExpressions.Tests
// Which in turn ported from perl-5.6.1/t/op/re_tests
[Theory]
- [MemberData(nameof(RegexTestCasesWithOptions))]
- public async Task ValidateRegex(RegexEngine engine, string pattern, RegexOptions options, string input, string expected)
+ [MemberData(nameof(ValidateRegex_MemberData))]
+ public void ValidateRegex(RegexEngine engine, string pattern, RegexOptions options, Regex re, string input, string expected)
{
+ // Provided to the test for diagnostic purposes only
+ _ = engine;
+ _ = pattern;
+ _ = options;
+
+ Match m = re.Match(input);
string result = "Fail.";
- try
+ if (m.Success)
{
- Regex re = await RegexHelpers.GetRegexAsync(engine, pattern, options);
- Match m = re.Match(input);
-
- if (m.Success)
+ result = "Pass.";
+ int[] groupNums = re.GetGroupNumbers();
+ for (int i = 0; i < m.Groups.Count; ++i)
{
- result = "Pass.";
- int[] groupNums = re.GetGroupNumbers();
- for (int i = 0; i < m.Groups.Count; ++i)
+ int gid = groupNums[i];
+ result += $" Group[{gid}]=";
+ foreach (Capture cap in m.Groups[gid].Captures)
{
- int gid = groupNums[i];
- Group group = m.Groups[gid];
-
- result += $" Group[{gid}]=";
- foreach (Capture cap in group.Captures)
- {
- result += $"({cap.Index},{cap.Length})";
- }
+ result += $"({cap.Index},{cap.Length})";
}
}
}
- catch (ArgumentException)
- {
- result = "Error.";
- }
Assert.Equal(expected, result);
}
- public static IEnumerable<object[]> RegexTestCasesWithOptions()
+ public static IEnumerable<object[]> ValidateRegex_MemberData()
{
foreach (RegexEngine engine in RegexHelpers.AvailableEngines)
{
- foreach (object[] obj in RegexTestCases())
- {
- string expected_result = (string)obj[3];
+ (string Pattern, RegexOptions Options, string Input, string Expected)[] allEngineCases = Cases(engine).ToArray();
+ Regex[] results = RegexHelpers.GetRegexesAsync(engine, allEngineCases.Select(c => (c.Pattern, (RegexOptions?)c.Options, (TimeSpan?)null)).ToArray()).Result;
+ for (int i = 0; i < results.Length; i++)
+ {
+ string expected = allEngineCases[i].Expected;
if (RegexHelpers.IsNonBacktracking(engine))
{
- // For the NonBacktracking option, skip the tests that use nonsupported options
- // or if the optional 5th arguments says "NONBACKTRACKINGINCOMPATIBLE" that applies
- // when the following are being used in the pattern:
- // backreferences, (negative/positive) lookahead, (negative/positive) lookbehind, atomic, \G
- if ((((RegexOptions)obj[1] & (RegexOptions.ECMAScript | RegexOptions.RightToLeft)) != 0) ||
- (obj.Length > 4 && obj[4].Equals("NONBACKTRACKINGINCOMPATIBLE")))
- {
- continue;
- }
-
- // Add the NonBacktracking specific tests
- // group i values for i>0 are not generated in NonBacktracking mode and are removed
- // -- thus the string beyond the first ')' when the test succeeds is removed in obj[3]
- int j = expected_result.IndexOf(')');
- if (j > 0)
+ // NonBacktracking doesn't support captures other than top-level. Remove the rest from the expected results.
+ int j = expected.IndexOf(')');
+ if (j >= 0)
{
- expected_result = expected_result.Substring(0, j + 1);
+ expected = expected.Substring(0, j + 1);
}
}
- yield return new object[] { engine, obj[0], obj[1], obj[2], expected_result };
- yield return new object[] { engine, obj[0], RegexOptions.CultureInvariant | (RegexOptions)obj[1], obj[2], expected_result };
+ (string Pattern, RegexOptions Options, string Input, string Expected) testCase = allEngineCases[i];
+ yield return new object[] { engine, testCase.Pattern, testCase.Options, results[i], testCase.Input, expected };
+ yield return new object[] { engine, testCase.Pattern, testCase.Options | RegexOptions.CultureInvariant, results[i], testCase.Input, expected };
+ }
+ }
+
+ static IEnumerable<(string Pattern, RegexOptions Options, string Input, string Result)> Cases(RegexEngine engine)
+ {
+ yield return (@"abc", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)");
+ yield return (@"abc", RegexOptions.None, "xbc", "Fail.");
+ yield return (@"abc", RegexOptions.None, "axc", "Fail.");
+ yield return (@"abc", RegexOptions.None, "abx", "Fail.");
+ yield return (@"abc", RegexOptions.None, "xabcy", "Pass. Group[0]=(1,3)");
+ yield return (@"abc", RegexOptions.None, "ababc", "Pass. Group[0]=(2,3)");
+ yield return (@"ab*c", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)");
+ yield return (@"ab*bc", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)");
+ yield return (@"ab*bc", RegexOptions.None, "abbc", "Pass. Group[0]=(0,4)");
+ yield return (@"ab*bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)");
+ yield return (@".{1}", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,1)");
+ yield return (@".{3,4}", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,4)");
+ yield return (@"ab{0,}bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)");
+ yield return (@"ab+bc", RegexOptions.None, "abbc", "Pass. Group[0]=(0,4)");
+ yield return (@"ab+bc", RegexOptions.None, "abc", "Fail.");
+ yield return (@"ab+bc", RegexOptions.None, "abq", "Fail.");
+ yield return (@"ab{1,}bc", RegexOptions.None, "abq", "Fail.");
+ yield return (@"ab+bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)");
+ yield return (@"ab{1,}bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)");
+ yield return (@"ab{1,3}bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)");
+ yield return (@"ab{3,4}bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)");
+ yield return (@"ab{4,5}bc", RegexOptions.None, "abbbbc", "Fail.");
+ yield return (@"ab?bc", RegexOptions.None, "abbc", "Pass. Group[0]=(0,4)");
+ yield return (@"ab?bc", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)");
+ yield return (@"ab{0,1}bc", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)");
+ yield return (@"ab?bc", RegexOptions.None, "abbbbc", "Fail.");
+ yield return (@"ab?c", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)");
+ yield return (@"ab{0,1}c", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)");
+ yield return (@"^abc$", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)");
+ yield return (@"^abc$", RegexOptions.None, "abcc", "Fail.");
+ yield return (@"^abc", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)");
+ yield return (@"^abc$", RegexOptions.None, "aabc", "Fail.");
+ yield return (@"abc$", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)");
+ yield return (@"abc$", RegexOptions.None, "aabcd", "Fail.");
+ yield return (@"^", RegexOptions.None, "abc", "Pass. Group[0]=(0,0)");
+ yield return (@"$", RegexOptions.None, "abc", "Pass. Group[0]=(3,0)");
+ yield return (@"a.c", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)");
+ yield return (@"a.c", RegexOptions.None, "axc", "Pass. Group[0]=(0,3)");
+ yield return (@"a.*c", RegexOptions.None, "axyzc", "Pass. Group[0]=(0,5)");
+ yield return (@"a.*c", RegexOptions.None, "axyzd", "Fail.");
+ yield return (@"a[bc]d", RegexOptions.None, "abc", "Fail.");
+ yield return (@"a[bc]d", RegexOptions.None, "abd", "Pass. Group[0]=(0,3)");
+ yield return (@"a[b-d]e", RegexOptions.None, "abd", "Fail.");
+ yield return (@"a[b-d]e", RegexOptions.None, "ace", "Pass. Group[0]=(0,3)");
+ yield return (@"a[b-d]", RegexOptions.None, "aac", "Pass. Group[0]=(1,2)");
+ yield return (@"a[-b]", RegexOptions.None, "a-", "Pass. Group[0]=(0,2)");
+ yield return (@"a[b-]", RegexOptions.None, "a-", "Pass. Group[0]=(0,2)");
+ yield return (@"a]", RegexOptions.None, "a]", "Pass. Group[0]=(0,2)");
+ yield return (@"a[]]b", RegexOptions.None, "a]b", "Pass. Group[0]=(0,3)");
+ yield return (@"a[^bc]d", RegexOptions.None, "aed", "Pass. Group[0]=(0,3)");
+ yield return (@"a[^bc]d", RegexOptions.None, "abd", "Fail.");
+ yield return (@"a[^-b]c", RegexOptions.None, "adc", "Pass. Group[0]=(0,3)");
+ yield return (@"a[^-b]c", RegexOptions.None, "a-c", "Fail.");
+ yield return (@"a[^]b]c", RegexOptions.None, "a]c", "Fail.");
+ yield return (@"a[^]b]c", RegexOptions.None, "adc", "Pass. Group[0]=(0,3)");
+ yield return (@"\ba\b", RegexOptions.None, "a-", "Pass. Group[0]=(0,1)");
+ yield return (@"\ba\b", RegexOptions.None, "-a", "Pass. Group[0]=(1,1)");
+ yield return (@"\ba\b", RegexOptions.None, "-a-", "Pass. Group[0]=(1,1)");
+ yield return (@"\by\b", RegexOptions.None, "xy", "Fail.");
+ yield return (@"\by\b", RegexOptions.None, "yz", "Fail.");
+ yield return (@"\by\b", RegexOptions.None, "xyz", "Fail.");
+ yield return (@"\Ba\B", RegexOptions.None, "a-", "Fail.");
+ yield return (@"\Ba\B", RegexOptions.None, "-a", "Fail.");
+ yield return (@"\Ba\B", RegexOptions.None, "-a-", "Fail.");
+ yield return (@"\By\b", RegexOptions.None, "xy", "Pass. Group[0]=(1,1)");
+ yield return (@"\by\B", RegexOptions.None, "yz", "Pass. Group[0]=(0,1)");
+ yield return (@"\By\B", RegexOptions.None, "xyz", "Pass. Group[0]=(1,1)");
+ yield return (@"\w", RegexOptions.None, "a", "Pass. Group[0]=(0,1)");
+ yield return (@"\w", RegexOptions.None, "-", "Fail.");
+ yield return (@"\W", RegexOptions.None, "a", "Fail.");
+ yield return (@"\W", RegexOptions.None, "-", "Pass. Group[0]=(0,1)");
+ yield return (@"a\sb", RegexOptions.None, "a b", "Pass. Group[0]=(0,3)");
+ yield return (@"a\sb", RegexOptions.None, "a-b", "Fail.");
+ yield return (@"a\Sb", RegexOptions.None, "a b", "Fail.");
+ yield return (@"a\Sb", RegexOptions.None, "a-b", "Pass. Group[0]=(0,3)");
+ yield return (@"\d", RegexOptions.None, "1", "Pass. Group[0]=(0,1)");
+ yield return (@"\d", RegexOptions.None, "-", "Fail.");
+ yield return (@"\D", RegexOptions.None, "1", "Fail.");
+ yield return (@"\D", RegexOptions.None, "-", "Pass. Group[0]=(0,1)");
+ yield return (@"[\w]", RegexOptions.None, "a", "Pass. Group[0]=(0,1)");
+ yield return (@"[\w]", RegexOptions.None, "-", "Fail.");
+ yield return (@"[\W]", RegexOptions.None, "a", "Fail.");
+ yield return (@"[\W]", RegexOptions.None, "-", "Pass. Group[0]=(0,1)");
+ yield return (@"a[\s]b", RegexOptions.None, "a b", "Pass. Group[0]=(0,3)");
+ yield return (@"a[\s]b", RegexOptions.None, "a-b", "Fail.");
+ yield return (@"a[\S]b", RegexOptions.None, "a b", "Fail.");
+ yield return (@"a[\S]b", RegexOptions.None, "a-b", "Pass. Group[0]=(0,3)");
+ yield return (@"[\d]", RegexOptions.None, "1", "Pass. Group[0]=(0,1)");
+ yield return (@"[\d]", RegexOptions.None, "-", "Fail.");
+ yield return (@"[\D]", RegexOptions.None, "1", "Fail.");
+ yield return (@"[\D]", RegexOptions.None, "-", "Pass. Group[0]=(0,1)");
+ yield return (@"ab|cd", RegexOptions.None, "abc", "Pass. Group[0]=(0,2)");
+ yield return (@"ab|cd", RegexOptions.None, "abcd", "Pass. Group[0]=(0,2)");
+ yield return (@"()ef", RegexOptions.None, "def", "Pass. Group[0]=(1,2) Group[1]=(1,0)");
+ yield return (@"$b", RegexOptions.None, "b", "Fail.");
+ yield return (@"a\(b", RegexOptions.None, "a(b", "Pass. Group[0]=(0,3)");
+ yield return (@"a\(*b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2)");
+ yield return (@"a\(*b", RegexOptions.None, "a((b", "Pass. Group[0]=(0,4)");
+ yield return (@"a\\b", RegexOptions.None, "a\\b", "Pass. Group[0]=(0,3)");
+ yield return (@"((a))", RegexOptions.None, "abc", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1)");
+ yield return (@"(a)b(c)", RegexOptions.None, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(2,1)");
+ yield return (@"a+b+c", RegexOptions.None, "aabbabc", "Pass. Group[0]=(4,3)");
+ yield return (@"a{1,}b{1,}c", RegexOptions.None, "aabbabc", "Pass. Group[0]=(4,3)");
+ yield return (@"a.+?c", RegexOptions.None, "abcabc", "Pass. Group[0]=(0,3)");
+ yield return (@"(a+|b)*", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)");
+ yield return (@"(a+|b){0,}", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)");
+ yield return (@"(a+|b)+", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)");
+ yield return (@"(a+|b){1,}", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)");
+ yield return (@"(a+|b)?", RegexOptions.None, "ab", "Pass. Group[0]=(0,1) Group[1]=(0,1)");
+ yield return (@"(a+|b){0,1}", RegexOptions.None, "ab", "Pass. Group[0]=(0,1) Group[1]=(0,1)");
+ yield return (@"[^ab]*", RegexOptions.None, "cde", "Pass. Group[0]=(0,3)");
+ yield return (@"abc", RegexOptions.None, "", "Fail.");
+ yield return (@"a*", RegexOptions.None, "", "Pass. Group[0]=(0,0)");
+ yield return (@"([abc])*d", RegexOptions.None, "abbbcd", "Pass. Group[0]=(0,6) Group[1]=(0,1)(1,1)(2,1)(3,1)(4,1)");
+ yield return (@"([abc])*bcd", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(0,1)");
+ yield return (@"a|b|c|d|e", RegexOptions.None, "e", "Pass. Group[0]=(0,1)");
+ yield return (@"(a|b|c|d|e)f", RegexOptions.None, "ef", "Pass. Group[0]=(0,2) Group[1]=(0,1)");
+ yield return (@"abcd*efg", RegexOptions.None, "abcdefg", "Pass. Group[0]=(0,7)");
+ yield return (@"ab*", RegexOptions.None, "xabyabbbz", "Pass. Group[0]=(1,2)");
+ yield return (@"ab*", RegexOptions.None, "xayabbbz", "Pass. Group[0]=(1,1)");
+ yield return (@"(ab|cd)e", RegexOptions.None, "abcde", "Pass. Group[0]=(2,3) Group[1]=(2,2)");
+ yield return (@"[abhgefdc]ij", RegexOptions.None, "hij", "Pass. Group[0]=(0,3)");
+ yield return (@"^(ab|cd)e", RegexOptions.None, "abcde", "Fail.");
+ yield return (@"(abc|)ef", RegexOptions.None, "abcdef", "Pass. Group[0]=(4,2) Group[1]=(4,0)");
+ yield return (@"(a|b)c*d", RegexOptions.None, "abcd", "Pass. Group[0]=(1,3) Group[1]=(1,1)");
+ yield return (@"(ab|ab*)bc", RegexOptions.None, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,1)");
+ yield return (@"a([bc]*)c*", RegexOptions.None, "abc", "Pass. Group[0]=(0,3) Group[1]=(1,2)");
+ yield return (@"a([bc]*)(c*d)", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,2) Group[2]=(3,1)");
+ yield return (@"a([bc]+)(c*d)", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,2) Group[2]=(3,1)");
+ yield return (@"a([bc]*)(c+d)", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,1) Group[2]=(2,2)");
+ yield return (@"a[bcd]*dcdcde", RegexOptions.None, "adcdcde", "Pass. Group[0]=(0,7)");
+ yield return (@"a[bcd]+dcdcde", RegexOptions.None, "adcdcde", "Fail.");
+ yield return (@"(ab|a)b*c", RegexOptions.None, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,2)");
+ yield return (@"((a)(b)c)(d)", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(0,3) Group[2]=(0,1) Group[3]=(1,1) Group[4]=(3,1)");
+ yield return (@"[a-zA-Z_][a-zA-Z0-9_]*", RegexOptions.None, "alpha", "Pass. Group[0]=(0,5)");
+ yield return (@"^a(bc+|b[eh])g|.h$", RegexOptions.None, "abh", "Pass. Group[0]=(1,2) Group[1]=");
+ yield return (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.None, "effgz", "Pass. Group[0]=(0,5) Group[1]=(0,5) Group[2]=");
+ yield return (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.None, "ij", "Pass. Group[0]=(0,2) Group[1]=(0,2) Group[2]=(1,1)");
+ yield return (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.None, "effg", "Fail.");
+ yield return (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.None, "bcdd", "Fail.");
+ yield return (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.None, "reffgz", "Pass. Group[0]=(1,5) Group[1]=(1,5) Group[2]=");
+ yield return (@"((((((((((a))))))))))", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)");
+ yield return (@"((((((((((a))))))))))!", RegexOptions.None, "aa", "Fail.");
+ yield return (@"((((((((((a))))))))))!", RegexOptions.None, "a!", "Pass. Group[0]=(0,2) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)");
+ yield return (@"(((((((((a)))))))))", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1)");
+ yield return (@"multiple words of text", RegexOptions.None, "uh-uh", "Fail.");
+ yield return (@"multiple words", RegexOptions.None, "multiple words, yeah", "Pass. Group[0]=(0,14)");
+ yield return (@"(.*)c(.*)", RegexOptions.None, "abcde", "Pass. Group[0]=(0,5) Group[1]=(0,2) Group[2]=(3,2)");
+ yield return (@"\((.*), (.*)\)", RegexOptions.None, "(a, b)", "Pass. Group[0]=(0,6) Group[1]=(1,1) Group[2]=(4,1)");
+ yield return (@"[k]", RegexOptions.None, "ab", "Fail.");
+ yield return (@"abcd", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4)");
+ yield return (@"a(bc)d", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,2)");
+ yield return (@"a[-]?c", RegexOptions.None, "ac", "Pass. Group[0]=(0,2)");
+ yield return (@"abc", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)");
+ yield return (@"abc", RegexOptions.IgnoreCase, "XBC", "Fail.");
+ yield return (@"abc", RegexOptions.IgnoreCase, "AXC", "Fail.");
+ yield return (@"abc", RegexOptions.IgnoreCase, "ABX", "Fail.");
+ yield return (@"abc", RegexOptions.IgnoreCase, "XABCY", "Pass. Group[0]=(1,3)");
+ yield return (@"abc", RegexOptions.IgnoreCase, "ABABC", "Pass. Group[0]=(2,3)");
+ yield return (@"ab*c", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)");
+ yield return (@"ab*bc", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)");
+ yield return (@"ab*bc", RegexOptions.IgnoreCase, "ABBC", "Pass. Group[0]=(0,4)");
+ yield return (@"ab*?bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)");
+ yield return (@"ab{0,}?bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)");
+ yield return (@"ab+?bc", RegexOptions.IgnoreCase, "ABBC", "Pass. Group[0]=(0,4)");
+ yield return (@"ab+bc", RegexOptions.IgnoreCase, "ABC", "Fail.");
+ yield return (@"ab+bc", RegexOptions.IgnoreCase, "ABQ", "Fail.");
+ yield return (@"ab{1,}bc", RegexOptions.IgnoreCase, "ABQ", "Fail.");
+ yield return (@"ab+bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)");
+ yield return (@"ab{1,}?bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)");
+ yield return (@"ab{1,3}?bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)");
+ yield return (@"ab{3,4}?bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)");
+ yield return (@"ab{4,5}?bc", RegexOptions.IgnoreCase, "ABBBBC", "Fail.");
+ yield return (@"ab??bc", RegexOptions.IgnoreCase, "ABBC", "Pass. Group[0]=(0,4)");
+ yield return (@"ab??bc", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)");
+ yield return (@"ab{0,1}?bc", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)");
+ yield return (@"ab??bc", RegexOptions.IgnoreCase, "ABBBBC", "Fail.");
+ yield return (@"ab??c", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)");
+ yield return (@"ab{0,1}?c", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)");
+ yield return (@"^abc$", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)");
+ yield return (@"^abc$", RegexOptions.IgnoreCase, "ABCC", "Fail.");
+ yield return (@"^abc", RegexOptions.IgnoreCase, "ABCC", "Pass. Group[0]=(0,3)");
+ yield return (@"^abc$", RegexOptions.IgnoreCase, "AABC", "Fail.");
+ yield return (@"abc$", RegexOptions.IgnoreCase, "AABC", "Pass. Group[0]=(1,3)");
+ yield return (@"^", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,0)");
+ yield return (@"$", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(3,0)");
+ yield return (@"a.c", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)");
+ yield return (@"a.c", RegexOptions.IgnoreCase, "AXC", "Pass. Group[0]=(0,3)");
+ yield return (@"a.*?c", RegexOptions.IgnoreCase, "AXYZC", "Pass. Group[0]=(0,5)");
+ yield return (@"a.*c", RegexOptions.IgnoreCase, "AXYZD", "Fail.");
+ yield return (@"a[bc]d", RegexOptions.IgnoreCase, "ABC", "Fail.");
+ yield return (@"a[bc]d", RegexOptions.IgnoreCase, "ABD", "Pass. Group[0]=(0,3)");
+ yield return (@"a[b-d]e", RegexOptions.IgnoreCase, "ABD", "Fail.");
+ yield return (@"a[b-d]e", RegexOptions.IgnoreCase, "ACE", "Pass. Group[0]=(0,3)");
+ yield return (@"a[b-d]", RegexOptions.IgnoreCase, "AAC", "Pass. Group[0]=(1,2)");
+ yield return (@"a[-b]", RegexOptions.IgnoreCase, "A-", "Pass. Group[0]=(0,2)");
+ yield return (@"a[b-]", RegexOptions.IgnoreCase, "A-", "Pass. Group[0]=(0,2)");
+ yield return (@"a]", RegexOptions.IgnoreCase, "A]", "Pass. Group[0]=(0,2)");
+ yield return (@"a[]]b", RegexOptions.IgnoreCase, "A]B", "Pass. Group[0]=(0,3)");
+ yield return (@"a[^bc]d", RegexOptions.IgnoreCase, "AED", "Pass. Group[0]=(0,3)");
+ yield return (@"a[^bc]d", RegexOptions.IgnoreCase, "ABD", "Fail.");
+ yield return (@"a[^-b]c", RegexOptions.IgnoreCase, "ADC", "Pass. Group[0]=(0,3)");
+ yield return (@"a[^-b]c", RegexOptions.IgnoreCase, "A-C", "Fail.");
+ yield return (@"a[^]b]c", RegexOptions.IgnoreCase, "A]C", "Fail.");
+ yield return (@"a[^]b]c", RegexOptions.IgnoreCase, "ADC", "Pass. Group[0]=(0,3)");
+ yield return (@"ab|cd", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,2)");
+ yield return (@"ab|cd", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,2)");
+ yield return (@"()ef", RegexOptions.IgnoreCase, "DEF", "Pass. Group[0]=(1,2) Group[1]=(1,0)");
+ yield return (@"$b", RegexOptions.IgnoreCase, "B", "Fail.");
+ yield return (@"a\(b", RegexOptions.IgnoreCase, "A(B", "Pass. Group[0]=(0,3)");
+ yield return (@"a\(*b", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,2)");
+ yield return (@"a\(*b", RegexOptions.IgnoreCase, "A((B", "Pass. Group[0]=(0,4)");
+ yield return (@"a\\b", RegexOptions.IgnoreCase, "A\\B", "Pass. Group[0]=(0,3)");
+ yield return (@"((a))", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1)");
+ yield return (@"(a)b(c)", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(2,1)");
+ yield return (@"a+b+c", RegexOptions.IgnoreCase, "AABBABC", "Pass. Group[0]=(4,3)");
+ yield return (@"a{1,}b{1,}c", RegexOptions.IgnoreCase, "AABBABC", "Pass. Group[0]=(4,3)");
+ yield return (@"a.+?c", RegexOptions.IgnoreCase, "ABCABC", "Pass. Group[0]=(0,3)");
+ yield return (@"a.*?c", RegexOptions.IgnoreCase, "ABCABC", "Pass. Group[0]=(0,3)");
+ yield return (@"a.{0,5}?c", RegexOptions.IgnoreCase, "ABCABC", "Pass. Group[0]=(0,3)");
+ yield return (@"(a+|b)*", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)");
+ yield return (@"(a+|b){0,}", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)");
+ yield return (@"(a+|b)+", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)");
+ yield return (@"(a+|b){1,}", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)");
+ yield return (@"(a+|b)?", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,1) Group[1]=(0,1)");
+ yield return (@"(a+|b){0,1}", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,1) Group[1]=(0,1)");
+ yield return (@"(a+|b){0,1}?", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,0) Group[1]=");
+ yield return (@"[^ab]*", RegexOptions.IgnoreCase, "CDE", "Pass. Group[0]=(0,3)");
+ yield return (@"abc", RegexOptions.IgnoreCase, "", "Fail.");
+ yield return (@"a*", RegexOptions.IgnoreCase, "", "Pass. Group[0]=(0,0)");
+ yield return (@"([abc])*d", RegexOptions.IgnoreCase, "ABBBCD", "Pass. Group[0]=(0,6) Group[1]=(0,1)(1,1)(2,1)(3,1)(4,1)");
+ yield return (@"([abc])*bcd", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(0,1)");
+ yield return (@"a|b|c|d|e", RegexOptions.IgnoreCase, "E", "Pass. Group[0]=(0,1)");
+ yield return (@"(a|b|c|d|e)f", RegexOptions.IgnoreCase, "EF", "Pass. Group[0]=(0,2) Group[1]=(0,1)");
+ yield return (@"abcd*efg", RegexOptions.IgnoreCase, "ABCDEFG", "Pass. Group[0]=(0,7)");
+ yield return (@"ab*", RegexOptions.IgnoreCase, "XABYABBBZ", "Pass. Group[0]=(1,2)");
+ yield return (@"ab*", RegexOptions.IgnoreCase, "XAYABBBZ", "Pass. Group[0]=(1,1)");
+ yield return (@"(ab|cd)e", RegexOptions.IgnoreCase, "ABCDE", "Pass. Group[0]=(2,3) Group[1]=(2,2)");
+ yield return (@"[abhgefdc]ij", RegexOptions.IgnoreCase, "HIJ", "Pass. Group[0]=(0,3)");
+ yield return (@"^(ab|cd)e", RegexOptions.IgnoreCase, "ABCDE", "Fail.");
+ yield return (@"(abc|)ef", RegexOptions.IgnoreCase, "ABCDEF", "Pass. Group[0]=(4,2) Group[1]=(4,0)");
+ yield return (@"(a|b)c*d", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(1,3) Group[1]=(1,1)");
+ yield return (@"(ab|ab*)bc", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3) Group[1]=(0,1)");
+ yield return (@"a([bc]*)c*", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3) Group[1]=(1,2)");
+ yield return (@"a([bc]*)(c*d)", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(1,2) Group[2]=(3,1)");
+ yield return (@"a([bc]+)(c*d)", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(1,2) Group[2]=(3,1)");
+ yield return (@"a([bc]*)(c+d)", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(1,1) Group[2]=(2,2)");
+ yield return (@"a[bcd]*dcdcde", RegexOptions.IgnoreCase, "ADCDCDE", "Pass. Group[0]=(0,7)");
+ yield return (@"a[bcd]+dcdcde", RegexOptions.IgnoreCase, "ADCDCDE", "Fail.");
+ yield return (@"(ab|a)b*c", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3) Group[1]=(0,2)");
+ yield return (@"((a)(b)c)(d)", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(0,3) Group[2]=(0,1) Group[3]=(1,1) Group[4]=(3,1)");
+ yield return (@"[a-zA-Z_][a-zA-Z0-9_]*", RegexOptions.IgnoreCase, "ALPHA", "Pass. Group[0]=(0,5)");
+ yield return (@"^a(bc+|b[eh])g|.h$", RegexOptions.IgnoreCase, "ABH", "Pass. Group[0]=(1,2) Group[1]=");
+ yield return (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.IgnoreCase, "EFFGZ", "Pass. Group[0]=(0,5) Group[1]=(0,5) Group[2]=");
+ yield return (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.IgnoreCase, "IJ", "Pass. Group[0]=(0,2) Group[1]=(0,2) Group[2]=(1,1)");
+ yield return (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.IgnoreCase, "EFFG", "Fail.");
+ yield return (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.IgnoreCase, "BCDD", "Fail.");
+ yield return (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.IgnoreCase, "REFFGZ", "Pass. Group[0]=(1,5) Group[1]=(1,5) Group[2]=");
+ yield return (@"((((((((((a))))))))))", RegexOptions.IgnoreCase, "A", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)");
+ yield return (@"((((((((((a))))))))))!", RegexOptions.IgnoreCase, "AA", "Fail.");
+ yield return (@"((((((((((a))))))))))!", RegexOptions.IgnoreCase, "A!", "Pass. Group[0]=(0,2) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)");
+ yield return (@"(((((((((a)))))))))", RegexOptions.IgnoreCase, "A", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1)");
+ yield return (@"(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))", RegexOptions.IgnoreCase, "A", "Pass. Group[0]=(0,1) Group[1]=(0,1)");
+ yield return (@"(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))", RegexOptions.IgnoreCase, "C", "Pass. Group[0]=(0,1) Group[1]=(0,1)");
+ yield return (@"multiple words of text", RegexOptions.IgnoreCase, "UH-UH", "Fail.");
+ yield return (@"multiple words", RegexOptions.IgnoreCase, "MULTIPLE WORDS, YEAH", "Pass. Group[0]=(0,14)");
+ yield return (@"(.*)c(.*)", RegexOptions.IgnoreCase, "ABCDE", "Pass. Group[0]=(0,5) Group[1]=(0,2) Group[2]=(3,2)");
+ yield return (@"\((.*), (.*)\)", RegexOptions.IgnoreCase, "(A, B)", "Pass. Group[0]=(0,6) Group[1]=(1,1) Group[2]=(4,1)");
+ yield return (@"[k]", RegexOptions.IgnoreCase, "AB", "Fail.");
+ yield return (@"abcd", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4)");
+ yield return (@"a(bc)d", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(1,2)");
+ yield return (@"a[-]?c", RegexOptions.IgnoreCase, "AC", "Pass. Group[0]=(0,2)");
+ yield return (@"a(?:b|c|d)(.)", RegexOptions.None, "ace", "Pass. Group[0]=(0,3) Group[1]=(2,1)");
+ yield return (@"a(?:b|c|d)*(.)", RegexOptions.None, "ace", "Pass. Group[0]=(0,3) Group[1]=(2,1)");
+ yield return (@"a(?:b|c|d)+?(.)", RegexOptions.None, "ace", "Pass. Group[0]=(0,3) Group[1]=(2,1)");
+ yield return (@"a(?:b|c|d)+?(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,3) Group[1]=(2,1)");
+ yield return (@"a(?:b|c|d)+(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,8) Group[1]=(7,1)");
+ yield return (@"a(?:b|c|d){2}(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,4) Group[1]=(3,1)");
+ yield return (@"a(?:b|c|d){4,5}(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,7) Group[1]=(6,1)");
+ yield return (@"a(?:b|c|d){4,5}?(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,6) Group[1]=(5,1)");
+ yield return (@"((foo)|(bar))*", RegexOptions.None, "foobar", "Pass. Group[0]=(0,6) Group[1]=(0,3)(3,3) Group[2]=(0,3) Group[3]=(3,3)");
+ yield return (@"a(?:b|c|d){6,7}(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,8) Group[1]=(7,1)");
+ yield return (@"a(?:b|c|d){6,7}?(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,8) Group[1]=(7,1)");
+ yield return (@"a(?:b|c|d){5,6}(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,8) Group[1]=(7,1)");
+ yield return (@"a(?:b|c|d){5,6}?(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,7) Group[1]=(6,1)");
+ yield return (@"a(?:b|c|d){5,7}(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,8) Group[1]=(7,1)");
+ yield return (@"a(?:b|c|d){5,7}?(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,7) Group[1]=(6,1)");
+ yield return (@"a(?:b|(c|e){1,2}?|d)+?(.)", RegexOptions.None, "ace", "Pass. Group[0]=(0,3) Group[1]=(1,1) Group[2]=(2,1)");
+ yield return (@"^(.+)?B", RegexOptions.None, "AB", "Pass. Group[0]=(0,2) Group[1]=(0,1)");
+ yield return (@"^([^a-z])|(\^)$", RegexOptions.None, ".", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=");
+ yield return (@"^[<>]&", RegexOptions.None, "<&OUT", "Pass. Group[0]=(0,2)");
+ yield return (@"((a{4})+)", RegexOptions.None, "aaaaaaaaa", "Pass. Group[0]=(0,8) Group[1]=(0,8) Group[2]=(0,4)(4,4)");
+ yield return (@"(((aa){2})+)", RegexOptions.None, "aaaaaaaaaa", "Pass. Group[0]=(0,8) Group[1]=(0,8) Group[2]=(0,4)(4,4) Group[3]=(0,2)(2,2)(4,2)(6,2)");
+ yield return (@"(((a{2}){2})+)", RegexOptions.None, "aaaaaaaaaa", "Pass. Group[0]=(0,8) Group[1]=(0,8) Group[2]=(0,4)(4,4) Group[3]=(0,2)(2,2)(4,2)(6,2)");
+ yield return (@"(?:(f)(o)(o)|(b)(a)(r))*", RegexOptions.None, "foobar", "Pass. Group[0]=(0,6) Group[1]=(0,1) Group[2]=(1,1) Group[3]=(2,1) Group[4]=(3,1) Group[5]=(4,1) Group[6]=(5,1)");
+ yield return (@"(?:..)*a", RegexOptions.None, "aba", "Pass. Group[0]=(0,3)");
+ yield return (@"(?:..)*?a", RegexOptions.None, "aba", "Pass. Group[0]=(0,1)");
+ yield return (@"^(){3,5}", RegexOptions.None, "abc", "Pass. Group[0]=(0,0) Group[1]=(0,0)(0,0)(0,0)");
+ yield return (@"^(a+)*ax", RegexOptions.None, "aax", "Pass. Group[0]=(0,3) Group[1]=(0,1)");
+ yield return (@"^((a|b)+)*ax", RegexOptions.None, "aax", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(0,1)");
+ yield return (@"^((a|bc)+)*ax", RegexOptions.None, "aax", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(0,1)");
+ yield return (@"(a|x)*ab", RegexOptions.None, "cab", "Pass. Group[0]=(1,2) Group[1]=");
+ yield return (@"(a)*ab", RegexOptions.None, "cab", "Pass. Group[0]=(1,2) Group[1]=");
+ yield return (@"(?:(?i)a)b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2)");
+ yield return (@"((?i)a)b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)");
+ yield return (@"(?:(?i)a)b", RegexOptions.None, "Ab", "Pass. Group[0]=(0,2)");
+ yield return (@"((?i)a)b", RegexOptions.None, "Ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)");
+ yield return (@"(?:(?i)a)b", RegexOptions.None, "aB", "Fail.");
+ yield return (@"((?i)a)b", RegexOptions.None, "aB", "Fail.");
+ yield return (@"(?i:a)b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2)");
+ yield return (@"((?i:a))b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)");
+ yield return (@"(?i:a)b", RegexOptions.None, "Ab", "Pass. Group[0]=(0,2)");
+ yield return (@"((?i:a))b", RegexOptions.None, "Ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)");
+ yield return (@"(?i:a)b", RegexOptions.None, "aB", "Fail.");
+ yield return (@"((?i:a))b", RegexOptions.None, "aB", "Fail.");
+ yield return (@"(?:(?-i)a)b", RegexOptions.IgnoreCase, "ab", "Pass. Group[0]=(0,2)");
+ yield return (@"((?-i)a)b", RegexOptions.IgnoreCase, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)");
+ yield return (@"((?-i)a)b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2) Group[1]=(0,1)");
+ yield return (@"(?:(?-i)a)b", RegexOptions.IgnoreCase, "Ab", "Fail.");
+ yield return (@"((?-i)a)b", RegexOptions.IgnoreCase, "Ab", "Fail.");
+ yield return (@"(?:(?-i)a)b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2)");
+ yield return (@"(?:(?-i)a)b", RegexOptions.IgnoreCase, "AB", "Fail.");
+ yield return (@"((?-i)a)b", RegexOptions.IgnoreCase, "AB", "Fail.");
+ yield return (@"(?-i:a)b", RegexOptions.IgnoreCase, "ab", "Pass. Group[0]=(0,2)");
+ yield return (@"((?-i:a))b", RegexOptions.IgnoreCase, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)");
+ yield return (@"(?-i:a)b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2)");
+ yield return (@"((?-i:a))b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2) Group[1]=(0,1)");
+ yield return (@"(?-i:a)b", RegexOptions.IgnoreCase, "Ab", "Fail.");
+ yield return (@"((?-i:a))b", RegexOptions.IgnoreCase, "Ab", "Fail.");
+ yield return (@"(?-i:a)b", RegexOptions.IgnoreCase, "AB", "Fail.");
+ yield return (@"((?-i:a))b", RegexOptions.IgnoreCase, "AB", "Fail.");
+ yield return (@"((?-i:a.))b", RegexOptions.IgnoreCase, "a\nB", "Fail.");
+ yield return (@"((?s-i:a.))b", RegexOptions.IgnoreCase, "a\nB", "Pass. Group[0]=(0,3) Group[1]=(0,2)");
+ yield return (@"((?s-i:a.))b", RegexOptions.IgnoreCase, "B\nB", "Fail.");
+ yield return (@"(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))", RegexOptions.None, "cabbbb", "Pass. Group[0]=(0,6)");
+ yield return (@"(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))", RegexOptions.None, "caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "Pass. Group[0]=(0,41)");
+ yield return (@"foo\w*\d{4}baz", RegexOptions.None, "foobar1234baz", "Pass. Group[0]=(0,13)");
+ yield return (@"x(~~)*(?:(?:F)?)?", RegexOptions.None, "x~~", "Pass. Group[0]=(0,3) Group[1]=(1,2)");
+ yield return (@"^a(?#xxx){3}c", RegexOptions.None, "aaac", "Pass. Group[0]=(0,4)");
+ yield return (@"^(?:a?b?)*$", RegexOptions.None, "a--", "Fail.");
+ yield return (@"((?s)^a(.))((?m)^b$)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(0,3) Group[1]=(0,2) Group[2]=(1,1) Group[3]=(2,1)");
+ yield return (@"((?m)^b$)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(2,1) Group[1]=(2,1)");
+ yield return (@"(?m)^b", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(2,1)");
+ yield return (@"(?m)^(b)", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(2,1) Group[1]=(2,1)");
+ yield return (@"((?m)^b)", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(2,1) Group[1]=(2,1)");
+ yield return (@"\n((?m)^b)", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(1,2) Group[1]=(2,1)");
+ yield return (@"^b", RegexOptions.None, "a\nb\nc\n", "Fail.");
+ yield return (@"()^b", RegexOptions.None, "a\nb\nc\n", "Fail.");
+ yield return (@"((?m)^b)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(2,1) Group[1]=(2,1)");
+ yield return (@"([\w:]+::)?(\w+)$", RegexOptions.None, "abcd:", "Fail.");
+ yield return (@"([\w:]+::)?(\w+)$", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]= Group[2]=(0,4)");
+ yield return (@"([\w:]+::)?(\w+)$", RegexOptions.None, "xy:z:::abcd", "Pass. Group[0]=(0,11) Group[1]=(0,7) Group[2]=(7,4)");
+ yield return (@"^[^bcd]*(c+)", RegexOptions.None, "aexycd", "Pass. Group[0]=(0,5) Group[1]=(4,1)");
+ yield return (@"(a*)b+", RegexOptions.None, "caab", "Pass. Group[0]=(1,3) Group[1]=(1,2)");
+ yield return (@"(>a+)ab", RegexOptions.None, "aaab", "Fail.");
+ yield return (@"(\w+:)+", RegexOptions.None, "one:", "Pass. Group[0]=(0,4) Group[1]=(0,4)");
+ yield return (@"([[:]+)", RegexOptions.None, "a:[b]:", "Pass. Group[0]=(1,2) Group[1]=(1,2)");
+ yield return (@"([[=]+)", RegexOptions.None, "a=[b]=", "Pass. Group[0]=(1,2) Group[1]=(1,2)");
+ yield return (@"([[.]+)", RegexOptions.None, "a.[b].", "Pass. Group[0]=(1,2) Group[1]=(1,2)");
+ yield return (@"[a[:]b[:c]", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)");
+ yield return (@"\Z", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(3,0)");
+ yield return (@"\z", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(4,0)");
+ yield return (@"$", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(3,0)");
+ yield return (@"\Z", RegexOptions.None, "b\na\n", "Pass. Group[0]=(3,0)");
+ yield return (@"\z", RegexOptions.None, "b\na\n", "Pass. Group[0]=(4,0)");
+ yield return (@"$", RegexOptions.None, "b\na\n", "Pass. Group[0]=(3,0)");
+ yield return (@"\Z", RegexOptions.None, "b\na", "Pass. Group[0]=(3,0)");
+ yield return (@"\z", RegexOptions.None, "b\na", "Pass. Group[0]=(3,0)");
+ yield return (@"$", RegexOptions.None, "b\na", "Pass. Group[0]=(3,0)");
+ yield return (@"\Z", RegexOptions.Multiline, "a\nb\n", "Pass. Group[0]=(3,0)");
+ yield return (@"\z", RegexOptions.Multiline, "a\nb\n", "Pass. Group[0]=(4,0)");
+ yield return (@"$", RegexOptions.Multiline, "a\nb\n", "Pass. Group[0]=(1,0)");
+ yield return (@"\Z", RegexOptions.Multiline, "b\na\n", "Pass. Group[0]=(3,0)");
+ yield return (@"\z", RegexOptions.Multiline, "b\na\n", "Pass. Group[0]=(4,0)");
+ yield return (@"$", RegexOptions.Multiline, "b\na\n", "Pass. Group[0]=(1,0)");
+ yield return (@"\Z", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(3,0)");
+ yield return (@"\z", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(3,0)");
+ yield return (@"$", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(1,0)");
+ yield return (@"a\Z", RegexOptions.None, "a\nb\n", "Fail.");
+ yield return (@"a\z", RegexOptions.None, "a\nb\n", "Fail.");
+ yield return (@"a$", RegexOptions.None, "a\nb\n", "Fail.");
+ yield return (@"a\Z", RegexOptions.None, "b\na\n", "Pass. Group[0]=(2,1)");
+ yield return (@"a\z", RegexOptions.None, "b\na\n", "Fail.");
+ yield return (@"a$", RegexOptions.None, "b\na\n", "Pass. Group[0]=(2,1)");
+ yield return (@"a\Z", RegexOptions.None, "b\na", "Pass. Group[0]=(2,1)");
+ yield return (@"a\z", RegexOptions.None, "b\na", "Pass. Group[0]=(2,1)");
+ yield return (@"a$", RegexOptions.None, "b\na", "Pass. Group[0]=(2,1)");
+ yield return (@"a\z", RegexOptions.Multiline, "a\nb\n", "Fail.");
+ yield return (@"a$", RegexOptions.Multiline, "a\nb\n", "Pass. Group[0]=(0,1)");
+ yield return (@"a\Z", RegexOptions.Multiline, "b\na\n", "Pass. Group[0]=(2,1)");
+ yield return (@"a\z", RegexOptions.Multiline, "b\na\n", "Fail.");
+ yield return (@"a$", RegexOptions.Multiline, "b\na\n", "Pass. Group[0]=(2,1)");
+ yield return (@"a\Z", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(2,1)");
+ yield return (@"a\z", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(2,1)");
+ yield return (@"a$", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(2,1)");
+ yield return (@"aa\Z", RegexOptions.None, "aa\nb\n", "Fail.");
+ yield return (@"aa\z", RegexOptions.None, "aa\nb\n", "Fail.");
+ yield return (@"aa$", RegexOptions.None, "aa\nb\n", "Fail.");
+ yield return (@"aa\Z", RegexOptions.None, "b\naa\n", "Pass. Group[0]=(2,2)");
+ yield return (@"aa\z", RegexOptions.None, "b\naa\n", "Fail.");
+ yield return (@"aa$", RegexOptions.None, "b\naa\n", "Pass. Group[0]=(2,2)");
+ yield return (@"aa\Z", RegexOptions.None, "b\naa", "Pass. Group[0]=(2,2)");
+ yield return (@"aa\z", RegexOptions.None, "b\naa", "Pass. Group[0]=(2,2)");
+ yield return (@"aa$", RegexOptions.None, "b\naa", "Pass. Group[0]=(2,2)");
+ yield return (@"aa\z", RegexOptions.Multiline, "aa\nb\n", "Fail.");
+ yield return (@"aa$", RegexOptions.Multiline, "aa\nb\n", "Pass. Group[0]=(0,2)");
+ yield return (@"aa\Z", RegexOptions.Multiline, "b\naa\n", "Pass. Group[0]=(2,2)");
+ yield return (@"aa\z", RegexOptions.Multiline, "b\naa\n", "Fail.");
+ yield return (@"aa$", RegexOptions.Multiline, "b\naa\n", "Pass. Group[0]=(2,2)");
+ yield return (@"aa\Z", RegexOptions.Multiline, "b\naa", "Pass. Group[0]=(2,2)");
+ yield return (@"aa\z", RegexOptions.Multiline, "b\naa", "Pass. Group[0]=(2,2)");
+ yield return (@"aa$", RegexOptions.Multiline, "b\naa", "Pass. Group[0]=(2,2)");
+ yield return (@"aa\Z", RegexOptions.None, "ac\nb\n", "Fail.");
+ yield return (@"aa\z", RegexOptions.None, "ac\nb\n", "Fail.");
+ yield return (@"aa$", RegexOptions.None, "ac\nb\n", "Fail.");
+ yield return (@"aa\Z", RegexOptions.None, "b\nac\n", "Fail.");
+ yield return (@"aa\z", RegexOptions.None, "b\nac\n", "Fail.");
+ yield return (@"aa$", RegexOptions.None, "b\nac\n", "Fail.");
+ yield return (@"aa\Z", RegexOptions.None, "b\nac", "Fail.");
+ yield return (@"aa\z", RegexOptions.None, "b\nac", "Fail.");
+ yield return (@"aa$", RegexOptions.None, "b\nac", "Fail.");
+ yield return (@"aa\Z", RegexOptions.Multiline, "ac\nb\n", "Fail.");
+ yield return (@"aa\z", RegexOptions.Multiline, "ac\nb\n", "Fail.");
+ yield return (@"aa$", RegexOptions.Multiline, "ac\nb\n", "Fail.");
+ yield return (@"aa\Z", RegexOptions.Multiline, "b\nac\n", "Fail.");
+ yield return (@"aa\z", RegexOptions.Multiline, "b\nac\n", "Fail.");
+ yield return (@"aa$", RegexOptions.Multiline, "b\nac\n", "Fail.");
+ yield return (@"aa\Z", RegexOptions.Multiline, "b\nac", "Fail.");
+ yield return (@"aa\z", RegexOptions.Multiline, "b\nac", "Fail.");
+ yield return (@"aa$", RegexOptions.Multiline, "b\nac", "Fail.");
+ yield return (@"aa\Z", RegexOptions.None, "ca\nb\n", "Fail.");
+ yield return (@"aa\z", RegexOptions.None, "ca\nb\n", "Fail.");
+ yield return (@"aa$", RegexOptions.None, "ca\nb\n", "Fail.");
+ yield return (@"aa\Z", RegexOptions.None, "b\nca\n", "Fail.");
+ yield return (@"aa\z", RegexOptions.None, "b\nca\n", "Fail.");
+ yield return (@"aa$", RegexOptions.None, "b\nca\n", "Fail.");
+ yield return (@"aa\Z", RegexOptions.None, "b\nca", "Fail.");
+ yield return (@"aa\z", RegexOptions.None, "b\nca", "Fail.");
+ yield return (@"aa$", RegexOptions.None, "b\nca", "Fail.");
+ yield return (@"aa\Z", RegexOptions.Multiline, "ca\nb\n", "Fail.");
+ yield return (@"aa\z", RegexOptions.Multiline, "ca\nb\n", "Fail.");
+ yield return (@"aa$", RegexOptions.Multiline, "ca\nb\n", "Fail.");
+ yield return (@"aa\Z", RegexOptions.Multiline, "b\nca\n", "Fail.");
+ yield return (@"aa\z", RegexOptions.Multiline, "b\nca\n", "Fail.");
+ yield return (@"aa$", RegexOptions.Multiline, "b\nca\n", "Fail.");
+ yield return (@"aa\Z", RegexOptions.Multiline, "b\nca", "Fail.");
+ yield return (@"aa\z", RegexOptions.Multiline, "b\nca", "Fail.");
+ yield return (@"aa$", RegexOptions.Multiline, "b\nca", "Fail.");
+ yield return (@"ab\Z", RegexOptions.None, "ab\nb\n", "Fail.");
+ yield return (@"ab\z", RegexOptions.None, "ab\nb\n", "Fail.");
+ yield return (@"ab$", RegexOptions.None, "ab\nb\n", "Fail.");
+ yield return (@"ab\Z", RegexOptions.None, "b\nab\n", "Pass. Group[0]=(2,2)");
+ yield return (@"ab\z", RegexOptions.None, "b\nab\n", "Fail.");
+ yield return (@"ab$", RegexOptions.None, "b\nab\n", "Pass. Group[0]=(2,2)");
+ yield return (@"ab\Z", RegexOptions.None, "b\nab", "Pass. Group[0]=(2,2)");
+ yield return (@"ab\z", RegexOptions.None, "b\nab", "Pass. Group[0]=(2,2)");
+ yield return (@"ab$", RegexOptions.None, "b\nab", "Pass. Group[0]=(2,2)");
+ yield return (@"ab\z", RegexOptions.Multiline, "ab\nb\n", "Fail.");
+ yield return (@"ab$", RegexOptions.Multiline, "ab\nb\n", "Pass. Group[0]=(0,2)");
+ yield return (@"ab\Z", RegexOptions.Multiline, "b\nab\n", "Pass. Group[0]=(2,2)");
+ yield return (@"ab\z", RegexOptions.Multiline, "b\nab\n", "Fail.");
+ yield return (@"ab$", RegexOptions.Multiline, "b\nab\n", "Pass. Group[0]=(2,2)");
+ yield return (@"ab\Z", RegexOptions.Multiline, "b\nab", "Pass. Group[0]=(2,2)");
+ yield return (@"ab\z", RegexOptions.Multiline, "b\nab", "Pass. Group[0]=(2,2)");
+ yield return (@"ab$", RegexOptions.Multiline, "b\nab", "Pass. Group[0]=(2,2)");
+ yield return (@"ab\Z", RegexOptions.None, "ac\nb\n", "Fail.");
+ yield return (@"ab\z", RegexOptions.None, "ac\nb\n", "Fail.");
+ yield return (@"ab$", RegexOptions.None, "ac\nb\n", "Fail.");
+ yield return (@"ab\Z", RegexOptions.None, "b\nac\n", "Fail.");
+ yield return (@"ab\z", RegexOptions.None, "b\nac\n", "Fail.");
+ yield return (@"ab$", RegexOptions.None, "b\nac\n", "Fail.");
+ yield return (@"ab\Z", RegexOptions.None, "b\nac", "Fail.");
+ yield return (@"ab\z", RegexOptions.None, "b\nac", "Fail.");
+ yield return (@"ab$", RegexOptions.None, "b\nac", "Fail.");
+ yield return (@"ab\Z", RegexOptions.Multiline, "ac\nb\n", "Fail.");
+ yield return (@"ab\z", RegexOptions.Multiline, "ac\nb\n", "Fail.");
+ yield return (@"ab$", RegexOptions.Multiline, "ac\nb\n", "Fail.");
+ yield return (@"ab\Z", RegexOptions.Multiline, "b\nac\n", "Fail.");
+ yield return (@"ab\z", RegexOptions.Multiline, "b\nac\n", "Fail.");
+ yield return (@"ab$", RegexOptions.Multiline, "b\nac\n", "Fail.");
+ yield return (@"ab\Z", RegexOptions.Multiline, "b\nac", "Fail.");
+ yield return (@"ab\z", RegexOptions.Multiline, "b\nac", "Fail.");
+ yield return (@"ab$", RegexOptions.Multiline, "b\nac", "Fail.");
+ yield return (@"ab\Z", RegexOptions.None, "ca\nb\n", "Fail.");
+ yield return (@"ab\z", RegexOptions.None, "ca\nb\n", "Fail.");
+ yield return (@"ab$", RegexOptions.None, "ca\nb\n", "Fail.");
+ yield return (@"ab\Z", RegexOptions.None, "b\nca\n", "Fail.");
+ yield return (@"ab\z", RegexOptions.None, "b\nca\n", "Fail.");
+ yield return (@"ab$", RegexOptions.None, "b\nca\n", "Fail.");
+ yield return (@"ab\Z", RegexOptions.None, "b\nca", "Fail.");
+ yield return (@"ab\z", RegexOptions.None, "b\nca", "Fail.");
+ yield return (@"ab$", RegexOptions.None, "b\nca", "Fail.");
+ yield return (@"ab\Z", RegexOptions.Multiline, "ca\nb\n", "Fail.");
+ yield return (@"ab\z", RegexOptions.Multiline, "ca\nb\n", "Fail.");
+ yield return (@"ab$", RegexOptions.Multiline, "ca\nb\n", "Fail.");
+ yield return (@"ab\Z", RegexOptions.Multiline, "b\nca\n", "Fail.");
+ yield return (@"ab\z", RegexOptions.Multiline, "b\nca\n", "Fail.");
+ yield return (@"ab$", RegexOptions.Multiline, "b\nca\n", "Fail.");
+ yield return (@"ab\Z", RegexOptions.Multiline, "b\nca", "Fail.");
+ yield return (@"ab\z", RegexOptions.Multiline, "b\nca", "Fail.");
+ yield return (@"ab$", RegexOptions.Multiline, "b\nca", "Fail.");
+ yield return (@"abb\Z", RegexOptions.None, "abb\nb\n", "Fail.");
+ yield return (@"abb\z", RegexOptions.None, "abb\nb\n", "Fail.");
+ yield return (@"abb$", RegexOptions.None, "abb\nb\n", "Fail.");
+ yield return (@"abb\Z", RegexOptions.None, "b\nabb\n", "Pass. Group[0]=(2,3)");
+ yield return (@"abb\z", RegexOptions.None, "b\nabb\n", "Fail.");
+ yield return (@"abb$", RegexOptions.None, "b\nabb\n", "Pass. Group[0]=(2,3)");
+ yield return (@"abb\Z", RegexOptions.None, "b\nabb", "Pass. Group[0]=(2,3)");
+ yield return (@"abb\z", RegexOptions.None, "b\nabb", "Pass. Group[0]=(2,3)");
+ yield return (@"abb$", RegexOptions.None, "b\nabb", "Pass. Group[0]=(2,3)");
+ yield return (@"abb\z", RegexOptions.Multiline, "abb\nb\n", "Fail.");
+ yield return (@"abb$", RegexOptions.Multiline, "abb\nb\n", "Pass. Group[0]=(0,3)");
+ yield return (@"abb\Z", RegexOptions.Multiline, "b\nabb\n", "Pass. Group[0]=(2,3)");
+ yield return (@"abb\z", RegexOptions.Multiline, "b\nabb\n", "Fail.");
+ yield return (@"abb$", RegexOptions.Multiline, "b\nabb\n", "Pass. Group[0]=(2,3)");
+ yield return (@"abb\Z", RegexOptions.Multiline, "b\nabb", "Pass. Group[0]=(2,3)");
+ yield return (@"abb\z", RegexOptions.Multiline, "b\nabb", "Pass. Group[0]=(2,3)");
+ yield return (@"abb$", RegexOptions.Multiline, "b\nabb", "Pass. Group[0]=(2,3)");
+ yield return (@"abb\Z", RegexOptions.None, "ac\nb\n", "Fail.");
+ yield return (@"abb\z", RegexOptions.None, "ac\nb\n", "Fail.");
+ yield return (@"abb$", RegexOptions.None, "ac\nb\n", "Fail.");
+ yield return (@"abb\Z", RegexOptions.None, "b\nac\n", "Fail.");
+ yield return (@"abb\z", RegexOptions.None, "b\nac\n", "Fail.");
+ yield return (@"abb$", RegexOptions.None, "b\nac\n", "Fail.");
+ yield return (@"abb\Z", RegexOptions.None, "b\nac", "Fail.");
+ yield return (@"abb\z", RegexOptions.None, "b\nac", "Fail.");
+ yield return (@"abb$", RegexOptions.None, "b\nac", "Fail.");
+ yield return (@"abb\Z", RegexOptions.Multiline, "ac\nb\n", "Fail.");
+ yield return (@"abb\z", RegexOptions.Multiline, "ac\nb\n", "Fail.");
+ yield return (@"abb$", RegexOptions.Multiline, "ac\nb\n", "Fail.");
+ yield return (@"abb\Z", RegexOptions.Multiline, "b\nac\n", "Fail.");
+ yield return (@"abb\z", RegexOptions.Multiline, "b\nac\n", "Fail.");
+ yield return (@"abb$", RegexOptions.Multiline, "b\nac\n", "Fail.");
+ yield return (@"abb\Z", RegexOptions.Multiline, "b\nac", "Fail.");
+ yield return (@"abb\z", RegexOptions.Multiline, "b\nac", "Fail.");
+ yield return (@"abb$", RegexOptions.Multiline, "b\nac", "Fail.");
+ yield return (@"abb\Z", RegexOptions.None, "ca\nb\n", "Fail.");
+ yield return (@"abb\z", RegexOptions.None, "ca\nb\n", "Fail.");
+ yield return (@"abb$", RegexOptions.None, "ca\nb\n", "Fail.");
+ yield return (@"abb\Z", RegexOptions.None, "b\nca\n", "Fail.");
+ yield return (@"abb\z", RegexOptions.None, "b\nca\n", "Fail.");
+ yield return (@"abb$", RegexOptions.None, "b\nca\n", "Fail.");
+ yield return (@"abb\Z", RegexOptions.None, "b\nca", "Fail.");
+ yield return (@"abb\z", RegexOptions.None, "b\nca", "Fail.");
+ yield return (@"abb$", RegexOptions.None, "b\nca", "Fail.");
+ yield return (@"abb\Z", RegexOptions.Multiline, "ca\nb\n", "Fail.");
+ yield return (@"abb\z", RegexOptions.Multiline, "ca\nb\n", "Fail.");
+ yield return (@"abb$", RegexOptions.Multiline, "ca\nb\n", "Fail.");
+ yield return (@"abb\Z", RegexOptions.Multiline, "b\nca\n", "Fail.");
+ yield return (@"abb\z", RegexOptions.Multiline, "b\nca\n", "Fail.");
+ yield return (@"abb$", RegexOptions.Multiline, "b\nca\n", "Fail.");
+ yield return (@"abb\Z", RegexOptions.Multiline, "b\nca", "Fail.");
+ yield return (@"abb\z", RegexOptions.Multiline, "b\nca", "Fail.");
+ yield return (@"abb$", RegexOptions.Multiline, "b\nca", "Fail.");
+ yield return (@"(^|x)(c)", RegexOptions.None, "ca", "Pass. Group[0]=(0,1) Group[1]=(0,0) Group[2]=(0,1)");
+ yield return (@"a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz", RegexOptions.None, "x", "Fail.");
+ yield return (@"foo.bart", RegexOptions.None, "foo.bart", "Pass. Group[0]=(0,8)");
+ yield return (@"^d[x][x][x]", RegexOptions.Multiline, "abcd\ndxxx", "Pass. Group[0]=(5,4)");
+ yield return (@".X(.+)+X", RegexOptions.None, "bbbbXcXaaaaaaaa", "Pass. Group[0]=(3,4) Group[1]=(5,1)");
+ yield return (@".X(.+)+XX", RegexOptions.None, "bbbbXcXXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(5,1)");
+ yield return (@".XX(.+)+X", RegexOptions.None, "bbbbXXcXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(6,1)");
+ yield return (@".X(.+)+X", RegexOptions.None, "bbbbXXaaaaaaaaa", "Fail.");
+ yield return (@".X(.+)+XX", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail.");
+ yield return (@".XX(.+)+X", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail.");
+ yield return (@".X(.+)+[X]", RegexOptions.None, "bbbbXcXaaaaaaaa", "Pass. Group[0]=(3,4) Group[1]=(5,1)");
+ yield return (@".X(.+)+[X][X]", RegexOptions.None, "bbbbXcXXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(5,1)");
+ yield return (@".XX(.+)+[X]", RegexOptions.None, "bbbbXXcXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(6,1)");
+ yield return (@".X(.+)+[X]", RegexOptions.None, "bbbbXXaaaaaaaaa", "Fail.");
+ yield return (@".X(.+)+[X][X]", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail.");
+ yield return (@".XX(.+)+[X]", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail.");
+ yield return (@".[X](.+)+[X]", RegexOptions.None, "bbbbXcXaaaaaaaa", "Pass. Group[0]=(3,4) Group[1]=(5,1)");
+ yield return (@".[X](.+)+[X][X]", RegexOptions.None, "bbbbXcXXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(5,1)");
+ yield return (@".[X][X](.+)+[X]", RegexOptions.None, "bbbbXXcXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(6,1)");
+ yield return (@".[X](.+)+[X]", RegexOptions.None, "bbbbXXaaaaaaaaa", "Fail.");
+ yield return (@".[X](.+)+[X][X]", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail.");
+ yield return (@".[X][X](.+)+[X]", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail.");
+ yield return (@"tt+$", RegexOptions.None, "xxxtt", "Pass. Group[0]=(3,2)");
+ yield return (@"([\d-z]+)", RegexOptions.None, "a0-za", "Pass. Group[0]=(1,3) Group[1]=(1,3)");
+ yield return (@"([\d-\s]+)", RegexOptions.None, "a0- z", "Pass. Group[0]=(1,3) Group[1]=(1,3)");
+ yield return (@"(\d+\.\d+)", RegexOptions.None, "3.1415926", "Pass. Group[0]=(0,9) Group[1]=(0,9)");
+ yield return (@"(\ba.{0,10}br)", RegexOptions.None, "have a web browser", "Pass. Group[0]=(5,8) Group[1]=(5,8)");
+ yield return (@"\.c(pp|xx|c)?$", RegexOptions.IgnoreCase, "Changes", "Fail.");
+ yield return (@"\.c(pp|xx|c)?$", RegexOptions.IgnoreCase, "IO.c", "Pass. Group[0]=(2,2) Group[1]=");
+ yield return (@"(\.c(pp|xx|c)?$)", RegexOptions.IgnoreCase, "IO.c", "Pass. Group[0]=(2,2) Group[1]=(2,2) Group[2]=");
+ yield return (@"^([a-z]:)", RegexOptions.None, "C:/", "Fail.");
+ yield return (@"^\S\s+aa$", RegexOptions.Multiline, "\nx aa", "Pass. Group[0]=(1,4)");
+ yield return (@"(^|a)b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)");
+ yield return (@"^([ab]*?)(b)?(c)$", RegexOptions.None, "abac", "Pass. Group[0]=(0,4) Group[1]=(0,3) Group[2]= Group[3]=(3,1)");
+ yield return (@"^(?:.,){2}c", RegexOptions.None, "a,b,c", "Pass. Group[0]=(0,5)");
+ yield return (@"^(.,){2}c", RegexOptions.None, "a,b,c", "Pass. Group[0]=(0,5) Group[1]=(0,2)(2,2)");
+ yield return (@"^(?:[^,]*,){2}c", RegexOptions.None, "a,b,c", "Pass. Group[0]=(0,5)");
+ yield return (@"^([^,]*,){2}c", RegexOptions.None, "a,b,c", "Pass. Group[0]=(0,5) Group[1]=(0,2)(2,2)");
+ yield return (@"^([^,]*,){3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)");
+ yield return (@"^([^,]*,){3,}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)");
+ yield return (@"^([^,]*,){0,3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)");
+ yield return (@"^([^,]{1,3},){3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)");
+ yield return (@"^([^,]{1,3},){3,}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)");
+ yield return (@"^([^,]{1,3},){0,3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)");
+ yield return (@"^([^,]{1,},){3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)");
+ yield return (@"^([^,]{1,},){3,}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)");
+ yield return (@"^([^,]{1,},){0,3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)");
+ yield return (@"^([^,]{0,3},){3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)");
+ yield return (@"^([^,]{0,3},){3,}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)");
+ yield return (@"^([^,]{0,3},){0,3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)");
+ yield return (@"(?i)", RegexOptions.None, "", "Pass. Group[0]=(0,0)");
+ yield return (@"^(a(b)?)+$", RegexOptions.None, "aba", "Pass. Group[0]=(0,3) Group[1]=(0,2)(2,1) Group[2]=(1,1)");
+ yield return (@"^(aa(bb)?)+$", RegexOptions.None, "aabbaa", "Pass. Group[0]=(0,6) Group[1]=(0,4)(4,2) Group[2]=(2,2)");
+ yield return (@"^.{9}abc.*\n", RegexOptions.Multiline, "123\nabcabcabcabc\n", "Pass. Group[0]=(4,13)");
+ yield return (@"^(a)?a$", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]=");
+ yield return (@"^(0+)?(?:x(1))?", RegexOptions.None, "x1", "Pass. Group[0]=(0,2) Group[1]= Group[2]=(1,1)");
+ yield return (@"^([0-9a-fA-F]+)(?:x([0-9a-fA-F]+)?)(?:x([0-9a-fA-F]+))?", RegexOptions.None, "012cxx0190", "Pass. Group[0]=(0,10) Group[1]=(0,4) Group[2]= Group[3]=(6,4)");
+ yield return (@"^(b+?|a){1,2}c", RegexOptions.None, "bbbac", "Pass. Group[0]=(0,5) Group[1]=(0,3)(3,1)");
+ yield return (@"^(b+?|a){1,2}c", RegexOptions.None, "bbbbac", "Pass. Group[0]=(0,6) Group[1]=(0,4)(4,1)");
+ yield return (@"\((\w\. \w+)\)", RegexOptions.None, "cd. (A. Tw)", "Pass. Group[0]=(4,7) Group[1]=(5,5)");
+ yield return (@"((?:aaaa|bbbb)cccc)?", RegexOptions.None, "aaaacccc", "Pass. Group[0]=(0,8) Group[1]=(0,8)");
+ yield return (@"((?:aaaa|bbbb)cccc)?", RegexOptions.None, "bbbbcccc", "Pass. Group[0]=(0,8) Group[1]=(0,8)");
+ yield return (@"^(foo)|(bar)$", RegexOptions.None, "foobar", "Pass. Group[0]=(0,3) Group[1]=(0,3) Group[2]=");
+ yield return (@"^((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "[n]", "Pass. Group[0]=(0,3) Group[1]=(1,1)");
+ yield return (@"^((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "n", "Pass. Group[0]=(0,1) Group[1]=(0,1)");
+ yield return (@"^((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "n[i]e", "Fail.");
+ yield return (@"^((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "[n", "Fail.");
+ yield return (@"^((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "]n]", "Fail.");
+ yield return (@"^((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, @"\[n\]", "Fail.");
+ yield return (@"^((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, @"[n\]", "Pass. Group[0]=(0,4) Group[1]=(1,2)");
+ yield return (@"^((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, @"[n\[]", "Pass. Group[0]=(0,5) Group[1]=(1,3)");
+ yield return (@"^((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, @"[[n]", "Pass. Group[0]=(0,4) Group[1]=(1,2)");
+ yield return (@"^((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "[s] . [n]", "Pass. Group[0]=(0,9) Group[1]=(1,1) Group[2]=(7,1)");
+ yield return (@"^((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "[s] . n", "Pass. Group[0]=(0,7) Group[1]=(1,1) Group[2]=(6,1)");
+ yield return (@"^((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "s.[ n ]", "Pass. Group[0]=(0,7) Group[1]=(0,1) Group[2]=(3,3)");
+ yield return (@"^((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, " . n", "Pass. Group[0]=(0,4) Group[1]=(0,1) Group[2]=(3,1)");
+ yield return (@"^((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "s. ", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(2,1)");
+ yield return (@"^((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "[.]. ", "Pass. Group[0]=(0,5) Group[1]=(1,1) Group[2]=(4,1)");
+ yield return (@"^((\[(?<CATALOG>[^\]]+)\])|(?<CATALOG>[^\.\[\]]+))\s*\.\s*((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "[c].[s].[n]", "Pass. Group[0]=(0,11) Group[1]=(1,1) Group[2]=(5,1) Group[3]=(9,1)");
+ yield return (@"^((\[(?<CATALOG>[^\]]+)\])|(?<CATALOG>[^\.\[\]]+))\s*\.\s*((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, " c . s . n ", "Pass. Group[0]=(0,11) Group[1]=(0,3) Group[2]=(5,2) Group[3]=(9,2)");
+ yield return (@"^((\[(?<CATALOG>[^\]]+)\])|(?<CATALOG>[^\.\[\]]+))\s*\.\s*((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, " . [.] . [ ]", "Pass. Group[0]=(0,12) Group[1]=(0,1) Group[2]=(4,1) Group[3]=(10,1)");
+ yield return (@"^((\[(?<CATALOG>[^\]]+)\])|(?<CATALOG>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "c.n", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(2,1)");
+ yield return (@"^((\[(?<CATALOG>[^\]]+)\])|(?<CATALOG>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "[c] .[n]", "Pass. Group[0]=(0,8) Group[1]=(1,1) Group[2]=(6,1)");
+ yield return (@"^((\[(?<CATALOG>[^\]]+)\])|(?<CATALOG>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "c.n.", "Fail.");
+ yield return (@"^((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<CATALOG>[^\]]+)\])|(?<CATALOG>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "s.c.n", "Pass. Group[0]=(0,5) Group[1]=(0,1) Group[2]=(2,1) Group[3]=(4,1)");
+ yield return (@"^((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<CATALOG>[^\]]+)\])|(?<CATALOG>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "[s].[c].[n]", "Pass. Group[0]=(0,11) Group[1]=(1,1) Group[2]=(5,1) Group[3]=(9,1)");
+ yield return (@"^((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<CATALOG>[^\]]+)\])|(?<CATALOG>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "[s].[c].", "Fail.");
+ yield return (@"^((\[(?<ColName>.+)\])|(?<ColName>\S+))([ ]+(?<Order>ASC|DESC))?$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "[id]]", "Pass. Group[0]=(0,5) Group[1]=(1,3) Group[2]=");
+ yield return (@"a{1,2147483647}", RegexOptions.None, "a", "Pass. Group[0]=(0,1)");
+ yield return (@"^((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.None, "[a]", "Pass. Group[0]=(0,3) Group[1]=(0,3) Group[2]=(0,3) Group[3]=(1,1)");
+
+ // Ported from https://github.com/mono/mono/blob/0f2995e95e98e082c7c7039e17175cf2c6a00034/mcs/class/System/Test/System.Text.RegularExpressions/RegexMatchTests.cs
+ yield return (@"(a)(?<1>b)(?'1'c)", RegexOptions.ExplicitCapture, "abc", "Pass. Group[0]=(0,3) Group[1]=(1,1)(2,1)");
+ yield return (@"(a)(b)(c)", RegexOptions.ExplicitCapture, "abc", "Pass. Group[0]=(0,3)");
+ yield return (@"(a)(?<1>b)(c)", RegexOptions.ExplicitCapture, "abc", "Pass. Group[0]=(0,3) Group[1]=(1,1)");
+ yield return (@"(a)(?<2>b)(c)", RegexOptions.None, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(1,1)(2,1)");
+ yield return (@"(a)(?<foo>b)(c)", RegexOptions.ExplicitCapture, "abc", "Pass. Group[0]=(0,3) Group[1]=(1,1)");
+ yield return (@"\P{IsHebrew}", RegexOptions.None, "\u05D0a", "Pass. Group[0]=(1,1)");
+ yield return (@"\p{IsHebrew}", RegexOptions.None, "abc\u05D0def", "Pass. Group[0]=(3,1)");
+ yield return (@"\4400", RegexOptions.None, "asdf 012", "Pass. Group[0]=(4,2)");
+ yield return (@"\4400", RegexOptions.None, "asdf$0012", "Fail.");
+ yield return (@"(?<2>ab)(?<c>c)(?<d>d)", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(2,1) Group[2]=(0,2) Group[3]=(3,1)");// 61
+ yield return (@"(?<1>ab)(c)", RegexOptions.None, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,2)(2,1)");
+ yield return (@"(?<44>a)", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[44]=(0,1)");
+ yield return (@"(?<44>a)(?<8>b)", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[8]=(1,1) Group[44]=(0,1)");
+ yield return (@"(?<44>a)(?<8>b)(?<1>c)(d)", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(2,1)(3,1) Group[8]=(1,1) Group[44]=(0,1)");
+ yield return (@"(?<44>a)(?<44>b)", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[44]=(0,1)(1,1)");
+ yield return (@"(?<44>a)\440", RegexOptions.None, "a ", "Pass. Group[0]=(0,2) Group[44]=(0,1)");
+ yield return (@"(?<44>a)\440", RegexOptions.None, "aa0", "Fail.");
+
+ if (!RegexHelpers.IsNonBacktracking(engine))
+ {
+ yield return (@"((((((((((a))))))))))\10", RegexOptions.None, "aa", "Pass. Group[0]=(0,2) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)");
+ yield return (@"(abc)\1", RegexOptions.None, "abcabc", "Pass. Group[0]=(0,6) Group[1]=(0,3)");
+ yield return (@"([a-c]*)\1", RegexOptions.None, "abcabc", "Pass. Group[0]=(0,6) Group[1]=(0,3)");
+ yield return (@"(a)|\1", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]=(0,1)");
+ yield return (@"(a)|\1", RegexOptions.None, "x", "Fail.");
+ yield return (@"(([a-c])b*?\2)*", RegexOptions.None, "ababbbcbc", "Pass. Group[0]=(0,5) Group[1]=(0,3)(3,2) Group[2]=(0,1)(3,1)");
+ yield return (@"(([a-c])b*?\2){3}", RegexOptions.None, "ababbbcbc", "Pass. Group[0]=(0,9) Group[1]=(0,3)(3,3)(6,3) Group[2]=(0,1)(3,1)(6,1)");
+ yield return (@"((\3|b)\2(a)x)+", RegexOptions.None, "aaxabxbaxbbx", "Fail.");
+ yield return (@"((\3|b)\2(a)x)+", RegexOptions.None, "aaaxabaxbaaxbbax", "Pass. Group[0]=(12,4) Group[1]=(12,4) Group[2]=(12,1) Group[3]=(14,1)");
+ yield return (@"((\3|b)\2(a)){2,}", RegexOptions.None, "bbaababbabaaaaabbaaaabba", "Pass. Group[0]=(15,9) Group[1]=(15,3)(18,3)(21,3) Group[2]=(15,1)(18,1)(21,1) Group[3]=(17,1)(20,1)(23,1)");
+ yield return (@"((((((((((a))))))))))\10", RegexOptions.IgnoreCase, "AA", "Pass. Group[0]=(0,2) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)");
+ yield return (@"(abc)\1", RegexOptions.IgnoreCase, "ABCABC", "Pass. Group[0]=(0,6) Group[1]=(0,3)");
+ yield return (@"([a-c]*)\1", RegexOptions.IgnoreCase, "ABCABC", "Pass. Group[0]=(0,6) Group[1]=(0,3)");
+ yield return (@"a(?!b).", RegexOptions.None, "abad", "Pass. Group[0]=(2,2)");
+ yield return (@"a(?=d).", RegexOptions.None, "abad", "Pass. Group[0]=(2,2)");
+ yield return (@"a(?=c|d).", RegexOptions.None, "abad", "Pass. Group[0]=(2,2)");
+ yield return (@"^(a\1?){4}$", RegexOptions.None, "aaaaaaaaaa", "Pass. Group[0]=(0,10) Group[1]=(0,1)(1,2)(3,3)(6,4)");
+ yield return (@"^(a\1?){4}$", RegexOptions.None, "aaaaaaaaa", "Fail.");
+ yield return (@"^(a\1?){4}$", RegexOptions.None, "aaaaaaaaaaa", "Fail.");
+ yield return (@"^(a(?(1)\1)){4}$", RegexOptions.None, "aaaaaaaaaa", "Pass. Group[0]=(0,10) Group[1]=(0,1)(1,2)(3,3)(6,4)");
+ yield return (@"^(a(?(1)\1)){4}$", RegexOptions.None, "aaaaaaaaa", "Fail.");
+ yield return (@"^(a(?(1)\1)){4}$", RegexOptions.None, "aaaaaaaaaaa", "Fail.");
+ yield return (@"(?<=a)b", RegexOptions.None, "ab", "Pass. Group[0]=(1,1)");
+ yield return (@"(?<=a)b", RegexOptions.None, "cb", "Fail.");
+ yield return (@"(?<=a)b", RegexOptions.None, "b", "Fail.");
+ yield return (@"(?<!c)b", RegexOptions.None, "ab", "Pass. Group[0]=(1,1)");
+ yield return (@"(?<!c)b", RegexOptions.None, "cb", "Fail.");
+ yield return (@"(?<!c)b", RegexOptions.None, "b", "Pass. Group[0]=(0,1)");
+ yield return (@"^(?:b|a(?=(.)))*\1", RegexOptions.None, "abc", "Pass. Group[0]=(0,2) Group[1]=(1,1)");
+ yield return (@"(ab)\d\1", RegexOptions.IgnoreCase, "Ab4ab", "Pass. Group[0]=(0,5) Group[1]=(0,2)");
+ yield return (@"(ab)\d\1", RegexOptions.IgnoreCase, "ab4Ab", "Pass. Group[0]=(0,5) Group[1]=(0,2)");
+ yield return (@"(?<![cd])b", RegexOptions.None, "dbcb", "Fail.");
+ yield return (@"(?<![cd])[ab]", RegexOptions.None, "dbaacb", "Pass. Group[0]=(2,1)");
+ yield return (@"(?<!(c|d))b", RegexOptions.None, "dbcb", "Fail.");
+ yield return (@"(?<!(c|d))[ab]", RegexOptions.None, "dbaacb", "Pass. Group[0]=(2,1) Group[1]=");
+ yield return (@"(?<!cd)[ab]", RegexOptions.None, "cdaccb", "Pass. Group[0]=(5,1)");
+ yield return (@"((?s).)c(?!.)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(3,2) Group[1]=(3,1)");
+ yield return (@"((?s)b.)c(?!.)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(2,3) Group[1]=(2,2)");
+ yield return (@"(x)?(?(1)a|b)", RegexOptions.None, "a", "Fail.");
+ yield return (@"(x)?(?(1)b|a)", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]=");
+ yield return (@"()?(?(1)b|a)", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]=");
+ yield return (@"()(?(1)b|a)", RegexOptions.None, "a", "Fail.");
+ yield return (@"()?(?(1)a|b)", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]=(0,0)");
+ yield return (@"^(\()?blah(?(1)(\)))$", RegexOptions.None, "(blah)", "Pass. Group[0]=(0,6) Group[1]=(0,1) Group[2]=(5,1)");
+ yield return (@"^(\()?blah(?(1)(\)))$", RegexOptions.None, "blah", "Pass. Group[0]=(0,4) Group[1]= Group[2]=");
+ yield return (@"^(\()?blah(?(1)(\)))$", RegexOptions.None, "blah)", "Fail.");
+ yield return (@"^(\()?blah(?(1)(\)))$", RegexOptions.None, "(blah", "Fail.");
+ yield return (@"^(\(+)?blah(?(1)(\)))$", RegexOptions.None, "(blah)", "Pass. Group[0]=(0,6) Group[1]=(0,1) Group[2]=(5,1)");
+ yield return (@"^(\(+)?blah(?(1)(\)))$", RegexOptions.None, "blah", "Pass. Group[0]=(0,4) Group[1]= Group[2]=");
+ yield return (@"^(\(+)?blah(?(1)(\)))$", RegexOptions.None, "blah)", "Fail.");
+ yield return (@"^(\(+)?blah(?(1)(\)))$", RegexOptions.None, "(blah", "Fail.");
+ yield return (@"(?(?!a)a|b)", RegexOptions.None, "a", "Fail.");
+ yield return (@"(?(?!a)b|a)", RegexOptions.None, "a", "Pass. Group[0]=(0,1)");
+ yield return (@"(?(?=a)b|a)", RegexOptions.None, "a", "Fail.");
+ yield return (@"(?(?=a)a|b)", RegexOptions.None, "a", "Pass. Group[0]=(0,1)");
+ yield return (@"(?=(a+?))(\1ab)", RegexOptions.None, "aaab", "Pass. Group[0]=(1,3) Group[1]=(1,1) Group[2]=(1,3)");
+ yield return (@"^(?=(a+?))\1ab", RegexOptions.None, "aaab", "Fail.");
+ yield return (@"$(?<=^(a))", RegexOptions.None, "a", "Pass. Group[0]=(1,0) Group[1]=(0,1)");
+ yield return (@"(?>a+)b", RegexOptions.None, "aaab", "Pass. Group[0]=(0,4)");
+ yield return (@"((?>a+)b)", RegexOptions.None, "aaab", "Pass. Group[0]=(0,4) Group[1]=(0,4)");
+ yield return (@"(?>(a+))b", RegexOptions.None, "aaab", "Pass. Group[0]=(0,4) Group[1]=(0,3)");
+ yield return (@"((?>[^()]+)|\([^()]*\))+", RegexOptions.None, "((abc(ade)ufh()()x", "Pass. Group[0]=(2,16) Group[1]=(2,3)(5,5)(10,3)(13,2)(15,2)(17,1)");
+ yield return (@"(?<=x+)", RegexOptions.None, "xxxxy", "Pass. Group[0]=(1,0)");
+ yield return (@"round\(((?>[^()]+))\)", RegexOptions.None, "_I(round(xs * sz),1)", "Pass. Group[0]=(3,14) Group[1]=(9,7)");
+ yield return (@"(\w)?(abc)\1b", RegexOptions.None, "abcab", "Fail.");
+ yield return (@"\GX.*X", RegexOptions.None, "aaaXbX", "Fail.");
+ yield return (@"(?!\A)x", RegexOptions.Multiline, "a\nxb\n", "Pass. Group[0]=(2,1)");
+ yield return (@"^(a)?(?(1)a|b)+$", RegexOptions.None, "a", "Fail.");
+ yield return (@"^(a\1?)(a\1?)(a\2?)(a\3?)$", RegexOptions.None, "aaaaaa", "Pass. Group[0]=(0,6) Group[1]=(0,1) Group[2]=(1,2) Group[3]=(3,1) Group[4]=(4,2)");
+ yield return (@"^(a\1?){4}$", RegexOptions.None, "aaaaaa", "Pass. Group[0]=(0,6) Group[1]=(0,1)(1,2)(3,1)(4,2)");
+ yield return (@"\((?>[^()]+|\((?<depth>)|\)(?<-depth>))*(?(depth)(?!))\)", RegexOptions.None, "((a(b))c)", "Pass. Group[0]=(0,9) Group[1]=");
+ yield return (@"^\((?>[^()]+|\((?<depth>)|\)(?<-depth>))*(?(depth)(?!))\)$", RegexOptions.None, "((a(b))c)", "Pass. Group[0]=(0,9) Group[1]=");
+ yield return (@"^\((?>[^()]+|\((?<depth>)|\)(?<-depth>))*(?(depth)(?!))\)$", RegexOptions.None, "((a(b))c", "Fail.");
+ yield return (@"^\((?>[^()]+|\((?<depth>)|\)(?<-depth>))*(?(depth)(?!))\)$", RegexOptions.None, "())", "Fail.");
+ yield return (@"(((?<foo>\()[^()]*)+((?<bar-foo>\))[^()]*)+)+(?(foo)(?!))", RegexOptions.None, "((a(b))c)", "Pass. Group[0]=(0,9) Group[1]=(0,9) Group[2]=(0,1)(1,2)(3,2) Group[3]=(5,1)(6,2)(8,1) Group[4]= Group[5]=(4,1)(2,4)(1,7)");
+ yield return (@"^(((?<foo>\()[^()]*)+((?<bar-foo>\))[^()]*)+)+(?(foo)(?!))$", RegexOptions.None, "((a(b))c)", "Pass. Group[0]=(0,9) Group[1]=(0,9) Group[2]=(0,1)(1,2)(3,2) Group[3]=(5,1)(6,2)(8,1) Group[4]= Group[5]=(4,1)(2,4)(1,7)");
+ yield return (@"(((?<foo>\()[^()]*)+((?<bar-foo>\))[^()]*)+)+(?(foo)(?!))", RegexOptions.None, "x(a((b)))b)x", "Pass. Group[0]=(1,9) Group[1]=(1,9) Group[2]=(1,2)(3,1)(4,2) Group[3]=(6,1)(7,1)(8,2) Group[4]= Group[5]=(5,1)(4,3)(2,6)");
+ yield return (@"(((?<foo>\()[^()]*)+((?<bar-foo>\))[^()]*)+)+(?(foo)(?!))", RegexOptions.None, "x((a((b)))x", "Pass. Group[0]=(2,9) Group[1]=(2,9) Group[2]=(2,2)(4,1)(5,2) Group[3]=(7,1)(8,1)(9,2) Group[4]= Group[5]=(6,1)(5,3)(3,6)");
+ yield return (@"^(((?<foo>\()[^()]*)+((?<bar-foo>\))[^()]*)+)+(?(foo)(?!))$", RegexOptions.None, "((a(b))c", "Fail.");
+ yield return (@"^(((?<foo>\()[^()]*)+((?<bar-foo>\))[^()]*)+)+(?(foo)(?!))$", RegexOptions.None, "((a(b))c))", "Fail.");
+ yield return (@"^(((?<foo>\()[^()]*)+((?<bar-foo>\))[^()]*)+)+(?(foo)(?!))$", RegexOptions.None, ")(", "Fail.");
+ yield return (@"^(((?<foo>\()[^()]*)+((?<bar-foo>\))[^()]*)+)+(?(foo)(?!))$", RegexOptions.None, "((a((b))c)", "Fail.");
+
+ yield return (@"\1", RegexOptions.ECMAScript, "-", "Fail.");
+ yield return (@"\2", RegexOptions.ECMAScript, "-", "Fail.");
+ yield return (@"(a)|\2", RegexOptions.ECMAScript, "-", "Fail.");
+ yield return (@"\4400", RegexOptions.ECMAScript, "asdf 012", "Fail.");
+ yield return (@"\4400", RegexOptions.ECMAScript, "asdf$0012", "Pass. Group[0]=(4,3)");
+ yield return (@"(?<44>a)\440", RegexOptions.ECMAScript, "a ", "Fail.");
+ yield return (@"(?<44>a)\440", RegexOptions.ECMAScript, "aa0", "Pass. Group[0]=(0,3) Group[44]=(0,1)");
+
+ yield return (@"^(foo)|(bar)$", RegexOptions.RightToLeft, "foobar", "Pass. Group[0]=(3,3) Group[1]= Group[2]=(3,3)");
+ yield return (@"b", RegexOptions.RightToLeft, "babaaa", "Pass. Group[0]=(2,1)");
+ yield return (@"bab", RegexOptions.RightToLeft, "babababaa", "Pass. Group[0]=(4,3)");
+ yield return (@"abb", RegexOptions.RightToLeft, "abb", "Pass. Group[0]=(0,3)");
+ yield return (@"b$", RegexOptions.RightToLeft | RegexOptions.Multiline, "aab\naab", "Pass. Group[0]=(6,1)");
+ yield return (@"^a", RegexOptions.RightToLeft | RegexOptions.Multiline, "aab\naab", "Pass. Group[0]=(4,1)");
+ yield return (@"^aaab", RegexOptions.RightToLeft | RegexOptions.Multiline, "aaab\naab", "Pass. Group[0]=(0,4)");
+ yield return (@"abb{2}", RegexOptions.RightToLeft, "abbb", "Pass. Group[0]=(0,4)");
+ yield return (@"abb{1,2}", RegexOptions.RightToLeft, "abbb", "Pass. Group[0]=(0,4)");
+ yield return (@"abb{1,2}", RegexOptions.RightToLeft, "abbbbbaaaa", "Pass. Group[0]=(0,4)");
+ yield return (@"\Ab", RegexOptions.RightToLeft, "bab\naaa", "Pass. Group[0]=(0,1)");
+ yield return (@"\Abab$", RegexOptions.RightToLeft, "bab", "Pass. Group[0]=(0,3)");
+ yield return (@"b\Z", RegexOptions.RightToLeft, "bab\naaa", "Fail.");
+ yield return (@"b\Z", RegexOptions.RightToLeft, "babaaab", "Pass. Group[0]=(6,1)");
+ yield return (@"b\z", RegexOptions.RightToLeft, "babaaa", "Fail.");
+ yield return (@"b\z", RegexOptions.RightToLeft, "babaaab", "Pass. Group[0]=(6,1)");
+ yield return (@"a\G", RegexOptions.RightToLeft, "babaaa", "Pass. Group[0]=(5,1)");
+ yield return (@"\Abaaa\G", RegexOptions.RightToLeft, "baaa", "Pass. Group[0]=(0,4)");
+ yield return (@"\bc", RegexOptions.RightToLeft, "aaa c aaa c a", "Pass. Group[0]=(10,1)");
+ yield return (@"\bc", RegexOptions.RightToLeft, "c aaa c", "Pass. Group[0]=(6,1)");
+ yield return (@"\bc", RegexOptions.RightToLeft, "aaa ac", "Fail.");
+ yield return (@"\bc", RegexOptions.RightToLeft, "c aaa", "Pass. Group[0]=(0,1)");
+ yield return (@"\bc", RegexOptions.RightToLeft, "aaacaaa", "Fail.");
+ yield return (@"\bc", RegexOptions.RightToLeft, "aaac aaa", "Fail.");
+ yield return (@"\bc", RegexOptions.RightToLeft, "aaa ca caaa", "Pass. Group[0]=(7,1)");
+ yield return (@"\Bc", RegexOptions.RightToLeft, "ac aaa ac", "Pass. Group[0]=(8,1)");
+ yield return (@"\Bc", RegexOptions.RightToLeft, "aaa c", "Fail.");
+ yield return (@"\Bc", RegexOptions.RightToLeft, "ca aaa", "Fail.");
+ yield return (@"\Bc", RegexOptions.RightToLeft, "aaa c aaa", "Fail.");
+ yield return (@"\Bc", RegexOptions.RightToLeft, " acaca ", "Pass. Group[0]=(4,1)");
+ yield return (@"\Bc", RegexOptions.RightToLeft, "aaac aaac", "Pass. Group[0]=(8,1)");
+ yield return (@"\Bc", RegexOptions.RightToLeft, "aaa caaa", "Fail.");
+ yield return (@"b(a?)b", RegexOptions.RightToLeft, "aabababbaaababa", "Pass. Group[0]=(11,3) Group[1]=(12,1)");
+ yield return (@"b{4}", RegexOptions.RightToLeft, "abbbbaabbbbaabbb", "Pass. Group[0]=(7,4)");
+ yield return (@"b\1aa(.)", RegexOptions.RightToLeft, "bBaaB", "Pass. Group[0]=(0,5) Group[1]=(4,1)");
+ yield return (@"b(.)aa\1", RegexOptions.RightToLeft, "bBaaB", "Fail.");
+ yield return (@"^(a\1?){4}$", RegexOptions.RightToLeft, "aaaaaa", "Pass. Group[0]=(0,6) Group[1]=(5,1)(3,2)(2,1)(0,2)");
+ yield return (@"^([0-9a-fA-F]+)(?:x([0-9a-fA-F]+)?)(?:x([0-9a-fA-F]+))?", RegexOptions.RightToLeft, "012cxx0190", "Pass. Group[0]=(0,10) Group[1]=(0,4) Group[2]= Group[3]=(6,4)");
+ yield return (@"^(b+?|a){1,2}c", RegexOptions.RightToLeft, "bbbac", "Pass. Group[0]=(0,5) Group[1]=(3,1)(0,3)");
+ yield return (@"\((\w\. \w+)\)", RegexOptions.RightToLeft, "cd. (A. Tw)", "Pass. Group[0]=(4,7) Group[1]=(5,5)");
+ yield return (@"((?:aaaa|bbbb)cccc)?", RegexOptions.RightToLeft, "aaaacccc", "Pass. Group[0]=(0,8) Group[1]=(0,8)");
+ yield return (@"((?:aaaa|bbbb)cccc)?", RegexOptions.RightToLeft, "bbbbcccc", "Pass. Group[0]=(0,8) Group[1]=(0,8)");
+ yield return (@"(?<=a)b", RegexOptions.RightToLeft, "ab", "Pass. Group[0]=(1,1)");
+ yield return (@"(?<=a)b", RegexOptions.RightToLeft, "cb", "Fail.");
+ yield return (@"(?<=a)b", RegexOptions.RightToLeft, "b", "Fail.");
+ yield return (@"(?<!c)b", RegexOptions.RightToLeft, "ab", "Pass. Group[0]=(1,1)");
+ yield return (@"(?<!c)b", RegexOptions.RightToLeft, "cb", "Fail.");
+ yield return (@"(?<!c)b", RegexOptions.RightToLeft, "b", "Pass. Group[0]=(0,1)");
+ yield return (@"a(?=d).", RegexOptions.RightToLeft, "adabad", "Pass. Group[0]=(4,2)");
+ yield return (@"a(?=c|d).", RegexOptions.RightToLeft, "adabad", "Pass. Group[0]=(4,2)");
+ yield return (@"ab*c", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3)");
+ yield return (@"ab*bc", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3)");
+ yield return (@"ab*bc", RegexOptions.RightToLeft, "abbc", "Pass. Group[0]=(0,4)");
+ yield return (@"ab*bc", RegexOptions.RightToLeft, "abbbbc", "Pass. Group[0]=(0,6)");
+ yield return (@".{1}", RegexOptions.RightToLeft, "abbbbc", "Pass. Group[0]=(5,1)");
+ yield return (@".{3,4}", RegexOptions.RightToLeft, "abbbbc", "Pass. Group[0]=(2,4)");
+ yield return (@"ab{0,}bc", RegexOptions.RightToLeft, "abbbbc", "Pass. Group[0]=(0,6)");
+ yield return (@"ab+bc", RegexOptions.RightToLeft, "abbc", "Pass. Group[0]=(0,4)");
+ yield return (@"ab+bc", RegexOptions.RightToLeft, "abc", "Fail.");
+ yield return (@"ab+bc", RegexOptions.RightToLeft, "abq", "Fail.");
+ yield return (@"ab{1,}bc", RegexOptions.RightToLeft, "abq", "Fail.");
+ yield return (@"ab+bc", RegexOptions.RightToLeft, "abbbbc", "Pass. Group[0]=(0,6)");
+ yield return (@"ab{1,}bc", RegexOptions.RightToLeft, "abbbbc", "Pass. Group[0]=(0,6)");
+ yield return (@"ab{1,3}bc", RegexOptions.RightToLeft, "abbbbc", "Pass. Group[0]=(0,6)");
+ yield return (@"ab{3,4}bc", RegexOptions.RightToLeft, "abbbbc", "Pass. Group[0]=(0,6)");
+ yield return (@"ab{4,5}bc", RegexOptions.RightToLeft, "abbbbc", "Fail.");
+ yield return (@"ab?bc", RegexOptions.RightToLeft, "abbc", "Pass. Group[0]=(0,4)");
+ yield return (@"ab?bc", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3)");
+ yield return (@"ab{0,1}bc", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3)");
+ yield return (@"ab?bc", RegexOptions.RightToLeft, "abbbbc", "Fail.");
+ yield return (@"ab?c", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3)");
+ yield return (@"ab{0,1}c", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3)");
+ yield return (@"^abc$", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3)");
+ yield return (@"^abc$", RegexOptions.RightToLeft, "abcc", "Fail.");
+ yield return (@"^abc", RegexOptions.RightToLeft, "abcc", "Pass. Group[0]=(0,3)");
+ yield return (@"^abc$", RegexOptions.RightToLeft, "aabc", "Fail.");
+ yield return (@"abc$", RegexOptions.RightToLeft, "aabc", "Pass. Group[0]=(1,3)");
+ yield return (@"abc$", RegexOptions.RightToLeft, "aabcd", "Fail.");
+ yield return (@"^", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,0)");
+ yield return (@"$", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(3,0)");
+ yield return (@"a.c", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3)");
+ yield return (@"a.c", RegexOptions.RightToLeft, "axc", "Pass. Group[0]=(0,3)");
+ yield return (@"a.*c", RegexOptions.RightToLeft, "axyzc", "Pass. Group[0]=(0,5)");
+ yield return (@"a.*c", RegexOptions.RightToLeft, "axyzd", "Fail.");
+ yield return (@"a[bc]d", RegexOptions.RightToLeft, "abc", "Fail.");
+ yield return (@"a[bc]d", RegexOptions.RightToLeft, "abd", "Pass. Group[0]=(0,3)");
+ yield return (@"a[b-d]e", RegexOptions.RightToLeft, "abd", "Fail.");
+ yield return (@"a[b-d]e", RegexOptions.RightToLeft, "ace", "Pass. Group[0]=(0,3)");
+ yield return (@"a[b-d]", RegexOptions.RightToLeft, "aac", "Pass. Group[0]=(1,2)");
+ yield return (@"a[-b]", RegexOptions.RightToLeft, "a-", "Pass. Group[0]=(0,2)");
+ yield return (@"a[b-]", RegexOptions.RightToLeft, "a-", "Pass. Group[0]=(0,2)");
+ yield return (@"a]", RegexOptions.RightToLeft, "a]", "Pass. Group[0]=(0,2)");
+ yield return (@"a[]]b", RegexOptions.RightToLeft, "a]b", "Pass. Group[0]=(0,3)");
+ yield return (@"a[^bc]d", RegexOptions.RightToLeft, "aed", "Pass. Group[0]=(0,3)");
+ yield return (@"a[^bc]d", RegexOptions.RightToLeft, "abd", "Fail.");
+ yield return (@"a[^-b]c", RegexOptions.RightToLeft, "adc", "Pass. Group[0]=(0,3)");
+ yield return (@"a[^-b]c", RegexOptions.RightToLeft, "a-c", "Fail.");
+ yield return (@"a[^]b]c", RegexOptions.RightToLeft, "a]c", "Fail.");
+ yield return (@"a[^]b]c", RegexOptions.RightToLeft, "adc", "Pass. Group[0]=(0,3)");
+ yield return (@"\ba\b", RegexOptions.RightToLeft, "a-", "Pass. Group[0]=(0,1)");
+ yield return (@"\ba\b", RegexOptions.RightToLeft, "-a", "Pass. Group[0]=(1,1)");
+ yield return (@"\ba\b", RegexOptions.RightToLeft, "-a-", "Pass. Group[0]=(1,1)");
+ yield return (@"\by\b", RegexOptions.RightToLeft, "xy", "Fail.");
+ yield return (@"\by\b", RegexOptions.RightToLeft, "yz", "Fail.");
+ yield return (@"\by\b", RegexOptions.RightToLeft, "xyz", "Fail.");
+ yield return (@"\Ba\B", RegexOptions.RightToLeft, "a-", "Fail.");
+ yield return (@"\Ba\B", RegexOptions.RightToLeft, "-a", "Fail.");
+ yield return (@"\Ba\B", RegexOptions.RightToLeft, "-a-", "Fail.");
+ yield return (@"\By\b", RegexOptions.RightToLeft, "xy", "Pass. Group[0]=(1,1)");
+ yield return (@"\by\B", RegexOptions.RightToLeft, "yz", "Pass. Group[0]=(0,1)");
+ yield return (@"\By\B", RegexOptions.RightToLeft, "xyz", "Pass. Group[0]=(1,1)");
+ yield return (@"\w", RegexOptions.RightToLeft, "a", "Pass. Group[0]=(0,1)");
+ yield return (@"\w", RegexOptions.RightToLeft, "-", "Fail.");
+ yield return (@"\W", RegexOptions.RightToLeft, "a", "Fail.");
+ yield return (@"\W", RegexOptions.RightToLeft, "-", "Pass. Group[0]=(0,1)");
+ yield return (@"a\sb", RegexOptions.RightToLeft, "a b", "Pass. Group[0]=(0,3)");
+ yield return (@"a\sb", RegexOptions.RightToLeft, "a-b", "Fail.");
+ yield return (@"a\Sb", RegexOptions.RightToLeft, "a b", "Fail.");
+ yield return (@"a\Sb", RegexOptions.RightToLeft, "a-b", "Pass. Group[0]=(0,3)");
+ yield return (@"\d", RegexOptions.RightToLeft, "1", "Pass. Group[0]=(0,1)");
+ yield return (@"\d", RegexOptions.RightToLeft, "-", "Fail.");
+ yield return (@"\D", RegexOptions.RightToLeft, "1", "Fail.");
+ yield return (@"\D", RegexOptions.RightToLeft, "-", "Pass. Group[0]=(0,1)");
+ yield return (@"[\w]", RegexOptions.RightToLeft, "a", "Pass. Group[0]=(0,1)");
+ yield return (@"[\w]", RegexOptions.RightToLeft, "-", "Fail.");
+ yield return (@"[\W]", RegexOptions.RightToLeft, "a", "Fail.");
+ yield return (@"[\W]", RegexOptions.RightToLeft, "-", "Pass. Group[0]=(0,1)");
+ yield return (@"a[\s]b", RegexOptions.RightToLeft, "a b", "Pass. Group[0]=(0,3)");
+ yield return (@"a[\s]b", RegexOptions.RightToLeft, "a-b", "Fail.");
+ yield return (@"a[\S]b", RegexOptions.RightToLeft, "a b", "Fail.");
+ yield return (@"a[\S]b", RegexOptions.RightToLeft, "a-b", "Pass. Group[0]=(0,3)");
+ yield return (@"[\d]", RegexOptions.RightToLeft, "1", "Pass. Group[0]=(0,1)");
+ yield return (@"[\d]", RegexOptions.RightToLeft, "-", "Fail.");
+ yield return (@"[\D]", RegexOptions.RightToLeft, "1", "Fail.");
+ yield return (@"[\D]", RegexOptions.RightToLeft, "-", "Pass. Group[0]=(0,1)");
+ yield return (@"ab|cd", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,2)");
+ yield return (@"ab|cd", RegexOptions.RightToLeft, "abcd", "Pass. Group[0]=(2,2)");
+ yield return (@"()ef", RegexOptions.RightToLeft, "def", "Pass. Group[0]=(1,2) Group[1]=(1,0)");
+ yield return (@"$b", RegexOptions.RightToLeft, "b", "Fail.");
+ yield return (@"a\(b", RegexOptions.RightToLeft, "a(b", "Pass. Group[0]=(0,3)");
+ yield return (@"a\(*b", RegexOptions.RightToLeft, "ab", "Pass. Group[0]=(0,2)");
+ yield return (@"a\(*b", RegexOptions.RightToLeft, "a((b", "Pass. Group[0]=(0,4)");
+ yield return (@"a\\b", RegexOptions.RightToLeft, "a\\b", "Pass. Group[0]=(0,3)");
+ yield return (@"((a))", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1)");
+ yield return (@"(a)b(c)", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(2,1)");
+ yield return (@"a+b+c", RegexOptions.RightToLeft, "aabbabc", "Pass. Group[0]=(4,3)");
+ yield return (@"a{1,}b{1,}c", RegexOptions.RightToLeft, "aabbabc", "Pass. Group[0]=(4,3)");
+ yield return (@"a.+?c", RegexOptions.RightToLeft, "abcabc", "Pass. Group[0]=(3,3)");
+ yield return (@"(a+|b)*", RegexOptions.RightToLeft, "ab", "Pass. Group[0]=(0,2) Group[1]=(1,1)(0,1)");
+ yield return (@"(a+|b){0,}", RegexOptions.RightToLeft, "ab", "Pass. Group[0]=(0,2) Group[1]=(1,1)(0,1)");
+ yield return (@"(a+|b)+", RegexOptions.RightToLeft, "ab", "Pass. Group[0]=(0,2) Group[1]=(1,1)(0,1)");
+ yield return (@"(a+|b){1,}", RegexOptions.RightToLeft, "ab", "Pass. Group[0]=(0,2) Group[1]=(1,1)(0,1)");
+ yield return (@"(a+|b)?", RegexOptions.RightToLeft, "ab", "Pass. Group[0]=(1,1) Group[1]=(1,1)");
+ yield return (@"(a+|b){0,1}", RegexOptions.RightToLeft, "ab", "Pass. Group[0]=(1,1) Group[1]=(1,1)");
+ yield return (@"[^ab]*", RegexOptions.RightToLeft, "cde", "Pass. Group[0]=(0,3)");
+ yield return (@"abc", RegexOptions.RightToLeft, "", "Fail.");
+ yield return (@"a*", RegexOptions.RightToLeft, "", "Pass. Group[0]=(0,0)");
+ yield return (@"([abc])*d", RegexOptions.RightToLeft, "abbbcd", "Pass. Group[0]=(0,6) Group[1]=(4,1)(3,1)(2,1)(1,1)(0,1)");
+ yield return (@"([abc])*bcd", RegexOptions.RightToLeft, "abcd", "Pass. Group[0]=(0,4) Group[1]=(0,1)");
+ yield return (@"a|b|c|d|e", RegexOptions.RightToLeft, "e", "Pass. Group[0]=(0,1)");
+ yield return (@"(a|b|c|d|e)f", RegexOptions.RightToLeft, "ef", "Pass. Group[0]=(0,2) Group[1]=(0,1)");
+ yield return (@"abcd*efg", RegexOptions.RightToLeft, "abcdefg", "Pass. Group[0]=(0,7)");
+ yield return (@"ab*", RegexOptions.RightToLeft, "xabyabbbz", "Pass. Group[0]=(4,4)");
+ yield return (@"ab*", RegexOptions.RightToLeft, "xayabbbz", "Pass. Group[0]=(3,4)");
+ yield return (@"(ab|cd)e", RegexOptions.RightToLeft, "abcde", "Pass. Group[0]=(2,3) Group[1]=(2,2)");
+ yield return (@"[abhgefdc]ij", RegexOptions.RightToLeft, "hij", "Pass. Group[0]=(0,3)");
+ yield return (@"^(ab|cd)e", RegexOptions.RightToLeft, "abcde", "Fail.");
+ yield return (@"(abc|)ef", RegexOptions.RightToLeft, "abcdef", "Pass. Group[0]=(4,2) Group[1]=(4,0)");
+ yield return (@"(a|b)c*d", RegexOptions.RightToLeft, "abcd", "Pass. Group[0]=(1,3) Group[1]=(1,1)");
+ yield return (@"(ab|ab*)bc", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,1)");
+ yield return (@"a([bc]*)c*", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3) Group[1]=(1,1)");
+ yield return (@"a([bc]*)(c*d)", RegexOptions.RightToLeft, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,1) Group[2]=(2,2)");
+ yield return (@"a([bc]+)(c*d)", RegexOptions.RightToLeft, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,1) Group[2]=(2,2)");
+ yield return (@"a([bc]*)(c+d)", RegexOptions.RightToLeft, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,1) Group[2]=(2,2)");
+ yield return (@"a[bcd]*dcdcde", RegexOptions.RightToLeft, "adcdcde", "Pass. Group[0]=(0,7)");
+ yield return (@"a[bcd]+dcdcde", RegexOptions.RightToLeft, "adcdcde", "Fail.");
+ yield return (@"(ab|a)b*c", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,1)");
+ yield return (@"((a)(b)c)(d)", RegexOptions.RightToLeft, "abcd", "Pass. Group[0]=(0,4) Group[1]=(0,3) Group[2]=(0,1) Group[3]=(1,1) Group[4]=(3,1)");
+ yield return (@"[a-zA-Z_][a-zA-Z0-9_]*", RegexOptions.RightToLeft, "alpha", "Pass. Group[0]=(0,5)");
+ yield return (@"^a(bc+|b[eh])g|.h$", RegexOptions.RightToLeft, "abh", "Pass. Group[0]=(1,2) Group[1]=");
+ yield return (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.RightToLeft, "effgz", "Pass. Group[0]=(0,5) Group[1]=(0,5) Group[2]=");
+ yield return (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.RightToLeft, "ij", "Pass. Group[0]=(0,2) Group[1]=(0,2) Group[2]=(1,1)");
+ yield return (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.RightToLeft, "effg", "Fail.");
+ yield return (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.RightToLeft, "bcdd", "Fail.");
+ yield return (@"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.RightToLeft, "reffgz", "Pass. Group[0]=(1,5) Group[1]=(1,5) Group[2]=");
+ yield return (@"((((((((((a))))))))))", RegexOptions.RightToLeft, "a", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)");
+ yield return (@"((((((((((a))))))))))\10", RegexOptions.RightToLeft, "aa", "Fail.");
+ yield return (@"\10((((((((((a))))))))))", RegexOptions.RightToLeft, "aa", "Pass. Group[0]=(0,2) Group[1]=(1,1) Group[2]=(1,1) Group[3]=(1,1) Group[4]=(1,1) Group[5]=(1,1) Group[6]=(1,1) Group[7]=(1,1) Group[8]=(1,1) Group[9]=(1,1) Group[10]=(1,1)");
+ yield return (@"((((((((((a))))))))))!", RegexOptions.RightToLeft, "aa", "Fail.");
+ yield return (@"((((((((((a))))))))))!", RegexOptions.RightToLeft, "a!", "Pass. Group[0]=(0,2) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)");
+ yield return (@"(((((((((a)))))))))", RegexOptions.RightToLeft, "a", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1)");
+ yield return (@"multiple words of text", RegexOptions.RightToLeft, "uh-uh", "Fail.");
+ yield return (@"multiple words", RegexOptions.RightToLeft, "multiple words, yeah", "Pass. Group[0]=(0,14)");
+ yield return (@"(.*)c(.*)", RegexOptions.RightToLeft, "abcde", "Pass. Group[0]=(0,5) Group[1]=(0,2) Group[2]=(3,2)");
+ yield return (@"\((.*), (.*)\)", RegexOptions.RightToLeft, "(a, b)", "Pass. Group[0]=(0,6) Group[1]=(1,1) Group[2]=(4,1)");
+ yield return (@"[k]", RegexOptions.RightToLeft, "ab", "Fail.");
+ yield return (@"abcd", RegexOptions.RightToLeft, "abcd", "Pass. Group[0]=(0,4)");
+ yield return (@"a(bc)d", RegexOptions.RightToLeft, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,2)");
+ yield return (@"a[-]?c", RegexOptions.RightToLeft, "ac", "Pass. Group[0]=(0,2)");
+ yield return (@"(abc)\1", RegexOptions.RightToLeft, "abcabc", "Fail.");
+ yield return (@"\1(abc)", RegexOptions.RightToLeft, "abcabc", "Pass. Group[0]=(0,6) Group[1]=(3,3)");
+ yield return (@"([a-c]*)\1", RegexOptions.RightToLeft, "abcabc", "Fail.");
+ yield return (@"\1([a-c]*)", RegexOptions.RightToLeft, "abcabc", "Pass. Group[0]=(0,6) Group[1]=(3,3)");
+ yield return (@"(a)|\1", RegexOptions.RightToLeft, "a", "Pass. Group[0]=(0,1) Group[1]=(0,1)");
+ yield return (@"(a)|\1", RegexOptions.RightToLeft, "x", "Fail.");
+ yield return (@"(([a-c])b*?\2)*", RegexOptions.RightToLeft, "ababbbcbc", "Pass. Group[0]=(9,0) Group[1]= Group[2]=");
+ yield return (@"(([a-c])b*?\2){3}", RegexOptions.RightToLeft, "ababbbcbc", "Fail.");
+ yield return (@"((\3|b)\2(a)x)+", RegexOptions.RightToLeft, "aaxabxbaxbbx", "Fail.");
+ yield return (@"((\3|b)\2(a)x)+", RegexOptions.RightToLeft, "aaaxabaxbaaxbbax", "Fail.");
+ yield return (@"((\3|b)\2(a)){2,}", RegexOptions.RightToLeft, "bbaababbabaaaaabbaaaabba", "Fail.");
+
+ // Ported from https://github.com/mono/mono/blob/0f2995e95e98e082c7c7039e17175cf2c6a00034/mcs/class/System/Test/System.Text.RegularExpressions/RegexMatchTests.cs
+ yield return (@"(F)(2)(3)(4)(5)(6)(7)(8)(9)(10)(L)\11", RegexOptions.None, "F2345678910LL", "Pass. Group[0]=(0,13) Group[1]=(0,1) Group[2]=(1,1) Group[3]=(2,1) Group[4]=(3,1) Group[5]=(4,1) Group[6]=(5,1) Group[7]=(6,1) Group[8]=(7,1) Group[9]=(8,1) Group[10]=(9,2) Group[11]=(11,1)");
+ yield return (@"(F)(2)(3)(4)(5)(6)(7)(8)(9)(10)(L)\11", RegexOptions.ExplicitCapture, "F2345678910LL", "Fail.");
+ yield return (@"(F)(2)(3)(4)(5)(6)(?<S>7)(8)(9)(10)(L)\1", RegexOptions.None, "F2345678910L71", "Fail.");
+ yield return (@"(F)(2)(3)(4)(5)(6)(7)(8)(9)(10)(L)\11", RegexOptions.None, "F2345678910LF1", "Fail.");
+ yield return (@"(F)(2)(3)(4)(5)(6)(?<S>7)(8)(9)(10)(L)\11", RegexOptions.None, "F2345678910L71", "Pass. Group[0]=(0,13) Group[1]=(0,1) Group[2]=(1,1) Group[3]=(2,1) Group[4]=(3,1) Group[5]=(4,1) Group[6]=(5,1) Group[7]=(7,1) Group[8]=(8,1) Group[9]=(9,2) Group[10]=(11,1) Group[11]=(6,1)");
+ yield return (@"(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)\10", RegexOptions.None, "F2345678910L71", "Pass. Group[0]=(0,13) Group[1]=(0,1) Group[2]=(1,1) Group[3]=(2,1) Group[4]=(4,1) Group[5]=(5,1) Group[6]=(7,1) Group[7]=(8,1) Group[8]=(9,2) Group[9]=(11,1) Group[10]=(3,1)(6,1)");
+ yield return (@"(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)\10", RegexOptions.ExplicitCapture, "F2345678910L70", "Fail.");
+ yield return (@"(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)\1", RegexOptions.ExplicitCapture, "F2345678910L70", "Pass. Group[0]=(0,13) Group[1]=(3,1)(6,1)");
+ yield return (@"(?n:(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)\1)", RegexOptions.None, "F2345678910L70", "Pass. Group[0]=(0,13) Group[1]=(3,1)(6,1)");
+ yield return (@"(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)(?(10)\10)", RegexOptions.None, "F2345678910L70", "Pass. Group[0]=(0,13) Group[1]=(0,1) Group[2]=(1,1) Group[3]=(2,1) Group[4]=(4,1) Group[5]=(5,1) Group[6]=(7,1) Group[7]=(8,1) Group[8]=(9,2) Group[9]=(11,1) Group[10]=(3,1)(6,1)");
+ yield return (@"(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)(?(S)|\10)", RegexOptions.None, "F2345678910L70", "Pass. Group[0]=(0,12) Group[1]=(0,1) Group[2]=(1,1) Group[3]=(2,1) Group[4]=(4,1) Group[5]=(5,1) Group[6]=(7,1) Group[7]=(8,1) Group[8]=(9,2) Group[9]=(11,1) Group[10]=(3,1)(6,1)");
+ yield return (@"(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)(?(7)|\10)", RegexOptions.None, "F2345678910L70", "Pass. Group[0]=(0,12) Group[1]=(0,1) Group[2]=(1,1) Group[3]=(2,1) Group[4]=(4,1) Group[5]=(5,1) Group[6]=(7,1) Group[7]=(8,1) Group[8]=(9,2) Group[9]=(11,1) Group[10]=(3,1)(6,1)");
+ yield return (@"(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)(?(K)|\10)", RegexOptions.None, "F2345678910L70", "Pass. Group[0]=(0,13) Group[1]=(0,1) Group[2]=(1,1) Group[3]=(2,1) Group[4]=(4,1) Group[5]=(5,1) Group[6]=(7,1) Group[7]=(8,1) Group[8]=(9,2) Group[9]=(11,1) Group[10]=(3,1)(6,1)");
+ yield return (@"(?<=a+)(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)");
+ yield return (@"(?<=a*)(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(0,4)");
+ yield return (@"(?<=a{1,5})(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)");
+ yield return (@"(?<=a{1})(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)");
+ yield return (@"(?<=a{1,})(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)");
+ yield return (@"(?<=a+?)(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)");
+ yield return (@"(?<=a*?)(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(0,4)");
+ yield return (@"(?<=a{1,5}?)(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)");
+ yield return (@"(?<=a{1}?)(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)");
+ yield return (@"(?<!a+)(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(0,4)");
+ yield return (@"(?<!a*)(?:a)*bc", RegexOptions.None, "aabc", "Fail.");
+ yield return (@"abc*(?=c*)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,4)");
+ yield return (@"abc*(?=c+)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)");
+ yield return (@"abc*(?=c{1})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)");
+ yield return (@"abc*(?=c{1,5})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)");
+ yield return (@"abc*(?=c{1,})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)");
+ yield return (@"abc*(?=c*?)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,4)");
+ yield return (@"abc*(?=c+?)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)");
+ yield return (@"abc*(?=c{1}?)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)");
+ yield return (@"abc*(?=c{1,5}?)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)");
+ yield return (@"abc*(?=c{1,}?)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)");
+ yield return (@"abc*?(?=c*)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,2)");
+ yield return (@"abc*?(?=c+)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,2)");
+ yield return (@"abc*?(?=c{1})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,2)");
+ yield return (@"abc*?(?=c{1,5})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,2)");
+ yield return (@"abc*?(?=c{1,})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,2)");
+ yield return (@"abc*(?!c*)", RegexOptions.None, "abcc", "Fail.");
+ yield return (@"abc*(?!c+)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,4)");
+ yield return (@"abc*(?!c{1})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,4)");
+ yield return (@"abc*(?!c{1,5})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,4)");
+ yield return (@"abc*(?!c{1,})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,4)");
+ yield return (@"(?>a*).", RegexOptions.ExplicitCapture, "aaaa", "Fail.");
+ yield return (@"(?<ab>ab)c\1", RegexOptions.None, "abcabc", "Pass. Group[0]=(0,5) Group[1]=(0,2)");
}
}
}
- public static IEnumerable<object[]> RegexTestCases()
+ [Theory]
+ [InlineData(@"a[b-a]", RegexOptions.None)]
+ [InlineData(@"a[]b", RegexOptions.None)]
+ [InlineData(@"a[", RegexOptions.None)]
+ [InlineData(@"*a", RegexOptions.None)]
+ [InlineData(@"(*)b", RegexOptions.None)]
+ [InlineData(@"a\", RegexOptions.None)]
+ [InlineData(@"abc)", RegexOptions.None)]
+ [InlineData(@"(abc", RegexOptions.None)]
+ [InlineData(@"a**", RegexOptions.None)]
+ [InlineData(@")(", RegexOptions.None)]
+ [InlineData(@"\1", RegexOptions.None)]
+ [InlineData(@"\2", RegexOptions.None)]
+ [InlineData(@"(a)|\2", RegexOptions.None)]
+ [InlineData(@"a[b-a]", RegexOptions.IgnoreCase)]
+ [InlineData(@"a[]b", RegexOptions.IgnoreCase)]
+ [InlineData(@"a[", RegexOptions.IgnoreCase)]
+ [InlineData(@"*a", RegexOptions.IgnoreCase)]
+ [InlineData(@"(*)b", RegexOptions.IgnoreCase)]
+ [InlineData(@"a\", RegexOptions.IgnoreCase)]
+ [InlineData(@"abc)", RegexOptions.IgnoreCase)]
+ [InlineData(@"(abc", RegexOptions.IgnoreCase)]
+ [InlineData(@"a**", RegexOptions.IgnoreCase)]
+ [InlineData(@")(", RegexOptions.IgnoreCase)]
+ [InlineData(@":(?:", RegexOptions.None)]
+ [InlineData(@"(?<%)b", RegexOptions.None)]
+ [InlineData(@"(?(1)a|b|c)", RegexOptions.None)]
+ [InlineData(@"a{37,17}", RegexOptions.None)]
+ [InlineData(@"a[b-a]", RegexOptions.RightToLeft)]
+ [InlineData(@"a[]b", RegexOptions.RightToLeft)]
+ [InlineData(@"a[", RegexOptions.RightToLeft)]
+ [InlineData(@"*a", RegexOptions.RightToLeft)]
+ [InlineData(@"(*)b", RegexOptions.RightToLeft)]
+ [InlineData(@"a\", RegexOptions.RightToLeft)]
+ [InlineData(@"abc)", RegexOptions.RightToLeft)]
+ [InlineData(@"(abc", RegexOptions.RightToLeft)]
+ [InlineData(@"a**", RegexOptions.RightToLeft)]
+ [InlineData(@")(", RegexOptions.RightToLeft)]
+ [InlineData(@"\1", RegexOptions.RightToLeft)]
+ [InlineData(@"\2", RegexOptions.RightToLeft)]
+ [InlineData(@"(a)|\2", RegexOptions.RightToLeft)]
+ public void ParseFailures(string pattern, RegexOptions options)
{
- yield return new object[] { @"abc", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"abc", RegexOptions.None, "xbc", "Fail." };
- yield return new object[] { @"abc", RegexOptions.None, "axc", "Fail." };
- yield return new object[] { @"abc", RegexOptions.None, "abx", "Fail." };
- yield return new object[] { @"abc", RegexOptions.None, "xabcy", "Pass. Group[0]=(1,3)" };
- yield return new object[] { @"abc", RegexOptions.None, "ababc", "Pass. Group[0]=(2,3)" };
- yield return new object[] { @"ab*c", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"ab*bc", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"ab*bc", RegexOptions.None, "abbc", "Pass. Group[0]=(0,4)" };
- yield return new object[] { @"ab*bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)" };
- yield return new object[] { @".{1}", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @".{3,4}", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,4)" };
- yield return new object[] { @"ab{0,}bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)" };
- yield return new object[] { @"ab+bc", RegexOptions.None, "abbc", "Pass. Group[0]=(0,4)" };
- yield return new object[] { @"ab+bc", RegexOptions.None, "abc", "Fail." };
- yield return new object[] { @"ab+bc", RegexOptions.None, "abq", "Fail." };
- yield return new object[] { @"ab{1,}bc", RegexOptions.None, "abq", "Fail." };
- yield return new object[] { @"ab+bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)" };
- yield return new object[] { @"ab{1,}bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)" };
- yield return new object[] { @"ab{1,3}bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)" };
- yield return new object[] { @"ab{3,4}bc", RegexOptions.None, "abbbbc", "Pass. Group[0]=(0,6)" };
- yield return new object[] { @"ab{4,5}bc", RegexOptions.None, "abbbbc", "Fail." };
- yield return new object[] { @"ab?bc", RegexOptions.None, "abbc", "Pass. Group[0]=(0,4)" };
- yield return new object[] { @"ab?bc", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"ab{0,1}bc", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"ab?bc", RegexOptions.None, "abbbbc", "Fail." };
- yield return new object[] { @"ab?c", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"ab{0,1}c", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"^abc$", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"^abc$", RegexOptions.None, "abcc", "Fail." };
- yield return new object[] { @"^abc", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"^abc$", RegexOptions.None, "aabc", "Fail." };
- yield return new object[] { @"abc$", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)" };
- yield return new object[] { @"abc$", RegexOptions.None, "aabcd", "Fail." };
- yield return new object[] { @"^", RegexOptions.None, "abc", "Pass. Group[0]=(0,0)" };
- yield return new object[] { @"$", RegexOptions.None, "abc", "Pass. Group[0]=(3,0)" };
- yield return new object[] { @"a.c", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a.c", RegexOptions.None, "axc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a.*c", RegexOptions.None, "axyzc", "Pass. Group[0]=(0,5)" };
- yield return new object[] { @"a.*c", RegexOptions.None, "axyzd", "Fail." };
- yield return new object[] { @"a[bc]d", RegexOptions.None, "abc", "Fail." };
- yield return new object[] { @"a[bc]d", RegexOptions.None, "abd", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a[b-d]e", RegexOptions.None, "abd", "Fail." };
- yield return new object[] { @"a[b-d]e", RegexOptions.None, "ace", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a[b-d]", RegexOptions.None, "aac", "Pass. Group[0]=(1,2)" };
- yield return new object[] { @"a[-b]", RegexOptions.None, "a-", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"a[b-]", RegexOptions.None, "a-", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"a[b-a]", RegexOptions.None, "-", "Error." };
- yield return new object[] { @"a[]b", RegexOptions.None, "-", "Error." };
- yield return new object[] { @"a[", RegexOptions.None, "-", "Error." };
- yield return new object[] { @"a]", RegexOptions.None, "a]", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"a[]]b", RegexOptions.None, "a]b", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a[^bc]d", RegexOptions.None, "aed", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a[^bc]d", RegexOptions.None, "abd", "Fail." };
- yield return new object[] { @"a[^-b]c", RegexOptions.None, "adc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a[^-b]c", RegexOptions.None, "a-c", "Fail." };
- yield return new object[] { @"a[^]b]c", RegexOptions.None, "a]c", "Fail." };
- yield return new object[] { @"a[^]b]c", RegexOptions.None, "adc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"\ba\b", RegexOptions.None, "a-", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"\ba\b", RegexOptions.None, "-a", "Pass. Group[0]=(1,1)" };
- yield return new object[] { @"\ba\b", RegexOptions.None, "-a-", "Pass. Group[0]=(1,1)" };
- yield return new object[] { @"\by\b", RegexOptions.None, "xy", "Fail." };
- yield return new object[] { @"\by\b", RegexOptions.None, "yz", "Fail." };
- yield return new object[] { @"\by\b", RegexOptions.None, "xyz", "Fail." };
- yield return new object[] { @"\Ba\B", RegexOptions.None, "a-", "Fail." };
- yield return new object[] { @"\Ba\B", RegexOptions.None, "-a", "Fail." };
- yield return new object[] { @"\Ba\B", RegexOptions.None, "-a-", "Fail." };
- yield return new object[] { @"\By\b", RegexOptions.None, "xy", "Pass. Group[0]=(1,1)" };
- yield return new object[] { @"\by\B", RegexOptions.None, "yz", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"\By\B", RegexOptions.None, "xyz", "Pass. Group[0]=(1,1)" };
- yield return new object[] { @"\w", RegexOptions.None, "a", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"\w", RegexOptions.None, "-", "Fail." };
- yield return new object[] { @"\W", RegexOptions.None, "a", "Fail." };
- yield return new object[] { @"\W", RegexOptions.None, "-", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"a\sb", RegexOptions.None, "a b", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a\sb", RegexOptions.None, "a-b", "Fail." };
- yield return new object[] { @"a\Sb", RegexOptions.None, "a b", "Fail." };
- yield return new object[] { @"a\Sb", RegexOptions.None, "a-b", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"\d", RegexOptions.None, "1", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"\d", RegexOptions.None, "-", "Fail." };
- yield return new object[] { @"\D", RegexOptions.None, "1", "Fail." };
- yield return new object[] { @"\D", RegexOptions.None, "-", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"[\w]", RegexOptions.None, "a", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"[\w]", RegexOptions.None, "-", "Fail." };
- yield return new object[] { @"[\W]", RegexOptions.None, "a", "Fail." };
- yield return new object[] { @"[\W]", RegexOptions.None, "-", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"a[\s]b", RegexOptions.None, "a b", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a[\s]b", RegexOptions.None, "a-b", "Fail." };
- yield return new object[] { @"a[\S]b", RegexOptions.None, "a b", "Fail." };
- yield return new object[] { @"a[\S]b", RegexOptions.None, "a-b", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"[\d]", RegexOptions.None, "1", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"[\d]", RegexOptions.None, "-", "Fail." };
- yield return new object[] { @"[\D]", RegexOptions.None, "1", "Fail." };
- yield return new object[] { @"[\D]", RegexOptions.None, "-", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"ab|cd", RegexOptions.None, "abc", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"ab|cd", RegexOptions.None, "abcd", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"()ef", RegexOptions.None, "def", "Pass. Group[0]=(1,2) Group[1]=(1,0)" };
- yield return new object[] { @"*a", RegexOptions.None, "-", "Error." };
- yield return new object[] { @"(*)b", RegexOptions.None, "-", "Error." };
- yield return new object[] { @"$b", RegexOptions.None, "b", "Fail." };
- yield return new object[] { @"a\", RegexOptions.None, "-", "Error." };
- yield return new object[] { @"a\(b", RegexOptions.None, "a(b", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a\(*b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"a\(*b", RegexOptions.None, "a((b", "Pass. Group[0]=(0,4)" };
- yield return new object[] { @"a\\b", RegexOptions.None, "a\\b", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"abc)", RegexOptions.None, "-", "Error." };
- yield return new object[] { @"(abc", RegexOptions.None, "-", "Error." };
- yield return new object[] { @"((a))", RegexOptions.None, "abc", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1)" };
- yield return new object[] { @"(a)b(c)", RegexOptions.None, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(2,1)" };
- yield return new object[] { @"a+b+c", RegexOptions.None, "aabbabc", "Pass. Group[0]=(4,3)" };
- yield return new object[] { @"a{1,}b{1,}c", RegexOptions.None, "aabbabc", "Pass. Group[0]=(4,3)" };
- yield return new object[] { @"a**", RegexOptions.None, "-", "Error." };
- yield return new object[] { @"a.+?c", RegexOptions.None, "abcabc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"(a+|b)*", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)" };
- yield return new object[] { @"(a+|b){0,}", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)" };
- yield return new object[] { @"(a+|b)+", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)" };
- yield return new object[] { @"(a+|b){1,}", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)" };
- yield return new object[] { @"(a+|b)?", RegexOptions.None, "ab", "Pass. Group[0]=(0,1) Group[1]=(0,1)" };
- yield return new object[] { @"(a+|b){0,1}", RegexOptions.None, "ab", "Pass. Group[0]=(0,1) Group[1]=(0,1)" };
- yield return new object[] { @")(", RegexOptions.None, "-", "Error." };
- yield return new object[] { @"[^ab]*", RegexOptions.None, "cde", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"abc", RegexOptions.None, "", "Fail." };
- yield return new object[] { @"a*", RegexOptions.None, "", "Pass. Group[0]=(0,0)" };
- yield return new object[] { @"([abc])*d", RegexOptions.None, "abbbcd", "Pass. Group[0]=(0,6) Group[1]=(0,1)(1,1)(2,1)(3,1)(4,1)" };
- yield return new object[] { @"([abc])*bcd", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(0,1)" };
- yield return new object[] { @"a|b|c|d|e", RegexOptions.None, "e", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"(a|b|c|d|e)f", RegexOptions.None, "ef", "Pass. Group[0]=(0,2) Group[1]=(0,1)" };
- yield return new object[] { @"abcd*efg", RegexOptions.None, "abcdefg", "Pass. Group[0]=(0,7)" };
- yield return new object[] { @"ab*", RegexOptions.None, "xabyabbbz", "Pass. Group[0]=(1,2)" };
- yield return new object[] { @"ab*", RegexOptions.None, "xayabbbz", "Pass. Group[0]=(1,1)" };
- yield return new object[] { @"(ab|cd)e", RegexOptions.None, "abcde", "Pass. Group[0]=(2,3) Group[1]=(2,2)" };
- yield return new object[] { @"[abhgefdc]ij", RegexOptions.None, "hij", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"^(ab|cd)e", RegexOptions.None, "abcde", "Fail." };
- yield return new object[] { @"(abc|)ef", RegexOptions.None, "abcdef", "Pass. Group[0]=(4,2) Group[1]=(4,0)" };
- yield return new object[] { @"(a|b)c*d", RegexOptions.None, "abcd", "Pass. Group[0]=(1,3) Group[1]=(1,1)" };
- yield return new object[] { @"(ab|ab*)bc", RegexOptions.None, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,1)" };
- yield return new object[] { @"a([bc]*)c*", RegexOptions.None, "abc", "Pass. Group[0]=(0,3) Group[1]=(1,2)" };
- yield return new object[] { @"a([bc]*)(c*d)", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,2) Group[2]=(3,1)" };
- yield return new object[] { @"a([bc]+)(c*d)", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,2) Group[2]=(3,1)" };
- yield return new object[] { @"a([bc]*)(c+d)", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,1) Group[2]=(2,2)" };
- yield return new object[] { @"a[bcd]*dcdcde", RegexOptions.None, "adcdcde", "Pass. Group[0]=(0,7)" };
- yield return new object[] { @"a[bcd]+dcdcde", RegexOptions.None, "adcdcde", "Fail." };
- yield return new object[] { @"(ab|a)b*c", RegexOptions.None, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,2)" };
- yield return new object[] { @"((a)(b)c)(d)", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(0,3) Group[2]=(0,1) Group[3]=(1,1) Group[4]=(3,1)" };
- yield return new object[] { @"[a-zA-Z_][a-zA-Z0-9_]*", RegexOptions.None, "alpha", "Pass. Group[0]=(0,5)" };
- yield return new object[] { @"^a(bc+|b[eh])g|.h$", RegexOptions.None, "abh", "Pass. Group[0]=(1,2) Group[1]=" };
- yield return new object[] { @"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.None, "effgz", "Pass. Group[0]=(0,5) Group[1]=(0,5) Group[2]=" };
- yield return new object[] { @"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.None, "ij", "Pass. Group[0]=(0,2) Group[1]=(0,2) Group[2]=(1,1)" };
- yield return new object[] { @"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.None, "effg", "Fail." };
- yield return new object[] { @"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.None, "bcdd", "Fail." };
- yield return new object[] { @"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.None, "reffgz", "Pass. Group[0]=(1,5) Group[1]=(1,5) Group[2]=" };
- yield return new object[] { @"((((((((((a))))))))))", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)" };
- yield return new object[] { @"((((((((((a))))))))))\10", RegexOptions.None, "aa", "Pass. Group[0]=(0,2) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"((((((((((a))))))))))!", RegexOptions.None, "aa", "Fail." };
- yield return new object[] { @"((((((((((a))))))))))!", RegexOptions.None, "a!", "Pass. Group[0]=(0,2) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)" };
- yield return new object[] { @"(((((((((a)))))))))", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1)" };
- yield return new object[] { @"multiple words of text", RegexOptions.None, "uh-uh", "Fail." };
- yield return new object[] { @"multiple words", RegexOptions.None, "multiple words, yeah", "Pass. Group[0]=(0,14)" };
- yield return new object[] { @"(.*)c(.*)", RegexOptions.None, "abcde", "Pass. Group[0]=(0,5) Group[1]=(0,2) Group[2]=(3,2)" };
- yield return new object[] { @"\((.*), (.*)\)", RegexOptions.None, "(a, b)", "Pass. Group[0]=(0,6) Group[1]=(1,1) Group[2]=(4,1)" };
- yield return new object[] { @"[k]", RegexOptions.None, "ab", "Fail." };
- yield return new object[] { @"abcd", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4)" };
- yield return new object[] { @"a(bc)d", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,2)" };
- yield return new object[] { @"a[-]?c", RegexOptions.None, "ac", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"(abc)\1", RegexOptions.None, "abcabc", "Pass. Group[0]=(0,6) Group[1]=(0,3)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"([a-c]*)\1", RegexOptions.None, "abcabc", "Pass. Group[0]=(0,6) Group[1]=(0,3)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"\1", RegexOptions.None, "-", "Error." };
- yield return new object[] { @"\2", RegexOptions.None, "-", "Error." };
- yield return new object[] { @"(a)|\1", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]=(0,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(a)|\1", RegexOptions.None, "x", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(a)|\2", RegexOptions.None, "-", "Error." };
- yield return new object[] { @"(([a-c])b*?\2)*", RegexOptions.None, "ababbbcbc", "Pass. Group[0]=(0,5) Group[1]=(0,3)(3,2) Group[2]=(0,1)(3,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(([a-c])b*?\2){3}", RegexOptions.None, "ababbbcbc", "Pass. Group[0]=(0,9) Group[1]=(0,3)(3,3)(6,3) Group[2]=(0,1)(3,1)(6,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"((\3|b)\2(a)x)+", RegexOptions.None, "aaxabxbaxbbx", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"((\3|b)\2(a)x)+", RegexOptions.None, "aaaxabaxbaaxbbax", "Pass. Group[0]=(12,4) Group[1]=(12,4) Group[2]=(12,1) Group[3]=(14,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"((\3|b)\2(a)){2,}", RegexOptions.None, "bbaababbabaaaaabbaaaabba", "Pass. Group[0]=(15,9) Group[1]=(15,3)(18,3)(21,3) Group[2]=(15,1)(18,1)(21,1) Group[3]=(17,1)(20,1)(23,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"abc", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"abc", RegexOptions.IgnoreCase, "XBC", "Fail." };
- yield return new object[] { @"abc", RegexOptions.IgnoreCase, "AXC", "Fail." };
- yield return new object[] { @"abc", RegexOptions.IgnoreCase, "ABX", "Fail." };
- yield return new object[] { @"abc", RegexOptions.IgnoreCase, "XABCY", "Pass. Group[0]=(1,3)" };
- yield return new object[] { @"abc", RegexOptions.IgnoreCase, "ABABC", "Pass. Group[0]=(2,3)" };
- yield return new object[] { @"ab*c", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"ab*bc", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"ab*bc", RegexOptions.IgnoreCase, "ABBC", "Pass. Group[0]=(0,4)" };
- yield return new object[] { @"ab*?bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)" };
- yield return new object[] { @"ab{0,}?bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)" };
- yield return new object[] { @"ab+?bc", RegexOptions.IgnoreCase, "ABBC", "Pass. Group[0]=(0,4)" };
- yield return new object[] { @"ab+bc", RegexOptions.IgnoreCase, "ABC", "Fail." };
- yield return new object[] { @"ab+bc", RegexOptions.IgnoreCase, "ABQ", "Fail." };
- yield return new object[] { @"ab{1,}bc", RegexOptions.IgnoreCase, "ABQ", "Fail." };
- yield return new object[] { @"ab+bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)" };
- yield return new object[] { @"ab{1,}?bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)" };
- yield return new object[] { @"ab{1,3}?bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)" };
- yield return new object[] { @"ab{3,4}?bc", RegexOptions.IgnoreCase, "ABBBBC", "Pass. Group[0]=(0,6)" };
- yield return new object[] { @"ab{4,5}?bc", RegexOptions.IgnoreCase, "ABBBBC", "Fail." };
- yield return new object[] { @"ab??bc", RegexOptions.IgnoreCase, "ABBC", "Pass. Group[0]=(0,4)" };
- yield return new object[] { @"ab??bc", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"ab{0,1}?bc", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"ab??bc", RegexOptions.IgnoreCase, "ABBBBC", "Fail." };
- yield return new object[] { @"ab??c", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"ab{0,1}?c", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"^abc$", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"^abc$", RegexOptions.IgnoreCase, "ABCC", "Fail." };
- yield return new object[] { @"^abc", RegexOptions.IgnoreCase, "ABCC", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"^abc$", RegexOptions.IgnoreCase, "AABC", "Fail." };
- yield return new object[] { @"abc$", RegexOptions.IgnoreCase, "AABC", "Pass. Group[0]=(1,3)" };
- yield return new object[] { @"^", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,0)" };
- yield return new object[] { @"$", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(3,0)" };
- yield return new object[] { @"a.c", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a.c", RegexOptions.IgnoreCase, "AXC", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a.*?c", RegexOptions.IgnoreCase, "AXYZC", "Pass. Group[0]=(0,5)" };
- yield return new object[] { @"a.*c", RegexOptions.IgnoreCase, "AXYZD", "Fail." };
- yield return new object[] { @"a[bc]d", RegexOptions.IgnoreCase, "ABC", "Fail." };
- yield return new object[] { @"a[bc]d", RegexOptions.IgnoreCase, "ABD", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a[b-d]e", RegexOptions.IgnoreCase, "ABD", "Fail." };
- yield return new object[] { @"a[b-d]e", RegexOptions.IgnoreCase, "ACE", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a[b-d]", RegexOptions.IgnoreCase, "AAC", "Pass. Group[0]=(1,2)" };
- yield return new object[] { @"a[-b]", RegexOptions.IgnoreCase, "A-", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"a[b-]", RegexOptions.IgnoreCase, "A-", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"a[b-a]", RegexOptions.IgnoreCase, "-", "Error." };
- yield return new object[] { @"a[]b", RegexOptions.IgnoreCase, "-", "Error." };
- yield return new object[] { @"a[", RegexOptions.IgnoreCase, "-", "Error." };
- yield return new object[] { @"a]", RegexOptions.IgnoreCase, "A]", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"a[]]b", RegexOptions.IgnoreCase, "A]B", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a[^bc]d", RegexOptions.IgnoreCase, "AED", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a[^bc]d", RegexOptions.IgnoreCase, "ABD", "Fail." };
- yield return new object[] { @"a[^-b]c", RegexOptions.IgnoreCase, "ADC", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a[^-b]c", RegexOptions.IgnoreCase, "A-C", "Fail." };
- yield return new object[] { @"a[^]b]c", RegexOptions.IgnoreCase, "A]C", "Fail." };
- yield return new object[] { @"a[^]b]c", RegexOptions.IgnoreCase, "ADC", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"ab|cd", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"ab|cd", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"()ef", RegexOptions.IgnoreCase, "DEF", "Pass. Group[0]=(1,2) Group[1]=(1,0)" };
- yield return new object[] { @"*a", RegexOptions.IgnoreCase, "-", "Error." };
- yield return new object[] { @"(*)b", RegexOptions.IgnoreCase, "-", "Error." };
- yield return new object[] { @"$b", RegexOptions.IgnoreCase, "B", "Fail." };
- yield return new object[] { @"a\", RegexOptions.IgnoreCase, "-", "Error." };
- yield return new object[] { @"a\(b", RegexOptions.IgnoreCase, "A(B", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a\(*b", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"a\(*b", RegexOptions.IgnoreCase, "A((B", "Pass. Group[0]=(0,4)" };
- yield return new object[] { @"a\\b", RegexOptions.IgnoreCase, "A\\B", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"abc)", RegexOptions.IgnoreCase, "-", "Error." };
- yield return new object[] { @"(abc", RegexOptions.IgnoreCase, "-", "Error." };
- yield return new object[] { @"((a))", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1)" };
- yield return new object[] { @"(a)b(c)", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(2,1)" };
- yield return new object[] { @"a+b+c", RegexOptions.IgnoreCase, "AABBABC", "Pass. Group[0]=(4,3)" };
- yield return new object[] { @"a{1,}b{1,}c", RegexOptions.IgnoreCase, "AABBABC", "Pass. Group[0]=(4,3)" };
- yield return new object[] { @"a**", RegexOptions.IgnoreCase, "-", "Error." };
- yield return new object[] { @"a.+?c", RegexOptions.IgnoreCase, "ABCABC", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a.*?c", RegexOptions.IgnoreCase, "ABCABC", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a.{0,5}?c", RegexOptions.IgnoreCase, "ABCABC", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"(a+|b)*", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)" };
- yield return new object[] { @"(a+|b){0,}", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)" };
- yield return new object[] { @"(a+|b)+", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)" };
- yield return new object[] { @"(a+|b){1,}", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,2) Group[1]=(0,1)(1,1)" };
- yield return new object[] { @"(a+|b)?", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,1) Group[1]=(0,1)" };
- yield return new object[] { @"(a+|b){0,1}", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,1) Group[1]=(0,1)" };
- yield return new object[] { @"(a+|b){0,1}?", RegexOptions.IgnoreCase, "AB", "Pass. Group[0]=(0,0) Group[1]=" };
- yield return new object[] { @")(", RegexOptions.IgnoreCase, "-", "Error." };
- yield return new object[] { @"[^ab]*", RegexOptions.IgnoreCase, "CDE", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"abc", RegexOptions.IgnoreCase, "", "Fail." };
- yield return new object[] { @"a*", RegexOptions.IgnoreCase, "", "Pass. Group[0]=(0,0)" };
- yield return new object[] { @"([abc])*d", RegexOptions.IgnoreCase, "ABBBCD", "Pass. Group[0]=(0,6) Group[1]=(0,1)(1,1)(2,1)(3,1)(4,1)" };
- yield return new object[] { @"([abc])*bcd", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(0,1)" };
- yield return new object[] { @"a|b|c|d|e", RegexOptions.IgnoreCase, "E", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"(a|b|c|d|e)f", RegexOptions.IgnoreCase, "EF", "Pass. Group[0]=(0,2) Group[1]=(0,1)" };
- yield return new object[] { @"abcd*efg", RegexOptions.IgnoreCase, "ABCDEFG", "Pass. Group[0]=(0,7)" };
- yield return new object[] { @"ab*", RegexOptions.IgnoreCase, "XABYABBBZ", "Pass. Group[0]=(1,2)" };
- yield return new object[] { @"ab*", RegexOptions.IgnoreCase, "XAYABBBZ", "Pass. Group[0]=(1,1)" };
- yield return new object[] { @"(ab|cd)e", RegexOptions.IgnoreCase, "ABCDE", "Pass. Group[0]=(2,3) Group[1]=(2,2)" };
- yield return new object[] { @"[abhgefdc]ij", RegexOptions.IgnoreCase, "HIJ", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"^(ab|cd)e", RegexOptions.IgnoreCase, "ABCDE", "Fail." };
- yield return new object[] { @"(abc|)ef", RegexOptions.IgnoreCase, "ABCDEF", "Pass. Group[0]=(4,2) Group[1]=(4,0)" };
- yield return new object[] { @"(a|b)c*d", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(1,3) Group[1]=(1,1)" };
- yield return new object[] { @"(ab|ab*)bc", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3) Group[1]=(0,1)" };
- yield return new object[] { @"a([bc]*)c*", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3) Group[1]=(1,2)" };
- yield return new object[] { @"a([bc]*)(c*d)", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(1,2) Group[2]=(3,1)" };
- yield return new object[] { @"a([bc]+)(c*d)", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(1,2) Group[2]=(3,1)" };
- yield return new object[] { @"a([bc]*)(c+d)", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(1,1) Group[2]=(2,2)" };
- yield return new object[] { @"a[bcd]*dcdcde", RegexOptions.IgnoreCase, "ADCDCDE", "Pass. Group[0]=(0,7)" };
- yield return new object[] { @"a[bcd]+dcdcde", RegexOptions.IgnoreCase, "ADCDCDE", "Fail." };
- yield return new object[] { @"(ab|a)b*c", RegexOptions.IgnoreCase, "ABC", "Pass. Group[0]=(0,3) Group[1]=(0,2)" };
- yield return new object[] { @"((a)(b)c)(d)", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(0,3) Group[2]=(0,1) Group[3]=(1,1) Group[4]=(3,1)" };
- yield return new object[] { @"[a-zA-Z_][a-zA-Z0-9_]*", RegexOptions.IgnoreCase, "ALPHA", "Pass. Group[0]=(0,5)" };
- yield return new object[] { @"^a(bc+|b[eh])g|.h$", RegexOptions.IgnoreCase, "ABH", "Pass. Group[0]=(1,2) Group[1]=" };
- yield return new object[] { @"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.IgnoreCase, "EFFGZ", "Pass. Group[0]=(0,5) Group[1]=(0,5) Group[2]=" };
- yield return new object[] { @"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.IgnoreCase, "IJ", "Pass. Group[0]=(0,2) Group[1]=(0,2) Group[2]=(1,1)" };
- yield return new object[] { @"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.IgnoreCase, "EFFG", "Fail." };
- yield return new object[] { @"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.IgnoreCase, "BCDD", "Fail." };
- yield return new object[] { @"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.IgnoreCase, "REFFGZ", "Pass. Group[0]=(1,5) Group[1]=(1,5) Group[2]=" };
- yield return new object[] { @"((((((((((a))))))))))", RegexOptions.IgnoreCase, "A", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)" };
- yield return new object[] { @"((((((((((a))))))))))\10", RegexOptions.IgnoreCase, "AA", "Pass. Group[0]=(0,2) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"((((((((((a))))))))))!", RegexOptions.IgnoreCase, "AA", "Fail." };
- yield return new object[] { @"((((((((((a))))))))))!", RegexOptions.IgnoreCase, "A!", "Pass. Group[0]=(0,2) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)" };
- yield return new object[] { @"(((((((((a)))))))))", RegexOptions.IgnoreCase, "A", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1)" };
- yield return new object[] { @"(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))", RegexOptions.IgnoreCase, "A", "Pass. Group[0]=(0,1) Group[1]=(0,1)" };
- yield return new object[] { @"(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))", RegexOptions.IgnoreCase, "C", "Pass. Group[0]=(0,1) Group[1]=(0,1)" };
- yield return new object[] { @"multiple words of text", RegexOptions.IgnoreCase, "UH-UH", "Fail." };
- yield return new object[] { @"multiple words", RegexOptions.IgnoreCase, "MULTIPLE WORDS, YEAH", "Pass. Group[0]=(0,14)" };
- yield return new object[] { @"(.*)c(.*)", RegexOptions.IgnoreCase, "ABCDE", "Pass. Group[0]=(0,5) Group[1]=(0,2) Group[2]=(3,2)" };
- yield return new object[] { @"\((.*), (.*)\)", RegexOptions.IgnoreCase, "(A, B)", "Pass. Group[0]=(0,6) Group[1]=(1,1) Group[2]=(4,1)" };
- yield return new object[] { @"[k]", RegexOptions.IgnoreCase, "AB", "Fail." };
- yield return new object[] { @"abcd", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4)" };
- yield return new object[] { @"a(bc)d", RegexOptions.IgnoreCase, "ABCD", "Pass. Group[0]=(0,4) Group[1]=(1,2)" };
- yield return new object[] { @"a[-]?c", RegexOptions.IgnoreCase, "AC", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"(abc)\1", RegexOptions.IgnoreCase, "ABCABC", "Pass. Group[0]=(0,6) Group[1]=(0,3)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"([a-c]*)\1", RegexOptions.IgnoreCase, "ABCABC", "Pass. Group[0]=(0,6) Group[1]=(0,3)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"a(?!b).", RegexOptions.None, "abad", "Pass. Group[0]=(2,2)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"a(?=d).", RegexOptions.None, "abad", "Pass. Group[0]=(2,2)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"a(?=c|d).", RegexOptions.None, "abad", "Pass. Group[0]=(2,2)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"a(?:b|c|d)(.)", RegexOptions.None, "ace", "Pass. Group[0]=(0,3) Group[1]=(2,1)" };
- yield return new object[] { @"a(?:b|c|d)*(.)", RegexOptions.None, "ace", "Pass. Group[0]=(0,3) Group[1]=(2,1)" };
- yield return new object[] { @"a(?:b|c|d)+?(.)", RegexOptions.None, "ace", "Pass. Group[0]=(0,3) Group[1]=(2,1)" };
- yield return new object[] { @"a(?:b|c|d)+?(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,3) Group[1]=(2,1)" };
- yield return new object[] { @"a(?:b|c|d)+(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,8) Group[1]=(7,1)" };
- yield return new object[] { @"a(?:b|c|d){2}(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,4) Group[1]=(3,1)" };
- yield return new object[] { @"a(?:b|c|d){4,5}(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,7) Group[1]=(6,1)" };
- yield return new object[] { @"a(?:b|c|d){4,5}?(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,6) Group[1]=(5,1)" };
- yield return new object[] { @"((foo)|(bar))*", RegexOptions.None, "foobar", "Pass. Group[0]=(0,6) Group[1]=(0,3)(3,3) Group[2]=(0,3) Group[3]=(3,3)" };
- yield return new object[] { @":(?:", RegexOptions.None, "-", "Error." };
- yield return new object[] { @"a(?:b|c|d){6,7}(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,8) Group[1]=(7,1)" };
- yield return new object[] { @"a(?:b|c|d){6,7}?(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,8) Group[1]=(7,1)" };
- yield return new object[] { @"a(?:b|c|d){5,6}(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,8) Group[1]=(7,1)" };
- yield return new object[] { @"a(?:b|c|d){5,6}?(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,7) Group[1]=(6,1)" };
- yield return new object[] { @"a(?:b|c|d){5,7}(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,8) Group[1]=(7,1)" };
- yield return new object[] { @"a(?:b|c|d){5,7}?(.)", RegexOptions.None, "acdbcdbe", "Pass. Group[0]=(0,7) Group[1]=(6,1)" };
- yield return new object[] { @"a(?:b|(c|e){1,2}?|d)+?(.)", RegexOptions.None, "ace", "Pass. Group[0]=(0,3) Group[1]=(1,1) Group[2]=(2,1)" };
- yield return new object[] { @"^(.+)?B", RegexOptions.None, "AB", "Pass. Group[0]=(0,2) Group[1]=(0,1)" };
- yield return new object[] { @"^([^a-z])|(\^)$", RegexOptions.None, ".", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=" };
- yield return new object[] { @"^[<>]&", RegexOptions.None, "<&OUT", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"^(a\1?){4}$", RegexOptions.None, "aaaaaaaaaa", "Pass. Group[0]=(0,10) Group[1]=(0,1)(1,2)(3,3)(6,4)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(a\1?){4}$", RegexOptions.None, "aaaaaaaaa", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(a\1?){4}$", RegexOptions.None, "aaaaaaaaaaa", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(a(?(1)\1)){4}$", RegexOptions.None, "aaaaaaaaaa", "Pass. Group[0]=(0,10) Group[1]=(0,1)(1,2)(3,3)(6,4)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(a(?(1)\1)){4}$", RegexOptions.None, "aaaaaaaaa", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(a(?(1)\1)){4}$", RegexOptions.None, "aaaaaaaaaaa", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"((a{4})+)", RegexOptions.None, "aaaaaaaaa", "Pass. Group[0]=(0,8) Group[1]=(0,8) Group[2]=(0,4)(4,4)" };
- yield return new object[] { @"(((aa){2})+)", RegexOptions.None, "aaaaaaaaaa", "Pass. Group[0]=(0,8) Group[1]=(0,8) Group[2]=(0,4)(4,4) Group[3]=(0,2)(2,2)(4,2)(6,2)" };
- yield return new object[] { @"(((a{2}){2})+)", RegexOptions.None, "aaaaaaaaaa", "Pass. Group[0]=(0,8) Group[1]=(0,8) Group[2]=(0,4)(4,4) Group[3]=(0,2)(2,2)(4,2)(6,2)" };
- yield return new object[] { @"(?:(f)(o)(o)|(b)(a)(r))*", RegexOptions.None, "foobar", "Pass. Group[0]=(0,6) Group[1]=(0,1) Group[2]=(1,1) Group[3]=(2,1) Group[4]=(3,1) Group[5]=(4,1) Group[6]=(5,1)" };
- yield return new object[] { @"(?<=a)b", RegexOptions.None, "ab", "Pass. Group[0]=(1,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?<=a)b", RegexOptions.None, "cb", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?<=a)b", RegexOptions.None, "b", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?<!c)b", RegexOptions.None, "ab", "Pass. Group[0]=(1,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?<!c)b", RegexOptions.None, "cb", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?<!c)b", RegexOptions.None, "b", "Pass. Group[0]=(0,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?<%)b", RegexOptions.None, "-", "Error." };
- yield return new object[] { @"(?:..)*a", RegexOptions.None, "aba", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"(?:..)*?a", RegexOptions.None, "aba", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"^(?:b|a(?=(.)))*\1", RegexOptions.None, "abc", "Pass. Group[0]=(0,2) Group[1]=(1,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(){3,5}", RegexOptions.None, "abc", "Pass. Group[0]=(0,0) Group[1]=(0,0)(0,0)(0,0)" };
- yield return new object[] { @"^(a+)*ax", RegexOptions.None, "aax", "Pass. Group[0]=(0,3) Group[1]=(0,1)" };
- yield return new object[] { @"^((a|b)+)*ax", RegexOptions.None, "aax", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(0,1)" };
- yield return new object[] { @"^((a|bc)+)*ax", RegexOptions.None, "aax", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(0,1)" };
- yield return new object[] { @"(a|x)*ab", RegexOptions.None, "cab", "Pass. Group[0]=(1,2) Group[1]=" };
- yield return new object[] { @"(a)*ab", RegexOptions.None, "cab", "Pass. Group[0]=(1,2) Group[1]=" };
- yield return new object[] { @"(?:(?i)a)b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"((?i)a)b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)" };
- yield return new object[] { @"(?:(?i)a)b", RegexOptions.None, "Ab", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"((?i)a)b", RegexOptions.None, "Ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)" };
- yield return new object[] { @"(?:(?i)a)b", RegexOptions.None, "aB", "Fail." };
- yield return new object[] { @"((?i)a)b", RegexOptions.None, "aB", "Fail." };
- yield return new object[] { @"(?i:a)b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"((?i:a))b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)" };
- yield return new object[] { @"(?i:a)b", RegexOptions.None, "Ab", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"((?i:a))b", RegexOptions.None, "Ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)" };
- yield return new object[] { @"(?i:a)b", RegexOptions.None, "aB", "Fail." };
- yield return new object[] { @"((?i:a))b", RegexOptions.None, "aB", "Fail." };
- yield return new object[] { @"(?:(?-i)a)b", RegexOptions.IgnoreCase, "ab", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"((?-i)a)b", RegexOptions.IgnoreCase, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)" };
- yield return new object[] { @"((?-i)a)b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2) Group[1]=(0,1)" };
- yield return new object[] { @"(?:(?-i)a)b", RegexOptions.IgnoreCase, "Ab", "Fail." };
- yield return new object[] { @"((?-i)a)b", RegexOptions.IgnoreCase, "Ab", "Fail." };
- yield return new object[] { @"(?:(?-i)a)b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"(?:(?-i)a)b", RegexOptions.IgnoreCase, "AB", "Fail." };
- yield return new object[] { @"((?-i)a)b", RegexOptions.IgnoreCase, "AB", "Fail." };
- yield return new object[] { @"(?-i:a)b", RegexOptions.IgnoreCase, "ab", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"((?-i:a))b", RegexOptions.IgnoreCase, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)" };
- yield return new object[] { @"(?-i:a)b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"((?-i:a))b", RegexOptions.IgnoreCase, "aB", "Pass. Group[0]=(0,2) Group[1]=(0,1)" };
- yield return new object[] { @"(?-i:a)b", RegexOptions.IgnoreCase, "Ab", "Fail." };
- yield return new object[] { @"((?-i:a))b", RegexOptions.IgnoreCase, "Ab", "Fail." };
- yield return new object[] { @"(?-i:a)b", RegexOptions.IgnoreCase, "AB", "Fail." };
- yield return new object[] { @"((?-i:a))b", RegexOptions.IgnoreCase, "AB", "Fail." };
- yield return new object[] { @"((?-i:a.))b", RegexOptions.IgnoreCase, "a\nB", "Fail." };
- yield return new object[] { @"((?s-i:a.))b", RegexOptions.IgnoreCase, "a\nB", "Pass. Group[0]=(0,3) Group[1]=(0,2)" };
- yield return new object[] { @"((?s-i:a.))b", RegexOptions.IgnoreCase, "B\nB", "Fail." };
- yield return new object[] { @"(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))", RegexOptions.None, "cabbbb", "Pass. Group[0]=(0,6)" };
- yield return new object[] { @"(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))", RegexOptions.None, "caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "Pass. Group[0]=(0,41)" };
- yield return new object[] { @"(ab)\d\1", RegexOptions.IgnoreCase, "Ab4ab", "Pass. Group[0]=(0,5) Group[1]=(0,2)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(ab)\d\1", RegexOptions.IgnoreCase, "ab4Ab", "Pass. Group[0]=(0,5) Group[1]=(0,2)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"foo\w*\d{4}baz", RegexOptions.None, "foobar1234baz", "Pass. Group[0]=(0,13)" };
- yield return new object[] { @"x(~~)*(?:(?:F)?)?", RegexOptions.None, "x~~", "Pass. Group[0]=(0,3) Group[1]=(1,2)" };
- yield return new object[] { @"^a(?#xxx){3}c", RegexOptions.None, "aaac", "Pass. Group[0]=(0,4)" };
- yield return new object[] { @"(?<![cd])b", RegexOptions.None, "dbcb", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?<![cd])[ab]", RegexOptions.None, "dbaacb", "Pass. Group[0]=(2,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?<!(c|d))b", RegexOptions.None, "dbcb", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?<!(c|d))[ab]", RegexOptions.None, "dbaacb", "Pass. Group[0]=(2,1) Group[1]=", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?<!cd)[ab]", RegexOptions.None, "cdaccb", "Pass. Group[0]=(5,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(?:a?b?)*$", RegexOptions.None, "a--", "Fail." };
- yield return new object[] { @"((?s)^a(.))((?m)^b$)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(0,3) Group[1]=(0,2) Group[2]=(1,1) Group[3]=(2,1)" };
- yield return new object[] { @"((?m)^b$)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(2,1) Group[1]=(2,1)" };
- yield return new object[] { @"(?m)^b", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(2,1)" };
- yield return new object[] { @"(?m)^(b)", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(2,1) Group[1]=(2,1)" };
- yield return new object[] { @"((?m)^b)", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(2,1) Group[1]=(2,1)" };
- yield return new object[] { @"\n((?m)^b)", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(1,2) Group[1]=(2,1)" };
- yield return new object[] { @"((?s).)c(?!.)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(3,2) Group[1]=(3,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"((?s)b.)c(?!.)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(2,3) Group[1]=(2,2)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^b", RegexOptions.None, "a\nb\nc\n", "Fail." };
- yield return new object[] { @"()^b", RegexOptions.None, "a\nb\nc\n", "Fail." };
- yield return new object[] { @"((?m)^b)", RegexOptions.None, "a\nb\nc\n", "Pass. Group[0]=(2,1) Group[1]=(2,1)" };
- yield return new object[] { @"(x)?(?(1)a|b)", RegexOptions.None, "a", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(x)?(?(1)b|a)", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]=", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"()?(?(1)b|a)", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]=", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"()(?(1)b|a)", RegexOptions.None, "a", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"()?(?(1)a|b)", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]=(0,0)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(\()?blah(?(1)(\)))$", RegexOptions.None, "(blah)", "Pass. Group[0]=(0,6) Group[1]=(0,1) Group[2]=(5,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(\()?blah(?(1)(\)))$", RegexOptions.None, "blah", "Pass. Group[0]=(0,4) Group[1]= Group[2]=", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(\()?blah(?(1)(\)))$", RegexOptions.None, "blah)", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(\()?blah(?(1)(\)))$", RegexOptions.None, "(blah", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(\(+)?blah(?(1)(\)))$", RegexOptions.None, "(blah)", "Pass. Group[0]=(0,6) Group[1]=(0,1) Group[2]=(5,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(\(+)?blah(?(1)(\)))$", RegexOptions.None, "blah", "Pass. Group[0]=(0,4) Group[1]= Group[2]=", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(\(+)?blah(?(1)(\)))$", RegexOptions.None, "blah)", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(\(+)?blah(?(1)(\)))$", RegexOptions.None, "(blah", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?(1)a|b|c)", RegexOptions.None, "a", "Error." };
- yield return new object[] { @"(?(?!a)a|b)", RegexOptions.None, "a", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?(?!a)b|a)", RegexOptions.None, "a", "Pass. Group[0]=(0,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?(?=a)b|a)", RegexOptions.None, "a", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?(?=a)a|b)", RegexOptions.None, "a", "Pass. Group[0]=(0,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?=(a+?))(\1ab)", RegexOptions.None, "aaab", "Pass. Group[0]=(1,3) Group[1]=(1,1) Group[2]=(1,3)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(?=(a+?))\1ab", RegexOptions.None, "aaab", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(\w+:)+", RegexOptions.None, "one:", "Pass. Group[0]=(0,4) Group[1]=(0,4)" };
- yield return new object[] { @"$(?<=^(a))", RegexOptions.None, "a", "Pass. Group[0]=(1,0) Group[1]=(0,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"([\w:]+::)?(\w+)$", RegexOptions.None, "abcd:", "Fail." };
- yield return new object[] { @"([\w:]+::)?(\w+)$", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]= Group[2]=(0,4)" };
- yield return new object[] { @"([\w:]+::)?(\w+)$", RegexOptions.None, "xy:z:::abcd", "Pass. Group[0]=(0,11) Group[1]=(0,7) Group[2]=(7,4)" };
- yield return new object[] { @"^[^bcd]*(c+)", RegexOptions.None, "aexycd", "Pass. Group[0]=(0,5) Group[1]=(4,1)" };
- yield return new object[] { @"(a*)b+", RegexOptions.None, "caab", "Pass. Group[0]=(1,3) Group[1]=(1,2)" };
- yield return new object[] { @"(>a+)ab", RegexOptions.None, "aaab", "Fail." };
- yield return new object[] { @"(?>a+)b", RegexOptions.None, "aaab", "Pass. Group[0]=(0,4)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"([[:]+)", RegexOptions.None, "a:[b]:", "Pass. Group[0]=(1,2) Group[1]=(1,2)" };
- yield return new object[] { @"([[=]+)", RegexOptions.None, "a=[b]=", "Pass. Group[0]=(1,2) Group[1]=(1,2)" };
- yield return new object[] { @"([[.]+)", RegexOptions.None, "a.[b].", "Pass. Group[0]=(1,2) Group[1]=(1,2)" };
- yield return new object[] { @"[a[:]b[:c]", RegexOptions.None, "abc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"((?>a+)b)", RegexOptions.None, "aaab", "Pass. Group[0]=(0,4) Group[1]=(0,4)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?>(a+))b", RegexOptions.None, "aaab", "Pass. Group[0]=(0,4) Group[1]=(0,3)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"((?>[^()]+)|\([^()]*\))+", RegexOptions.None, "((abc(ade)ufh()()x", "Pass. Group[0]=(2,16) Group[1]=(2,3)(5,5)(10,3)(13,2)(15,2)(17,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?<=x+)", RegexOptions.None, "xxxxy", "Pass. Group[0]=(1,0)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"a{37,17}", RegexOptions.None, "-", "Error." };
- yield return new object[] { @"\Z", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(3,0)" };
- yield return new object[] { @"\z", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(4,0)" };
- yield return new object[] { @"$", RegexOptions.None, "a\nb\n", "Pass. Group[0]=(3,0)" };
- yield return new object[] { @"\Z", RegexOptions.None, "b\na\n", "Pass. Group[0]=(3,0)" };
- yield return new object[] { @"\z", RegexOptions.None, "b\na\n", "Pass. Group[0]=(4,0)" };
- yield return new object[] { @"$", RegexOptions.None, "b\na\n", "Pass. Group[0]=(3,0)" };
- yield return new object[] { @"\Z", RegexOptions.None, "b\na", "Pass. Group[0]=(3,0)" };
- yield return new object[] { @"\z", RegexOptions.None, "b\na", "Pass. Group[0]=(3,0)" };
- yield return new object[] { @"$", RegexOptions.None, "b\na", "Pass. Group[0]=(3,0)" };
- yield return new object[] { @"\Z", RegexOptions.Multiline, "a\nb\n", "Pass. Group[0]=(3,0)" };
- yield return new object[] { @"\z", RegexOptions.Multiline, "a\nb\n", "Pass. Group[0]=(4,0)" };
- yield return new object[] { @"$", RegexOptions.Multiline, "a\nb\n", "Pass. Group[0]=(1,0)" };
- yield return new object[] { @"\Z", RegexOptions.Multiline, "b\na\n", "Pass. Group[0]=(3,0)" };
- yield return new object[] { @"\z", RegexOptions.Multiline, "b\na\n", "Pass. Group[0]=(4,0)" };
- yield return new object[] { @"$", RegexOptions.Multiline, "b\na\n", "Pass. Group[0]=(1,0)" };
- yield return new object[] { @"\Z", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(3,0)" };
- yield return new object[] { @"\z", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(3,0)" };
- yield return new object[] { @"$", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(1,0)" };
- yield return new object[] { @"a\Z", RegexOptions.None, "a\nb\n", "Fail." };
- yield return new object[] { @"a\z", RegexOptions.None, "a\nb\n", "Fail." };
- yield return new object[] { @"a$", RegexOptions.None, "a\nb\n", "Fail." };
- yield return new object[] { @"a\Z", RegexOptions.None, "b\na\n", "Pass. Group[0]=(2,1)" };
- yield return new object[] { @"a\z", RegexOptions.None, "b\na\n", "Fail." };
- yield return new object[] { @"a$", RegexOptions.None, "b\na\n", "Pass. Group[0]=(2,1)" };
- yield return new object[] { @"a\Z", RegexOptions.None, "b\na", "Pass. Group[0]=(2,1)" };
- yield return new object[] { @"a\z", RegexOptions.None, "b\na", "Pass. Group[0]=(2,1)" };
- yield return new object[] { @"a$", RegexOptions.None, "b\na", "Pass. Group[0]=(2,1)" };
- yield return new object[] { @"a\z", RegexOptions.Multiline, "a\nb\n", "Fail." };
- yield return new object[] { @"a$", RegexOptions.Multiline, "a\nb\n", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"a\Z", RegexOptions.Multiline, "b\na\n", "Pass. Group[0]=(2,1)" };
- yield return new object[] { @"a\z", RegexOptions.Multiline, "b\na\n", "Fail." };
- yield return new object[] { @"a$", RegexOptions.Multiline, "b\na\n", "Pass. Group[0]=(2,1)" };
- yield return new object[] { @"a\Z", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(2,1)" };
- yield return new object[] { @"a\z", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(2,1)" };
- yield return new object[] { @"a$", RegexOptions.Multiline, "b\na", "Pass. Group[0]=(2,1)" };
- yield return new object[] { @"aa\Z", RegexOptions.None, "aa\nb\n", "Fail." };
- yield return new object[] { @"aa\z", RegexOptions.None, "aa\nb\n", "Fail." };
- yield return new object[] { @"aa$", RegexOptions.None, "aa\nb\n", "Fail." };
- yield return new object[] { @"aa\Z", RegexOptions.None, "b\naa\n", "Pass. Group[0]=(2,2)" };
- yield return new object[] { @"aa\z", RegexOptions.None, "b\naa\n", "Fail." };
- yield return new object[] { @"aa$", RegexOptions.None, "b\naa\n", "Pass. Group[0]=(2,2)" };
- yield return new object[] { @"aa\Z", RegexOptions.None, "b\naa", "Pass. Group[0]=(2,2)" };
- yield return new object[] { @"aa\z", RegexOptions.None, "b\naa", "Pass. Group[0]=(2,2)" };
- yield return new object[] { @"aa$", RegexOptions.None, "b\naa", "Pass. Group[0]=(2,2)" };
- yield return new object[] { @"aa\z", RegexOptions.Multiline, "aa\nb\n", "Fail." };
- yield return new object[] { @"aa$", RegexOptions.Multiline, "aa\nb\n", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"aa\Z", RegexOptions.Multiline, "b\naa\n", "Pass. Group[0]=(2,2)" };
- yield return new object[] { @"aa\z", RegexOptions.Multiline, "b\naa\n", "Fail." };
- yield return new object[] { @"aa$", RegexOptions.Multiline, "b\naa\n", "Pass. Group[0]=(2,2)" };
- yield return new object[] { @"aa\Z", RegexOptions.Multiline, "b\naa", "Pass. Group[0]=(2,2)" };
- yield return new object[] { @"aa\z", RegexOptions.Multiline, "b\naa", "Pass. Group[0]=(2,2)" };
- yield return new object[] { @"aa$", RegexOptions.Multiline, "b\naa", "Pass. Group[0]=(2,2)" };
- yield return new object[] { @"aa\Z", RegexOptions.None, "ac\nb\n", "Fail." };
- yield return new object[] { @"aa\z", RegexOptions.None, "ac\nb\n", "Fail." };
- yield return new object[] { @"aa$", RegexOptions.None, "ac\nb\n", "Fail." };
- yield return new object[] { @"aa\Z", RegexOptions.None, "b\nac\n", "Fail." };
- yield return new object[] { @"aa\z", RegexOptions.None, "b\nac\n", "Fail." };
- yield return new object[] { @"aa$", RegexOptions.None, "b\nac\n", "Fail." };
- yield return new object[] { @"aa\Z", RegexOptions.None, "b\nac", "Fail." };
- yield return new object[] { @"aa\z", RegexOptions.None, "b\nac", "Fail." };
- yield return new object[] { @"aa$", RegexOptions.None, "b\nac", "Fail." };
- yield return new object[] { @"aa\Z", RegexOptions.Multiline, "ac\nb\n", "Fail." };
- yield return new object[] { @"aa\z", RegexOptions.Multiline, "ac\nb\n", "Fail." };
- yield return new object[] { @"aa$", RegexOptions.Multiline, "ac\nb\n", "Fail." };
- yield return new object[] { @"aa\Z", RegexOptions.Multiline, "b\nac\n", "Fail." };
- yield return new object[] { @"aa\z", RegexOptions.Multiline, "b\nac\n", "Fail." };
- yield return new object[] { @"aa$", RegexOptions.Multiline, "b\nac\n", "Fail." };
- yield return new object[] { @"aa\Z", RegexOptions.Multiline, "b\nac", "Fail." };
- yield return new object[] { @"aa\z", RegexOptions.Multiline, "b\nac", "Fail." };
- yield return new object[] { @"aa$", RegexOptions.Multiline, "b\nac", "Fail." };
- yield return new object[] { @"aa\Z", RegexOptions.None, "ca\nb\n", "Fail." };
- yield return new object[] { @"aa\z", RegexOptions.None, "ca\nb\n", "Fail." };
- yield return new object[] { @"aa$", RegexOptions.None, "ca\nb\n", "Fail." };
- yield return new object[] { @"aa\Z", RegexOptions.None, "b\nca\n", "Fail." };
- yield return new object[] { @"aa\z", RegexOptions.None, "b\nca\n", "Fail." };
- yield return new object[] { @"aa$", RegexOptions.None, "b\nca\n", "Fail." };
- yield return new object[] { @"aa\Z", RegexOptions.None, "b\nca", "Fail." };
- yield return new object[] { @"aa\z", RegexOptions.None, "b\nca", "Fail." };
- yield return new object[] { @"aa$", RegexOptions.None, "b\nca", "Fail." };
- yield return new object[] { @"aa\Z", RegexOptions.Multiline, "ca\nb\n", "Fail." };
- yield return new object[] { @"aa\z", RegexOptions.Multiline, "ca\nb\n", "Fail." };
- yield return new object[] { @"aa$", RegexOptions.Multiline, "ca\nb\n", "Fail." };
- yield return new object[] { @"aa\Z", RegexOptions.Multiline, "b\nca\n", "Fail." };
- yield return new object[] { @"aa\z", RegexOptions.Multiline, "b\nca\n", "Fail." };
- yield return new object[] { @"aa$", RegexOptions.Multiline, "b\nca\n", "Fail." };
- yield return new object[] { @"aa\Z", RegexOptions.Multiline, "b\nca", "Fail." };
- yield return new object[] { @"aa\z", RegexOptions.Multiline, "b\nca", "Fail." };
- yield return new object[] { @"aa$", RegexOptions.Multiline, "b\nca", "Fail." };
- yield return new object[] { @"ab\Z", RegexOptions.None, "ab\nb\n", "Fail." };
- yield return new object[] { @"ab\z", RegexOptions.None, "ab\nb\n", "Fail." };
- yield return new object[] { @"ab$", RegexOptions.None, "ab\nb\n", "Fail." };
- yield return new object[] { @"ab\Z", RegexOptions.None, "b\nab\n", "Pass. Group[0]=(2,2)" };
- yield return new object[] { @"ab\z", RegexOptions.None, "b\nab\n", "Fail." };
- yield return new object[] { @"ab$", RegexOptions.None, "b\nab\n", "Pass. Group[0]=(2,2)" };
- yield return new object[] { @"ab\Z", RegexOptions.None, "b\nab", "Pass. Group[0]=(2,2)" };
- yield return new object[] { @"ab\z", RegexOptions.None, "b\nab", "Pass. Group[0]=(2,2)" };
- yield return new object[] { @"ab$", RegexOptions.None, "b\nab", "Pass. Group[0]=(2,2)" };
- yield return new object[] { @"ab\z", RegexOptions.Multiline, "ab\nb\n", "Fail." };
- yield return new object[] { @"ab$", RegexOptions.Multiline, "ab\nb\n", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"ab\Z", RegexOptions.Multiline, "b\nab\n", "Pass. Group[0]=(2,2)" };
- yield return new object[] { @"ab\z", RegexOptions.Multiline, "b\nab\n", "Fail." };
- yield return new object[] { @"ab$", RegexOptions.Multiline, "b\nab\n", "Pass. Group[0]=(2,2)" };
- yield return new object[] { @"ab\Z", RegexOptions.Multiline, "b\nab", "Pass. Group[0]=(2,2)" };
- yield return new object[] { @"ab\z", RegexOptions.Multiline, "b\nab", "Pass. Group[0]=(2,2)" };
- yield return new object[] { @"ab$", RegexOptions.Multiline, "b\nab", "Pass. Group[0]=(2,2)" };
- yield return new object[] { @"ab\Z", RegexOptions.None, "ac\nb\n", "Fail." };
- yield return new object[] { @"ab\z", RegexOptions.None, "ac\nb\n", "Fail." };
- yield return new object[] { @"ab$", RegexOptions.None, "ac\nb\n", "Fail." };
- yield return new object[] { @"ab\Z", RegexOptions.None, "b\nac\n", "Fail." };
- yield return new object[] { @"ab\z", RegexOptions.None, "b\nac\n", "Fail." };
- yield return new object[] { @"ab$", RegexOptions.None, "b\nac\n", "Fail." };
- yield return new object[] { @"ab\Z", RegexOptions.None, "b\nac", "Fail." };
- yield return new object[] { @"ab\z", RegexOptions.None, "b\nac", "Fail." };
- yield return new object[] { @"ab$", RegexOptions.None, "b\nac", "Fail." };
- yield return new object[] { @"ab\Z", RegexOptions.Multiline, "ac\nb\n", "Fail." };
- yield return new object[] { @"ab\z", RegexOptions.Multiline, "ac\nb\n", "Fail." };
- yield return new object[] { @"ab$", RegexOptions.Multiline, "ac\nb\n", "Fail." };
- yield return new object[] { @"ab\Z", RegexOptions.Multiline, "b\nac\n", "Fail." };
- yield return new object[] { @"ab\z", RegexOptions.Multiline, "b\nac\n", "Fail." };
- yield return new object[] { @"ab$", RegexOptions.Multiline, "b\nac\n", "Fail." };
- yield return new object[] { @"ab\Z", RegexOptions.Multiline, "b\nac", "Fail." };
- yield return new object[] { @"ab\z", RegexOptions.Multiline, "b\nac", "Fail." };
- yield return new object[] { @"ab$", RegexOptions.Multiline, "b\nac", "Fail." };
- yield return new object[] { @"ab\Z", RegexOptions.None, "ca\nb\n", "Fail." };
- yield return new object[] { @"ab\z", RegexOptions.None, "ca\nb\n", "Fail." };
- yield return new object[] { @"ab$", RegexOptions.None, "ca\nb\n", "Fail." };
- yield return new object[] { @"ab\Z", RegexOptions.None, "b\nca\n", "Fail." };
- yield return new object[] { @"ab\z", RegexOptions.None, "b\nca\n", "Fail." };
- yield return new object[] { @"ab$", RegexOptions.None, "b\nca\n", "Fail." };
- yield return new object[] { @"ab\Z", RegexOptions.None, "b\nca", "Fail." };
- yield return new object[] { @"ab\z", RegexOptions.None, "b\nca", "Fail." };
- yield return new object[] { @"ab$", RegexOptions.None, "b\nca", "Fail." };
- yield return new object[] { @"ab\Z", RegexOptions.Multiline, "ca\nb\n", "Fail." };
- yield return new object[] { @"ab\z", RegexOptions.Multiline, "ca\nb\n", "Fail." };
- yield return new object[] { @"ab$", RegexOptions.Multiline, "ca\nb\n", "Fail." };
- yield return new object[] { @"ab\Z", RegexOptions.Multiline, "b\nca\n", "Fail." };
- yield return new object[] { @"ab\z", RegexOptions.Multiline, "b\nca\n", "Fail." };
- yield return new object[] { @"ab$", RegexOptions.Multiline, "b\nca\n", "Fail." };
- yield return new object[] { @"ab\Z", RegexOptions.Multiline, "b\nca", "Fail." };
- yield return new object[] { @"ab\z", RegexOptions.Multiline, "b\nca", "Fail." };
- yield return new object[] { @"ab$", RegexOptions.Multiline, "b\nca", "Fail." };
- yield return new object[] { @"abb\Z", RegexOptions.None, "abb\nb\n", "Fail." };
- yield return new object[] { @"abb\z", RegexOptions.None, "abb\nb\n", "Fail." };
- yield return new object[] { @"abb$", RegexOptions.None, "abb\nb\n", "Fail." };
- yield return new object[] { @"abb\Z", RegexOptions.None, "b\nabb\n", "Pass. Group[0]=(2,3)" };
- yield return new object[] { @"abb\z", RegexOptions.None, "b\nabb\n", "Fail." };
- yield return new object[] { @"abb$", RegexOptions.None, "b\nabb\n", "Pass. Group[0]=(2,3)" };
- yield return new object[] { @"abb\Z", RegexOptions.None, "b\nabb", "Pass. Group[0]=(2,3)" };
- yield return new object[] { @"abb\z", RegexOptions.None, "b\nabb", "Pass. Group[0]=(2,3)" };
- yield return new object[] { @"abb$", RegexOptions.None, "b\nabb", "Pass. Group[0]=(2,3)" };
- yield return new object[] { @"abb\z", RegexOptions.Multiline, "abb\nb\n", "Fail." };
- yield return new object[] { @"abb$", RegexOptions.Multiline, "abb\nb\n", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"abb\Z", RegexOptions.Multiline, "b\nabb\n", "Pass. Group[0]=(2,3)" };
- yield return new object[] { @"abb\z", RegexOptions.Multiline, "b\nabb\n", "Fail." };
- yield return new object[] { @"abb$", RegexOptions.Multiline, "b\nabb\n", "Pass. Group[0]=(2,3)" };
- yield return new object[] { @"abb\Z", RegexOptions.Multiline, "b\nabb", "Pass. Group[0]=(2,3)" };
- yield return new object[] { @"abb\z", RegexOptions.Multiline, "b\nabb", "Pass. Group[0]=(2,3)" };
- yield return new object[] { @"abb$", RegexOptions.Multiline, "b\nabb", "Pass. Group[0]=(2,3)" };
- yield return new object[] { @"abb\Z", RegexOptions.None, "ac\nb\n", "Fail." };
- yield return new object[] { @"abb\z", RegexOptions.None, "ac\nb\n", "Fail." };
- yield return new object[] { @"abb$", RegexOptions.None, "ac\nb\n", "Fail." };
- yield return new object[] { @"abb\Z", RegexOptions.None, "b\nac\n", "Fail." };
- yield return new object[] { @"abb\z", RegexOptions.None, "b\nac\n", "Fail." };
- yield return new object[] { @"abb$", RegexOptions.None, "b\nac\n", "Fail." };
- yield return new object[] { @"abb\Z", RegexOptions.None, "b\nac", "Fail." };
- yield return new object[] { @"abb\z", RegexOptions.None, "b\nac", "Fail." };
- yield return new object[] { @"abb$", RegexOptions.None, "b\nac", "Fail." };
- yield return new object[] { @"abb\Z", RegexOptions.Multiline, "ac\nb\n", "Fail." };
- yield return new object[] { @"abb\z", RegexOptions.Multiline, "ac\nb\n", "Fail." };
- yield return new object[] { @"abb$", RegexOptions.Multiline, "ac\nb\n", "Fail." };
- yield return new object[] { @"abb\Z", RegexOptions.Multiline, "b\nac\n", "Fail." };
- yield return new object[] { @"abb\z", RegexOptions.Multiline, "b\nac\n", "Fail." };
- yield return new object[] { @"abb$", RegexOptions.Multiline, "b\nac\n", "Fail." };
- yield return new object[] { @"abb\Z", RegexOptions.Multiline, "b\nac", "Fail." };
- yield return new object[] { @"abb\z", RegexOptions.Multiline, "b\nac", "Fail." };
- yield return new object[] { @"abb$", RegexOptions.Multiline, "b\nac", "Fail." };
- yield return new object[] { @"abb\Z", RegexOptions.None, "ca\nb\n", "Fail." };
- yield return new object[] { @"abb\z", RegexOptions.None, "ca\nb\n", "Fail." };
- yield return new object[] { @"abb$", RegexOptions.None, "ca\nb\n", "Fail." };
- yield return new object[] { @"abb\Z", RegexOptions.None, "b\nca\n", "Fail." };
- yield return new object[] { @"abb\z", RegexOptions.None, "b\nca\n", "Fail." };
- yield return new object[] { @"abb$", RegexOptions.None, "b\nca\n", "Fail." };
- yield return new object[] { @"abb\Z", RegexOptions.None, "b\nca", "Fail." };
- yield return new object[] { @"abb\z", RegexOptions.None, "b\nca", "Fail." };
- yield return new object[] { @"abb$", RegexOptions.None, "b\nca", "Fail." };
- yield return new object[] { @"abb\Z", RegexOptions.Multiline, "ca\nb\n", "Fail." };
- yield return new object[] { @"abb\z", RegexOptions.Multiline, "ca\nb\n", "Fail." };
- yield return new object[] { @"abb$", RegexOptions.Multiline, "ca\nb\n", "Fail." };
- yield return new object[] { @"abb\Z", RegexOptions.Multiline, "b\nca\n", "Fail." };
- yield return new object[] { @"abb\z", RegexOptions.Multiline, "b\nca\n", "Fail." };
- yield return new object[] { @"abb$", RegexOptions.Multiline, "b\nca\n", "Fail." };
- yield return new object[] { @"abb\Z", RegexOptions.Multiline, "b\nca", "Fail." };
- yield return new object[] { @"abb\z", RegexOptions.Multiline, "b\nca", "Fail." };
- yield return new object[] { @"abb$", RegexOptions.Multiline, "b\nca", "Fail." };
- yield return new object[] { @"(^|x)(c)", RegexOptions.None, "ca", "Pass. Group[0]=(0,1) Group[1]=(0,0) Group[2]=(0,1)" };
- yield return new object[] { @"a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz", RegexOptions.None, "x", "Fail." };
- yield return new object[] { @"round\(((?>[^()]+))\)", RegexOptions.None, "_I(round(xs * sz),1)", "Pass. Group[0]=(3,14) Group[1]=(9,7)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"foo.bart", RegexOptions.None, "foo.bart", "Pass. Group[0]=(0,8)" };
- yield return new object[] { @"^d[x][x][x]", RegexOptions.Multiline, "abcd\ndxxx", "Pass. Group[0]=(5,4)" };
- yield return new object[] { @".X(.+)+X", RegexOptions.None, "bbbbXcXaaaaaaaa", "Pass. Group[0]=(3,4) Group[1]=(5,1)" };
- yield return new object[] { @".X(.+)+XX", RegexOptions.None, "bbbbXcXXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(5,1)" };
- yield return new object[] { @".XX(.+)+X", RegexOptions.None, "bbbbXXcXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(6,1)" };
- yield return new object[] { @".X(.+)+X", RegexOptions.None, "bbbbXXaaaaaaaaa", "Fail." };
- yield return new object[] { @".X(.+)+XX", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail." };
- yield return new object[] { @".XX(.+)+X", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail." };
- yield return new object[] { @".X(.+)+[X]", RegexOptions.None, "bbbbXcXaaaaaaaa", "Pass. Group[0]=(3,4) Group[1]=(5,1)" };
- yield return new object[] { @".X(.+)+[X][X]", RegexOptions.None, "bbbbXcXXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(5,1)" };
- yield return new object[] { @".XX(.+)+[X]", RegexOptions.None, "bbbbXXcXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(6,1)" };
- yield return new object[] { @".X(.+)+[X]", RegexOptions.None, "bbbbXXaaaaaaaaa", "Fail." };
- yield return new object[] { @".X(.+)+[X][X]", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail." };
- yield return new object[] { @".XX(.+)+[X]", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail." };
- yield return new object[] { @".[X](.+)+[X]", RegexOptions.None, "bbbbXcXaaaaaaaa", "Pass. Group[0]=(3,4) Group[1]=(5,1)" };
- yield return new object[] { @".[X](.+)+[X][X]", RegexOptions.None, "bbbbXcXXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(5,1)" };
- yield return new object[] { @".[X][X](.+)+[X]", RegexOptions.None, "bbbbXXcXaaaaaaaa", "Pass. Group[0]=(3,5) Group[1]=(6,1)" };
- yield return new object[] { @".[X](.+)+[X]", RegexOptions.None, "bbbbXXaaaaaaaaa", "Fail." };
- yield return new object[] { @".[X](.+)+[X][X]", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail." };
- yield return new object[] { @".[X][X](.+)+[X]", RegexOptions.None, "bbbbXXXaaaaaaaaa", "Fail." };
- yield return new object[] { @"tt+$", RegexOptions.None, "xxxtt", "Pass. Group[0]=(3,2)" };
- yield return new object[] { @"([\d-z]+)", RegexOptions.None, "a0-za", "Pass. Group[0]=(1,3) Group[1]=(1,3)" };
- yield return new object[] { @"([\d-\s]+)", RegexOptions.None, "a0- z", "Pass. Group[0]=(1,3) Group[1]=(1,3)" };
- yield return new object[] { @"\GX.*X", RegexOptions.None, "aaaXbX", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(\d+\.\d+)", RegexOptions.None, "3.1415926", "Pass. Group[0]=(0,9) Group[1]=(0,9)" };
- yield return new object[] { @"(\ba.{0,10}br)", RegexOptions.None, "have a web browser", "Pass. Group[0]=(5,8) Group[1]=(5,8)" };
- yield return new object[] { @"\.c(pp|xx|c)?$", RegexOptions.IgnoreCase, "Changes", "Fail." };
- yield return new object[] { @"\.c(pp|xx|c)?$", RegexOptions.IgnoreCase, "IO.c", "Pass. Group[0]=(2,2) Group[1]=" };
- yield return new object[] { @"(\.c(pp|xx|c)?$)", RegexOptions.IgnoreCase, "IO.c", "Pass. Group[0]=(2,2) Group[1]=(2,2) Group[2]=" };
- yield return new object[] { @"^([a-z]:)", RegexOptions.None, "C:/", "Fail." };
- yield return new object[] { @"^\S\s+aa$", RegexOptions.Multiline, "\nx aa", "Pass. Group[0]=(1,4)" };
- yield return new object[] { @"(^|a)b", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[1]=(0,1)" };
- yield return new object[] { @"^([ab]*?)(b)?(c)$", RegexOptions.None, "abac", "Pass. Group[0]=(0,4) Group[1]=(0,3) Group[2]= Group[3]=(3,1)" };
- yield return new object[] { @"(\w)?(abc)\1b", RegexOptions.None, "abcab", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(?:.,){2}c", RegexOptions.None, "a,b,c", "Pass. Group[0]=(0,5)" };
- yield return new object[] { @"^(.,){2}c", RegexOptions.None, "a,b,c", "Pass. Group[0]=(0,5) Group[1]=(0,2)(2,2)" };
- yield return new object[] { @"^(?:[^,]*,){2}c", RegexOptions.None, "a,b,c", "Pass. Group[0]=(0,5)" };
- yield return new object[] { @"^([^,]*,){2}c", RegexOptions.None, "a,b,c", "Pass. Group[0]=(0,5) Group[1]=(0,2)(2,2)" };
- yield return new object[] { @"^([^,]*,){3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)" };
- yield return new object[] { @"^([^,]*,){3,}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)" };
- yield return new object[] { @"^([^,]*,){0,3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)" };
- yield return new object[] { @"^([^,]{1,3},){3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)" };
- yield return new object[] { @"^([^,]{1,3},){3,}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)" };
- yield return new object[] { @"^([^,]{1,3},){0,3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)" };
- yield return new object[] { @"^([^,]{1,},){3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)" };
- yield return new object[] { @"^([^,]{1,},){3,}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)" };
- yield return new object[] { @"^([^,]{1,},){0,3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)" };
- yield return new object[] { @"^([^,]{0,3},){3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)" };
- yield return new object[] { @"^([^,]{0,3},){3,}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)" };
- yield return new object[] { @"^([^,]{0,3},){0,3}d", RegexOptions.None, "aaa,b,c,d", "Pass. Group[0]=(0,9) Group[1]=(0,4)(4,2)(6,2)" };
- yield return new object[] { @"(?i)", RegexOptions.None, "", "Pass. Group[0]=(0,0)" };
- yield return new object[] { @"(?!\A)x", RegexOptions.Multiline, "a\nxb\n", "Pass. Group[0]=(2,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(a(b)?)+$", RegexOptions.None, "aba", "Pass. Group[0]=(0,3) Group[1]=(0,2)(2,1) Group[2]=(1,1)" };
- yield return new object[] { @"^(aa(bb)?)+$", RegexOptions.None, "aabbaa", "Pass. Group[0]=(0,6) Group[1]=(0,4)(4,2) Group[2]=(2,2)" };
- yield return new object[] { @"^.{9}abc.*\n", RegexOptions.Multiline, "123\nabcabcabcabc\n", "Pass. Group[0]=(4,13)" };
- yield return new object[] { @"^(a)?a$", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[1]=" };
- yield return new object[] { @"^(a)?(?(1)a|b)+$", RegexOptions.None, "a", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(a\1?)(a\1?)(a\2?)(a\3?)$", RegexOptions.None, "aaaaaa", "Pass. Group[0]=(0,6) Group[1]=(0,1) Group[2]=(1,2) Group[3]=(3,1) Group[4]=(4,2)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(a\1?){4}$", RegexOptions.None, "aaaaaa", "Pass. Group[0]=(0,6) Group[1]=(0,1)(1,2)(3,1)(4,2)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(0+)?(?:x(1))?", RegexOptions.None, "x1", "Pass. Group[0]=(0,2) Group[1]= Group[2]=(1,1)" };
- yield return new object[] { @"^([0-9a-fA-F]+)(?:x([0-9a-fA-F]+)?)(?:x([0-9a-fA-F]+))?", RegexOptions.None, "012cxx0190", "Pass. Group[0]=(0,10) Group[1]=(0,4) Group[2]= Group[3]=(6,4)" };
- yield return new object[] { @"^(b+?|a){1,2}c", RegexOptions.None, "bbbac", "Pass. Group[0]=(0,5) Group[1]=(0,3)(3,1)" };
- yield return new object[] { @"^(b+?|a){1,2}c", RegexOptions.None, "bbbbac", "Pass. Group[0]=(0,6) Group[1]=(0,4)(4,1)" };
- yield return new object[] { @"\((\w\. \w+)\)", RegexOptions.None, "cd. (A. Tw)", "Pass. Group[0]=(4,7) Group[1]=(5,5)" };
- yield return new object[] { @"((?:aaaa|bbbb)cccc)?", RegexOptions.None, "aaaacccc", "Pass. Group[0]=(0,8) Group[1]=(0,8)" };
- yield return new object[] { @"((?:aaaa|bbbb)cccc)?", RegexOptions.None, "bbbbcccc", "Pass. Group[0]=(0,8) Group[1]=(0,8)" };
- yield return new object[] { @"^(foo)|(bar)$", RegexOptions.None, "foobar", "Pass. Group[0]=(0,3) Group[1]=(0,3) Group[2]=" };
- yield return new object[] { @"^(foo)|(bar)$", RegexOptions.RightToLeft, "foobar", "Pass. Group[0]=(3,3) Group[1]= Group[2]=(3,3)" };
- yield return new object[] { @"b", RegexOptions.RightToLeft, "babaaa", "Pass. Group[0]=(2,1)" };
- yield return new object[] { @"bab", RegexOptions.RightToLeft, "babababaa", "Pass. Group[0]=(4,3)" };
- yield return new object[] { @"abb", RegexOptions.RightToLeft , "abb", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"b$", RegexOptions.RightToLeft | RegexOptions.Multiline, "aab\naab", "Pass. Group[0]=(6,1)" };
- yield return new object[] { @"^a", RegexOptions.RightToLeft | RegexOptions.Multiline, "aab\naab", "Pass. Group[0]=(4,1)" };
- yield return new object[] { @"^aaab", RegexOptions.RightToLeft | RegexOptions.Multiline, "aaab\naab", "Pass. Group[0]=(0,4)" };
- yield return new object[] { @"abb{2}", RegexOptions.RightToLeft , "abbb", "Pass. Group[0]=(0,4)" };
- yield return new object[] { @"abb{1,2}", RegexOptions.RightToLeft , "abbb", "Pass. Group[0]=(0,4)" };
- yield return new object[] { @"abb{1,2}", RegexOptions.RightToLeft , "abbbbbaaaa", "Pass. Group[0]=(0,4)" };
- yield return new object[] { @"\Ab", RegexOptions.RightToLeft, "bab\naaa", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"\Abab$", RegexOptions.RightToLeft, "bab", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"b\Z", RegexOptions.RightToLeft, "bab\naaa", "Fail." };
- yield return new object[] { @"b\Z", RegexOptions.RightToLeft, "babaaab", "Pass. Group[0]=(6,1)" };
- yield return new object[] { @"b\z", RegexOptions.RightToLeft, "babaaa", "Fail." };
- yield return new object[] { @"b\z", RegexOptions.RightToLeft, "babaaab", "Pass. Group[0]=(6,1)" };
- yield return new object[] { @"a\G", RegexOptions.RightToLeft, "babaaa", "Pass. Group[0]=(5,1)" };
- yield return new object[] { @"\Abaaa\G", RegexOptions.RightToLeft, "baaa", "Pass. Group[0]=(0,4)" };
- yield return new object[] { @"\bc", RegexOptions.RightToLeft, "aaa c aaa c a", "Pass. Group[0]=(10,1)" };
- yield return new object[] { @"\bc", RegexOptions.RightToLeft, "c aaa c", "Pass. Group[0]=(6,1)" };
- yield return new object[] { @"\bc", RegexOptions.RightToLeft, "aaa ac", "Fail." };
- yield return new object[] { @"\bc", RegexOptions.RightToLeft, "c aaa", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"\bc", RegexOptions.RightToLeft, "aaacaaa", "Fail." };
- yield return new object[] { @"\bc", RegexOptions.RightToLeft, "aaac aaa", "Fail." };
- yield return new object[] { @"\bc", RegexOptions.RightToLeft, "aaa ca caaa", "Pass. Group[0]=(7,1)" };
- yield return new object[] { @"\Bc", RegexOptions.RightToLeft, "ac aaa ac", "Pass. Group[0]=(8,1)" };
- yield return new object[] { @"\Bc", RegexOptions.RightToLeft, "aaa c", "Fail." };
- yield return new object[] { @"\Bc", RegexOptions.RightToLeft, "ca aaa", "Fail." };
- yield return new object[] { @"\Bc", RegexOptions.RightToLeft, "aaa c aaa", "Fail." };
- yield return new object[] { @"\Bc", RegexOptions.RightToLeft, " acaca ", "Pass. Group[0]=(4,1)" };
- yield return new object[] { @"\Bc", RegexOptions.RightToLeft, "aaac aaac", "Pass. Group[0]=(8,1)" };
- yield return new object[] { @"\Bc", RegexOptions.RightToLeft, "aaa caaa", "Fail." };
- yield return new object[] { @"b(a?)b", RegexOptions.RightToLeft, "aabababbaaababa", "Pass. Group[0]=(11,3) Group[1]=(12,1)" };
- yield return new object[] { @"b{4}", RegexOptions.RightToLeft, "abbbbaabbbbaabbb", "Pass. Group[0]=(7,4)" };
- yield return new object[] { @"b\1aa(.)", RegexOptions.RightToLeft, "bBaaB", "Pass. Group[0]=(0,5) Group[1]=(4,1)" };
- yield return new object[] { @"b(.)aa\1", RegexOptions.RightToLeft, "bBaaB", "Fail." };
- yield return new object[] { @"^(a\1?){4}$", RegexOptions.RightToLeft, "aaaaaa", "Pass. Group[0]=(0,6) Group[1]=(5,1)(3,2)(2,1)(0,2)" };
- yield return new object[] { @"^([0-9a-fA-F]+)(?:x([0-9a-fA-F]+)?)(?:x([0-9a-fA-F]+))?", RegexOptions.RightToLeft, "012cxx0190", "Pass. Group[0]=(0,10) Group[1]=(0,4) Group[2]= Group[3]=(6,4)" };
- yield return new object[] { @"^(b+?|a){1,2}c", RegexOptions.RightToLeft, "bbbac", "Pass. Group[0]=(0,5) Group[1]=(3,1)(0,3)" };
- yield return new object[] { @"\((\w\. \w+)\)", RegexOptions.RightToLeft, "cd. (A. Tw)", "Pass. Group[0]=(4,7) Group[1]=(5,5)" };
- yield return new object[] { @"((?:aaaa|bbbb)cccc)?", RegexOptions.RightToLeft, "aaaacccc", "Pass. Group[0]=(0,8) Group[1]=(0,8)" };
- yield return new object[] { @"((?:aaaa|bbbb)cccc)?", RegexOptions.RightToLeft, "bbbbcccc", "Pass. Group[0]=(0,8) Group[1]=(0,8)" };
- yield return new object[] { @"(?<=a)b", RegexOptions.RightToLeft, "ab", "Pass. Group[0]=(1,1)" };
- yield return new object[] { @"(?<=a)b", RegexOptions.RightToLeft, "cb", "Fail." };
- yield return new object[] { @"(?<=a)b", RegexOptions.RightToLeft, "b", "Fail." };
- yield return new object[] { @"(?<!c)b", RegexOptions.RightToLeft, "ab", "Pass. Group[0]=(1,1)" };
- yield return new object[] { @"(?<!c)b", RegexOptions.RightToLeft, "cb", "Fail." };
- yield return new object[] { @"(?<!c)b", RegexOptions.RightToLeft, "b", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"a(?=d).", RegexOptions.RightToLeft, "adabad", "Pass. Group[0]=(4,2)" };
- yield return new object[] { @"a(?=c|d).", RegexOptions.RightToLeft, "adabad", "Pass. Group[0]=(4,2)" };
- yield return new object[] { @"ab*c", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"ab*bc", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"ab*bc", RegexOptions.RightToLeft, "abbc", "Pass. Group[0]=(0,4)" };
- yield return new object[] { @"ab*bc", RegexOptions.RightToLeft, "abbbbc", "Pass. Group[0]=(0,6)" };
- yield return new object[] { @".{1}", RegexOptions.RightToLeft, "abbbbc", "Pass. Group[0]=(5,1)" };
- yield return new object[] { @".{3,4}", RegexOptions.RightToLeft, "abbbbc", "Pass. Group[0]=(2,4)" };
- yield return new object[] { @"ab{0,}bc", RegexOptions.RightToLeft, "abbbbc", "Pass. Group[0]=(0,6)" };
- yield return new object[] { @"ab+bc", RegexOptions.RightToLeft, "abbc", "Pass. Group[0]=(0,4)" };
- yield return new object[] { @"ab+bc", RegexOptions.RightToLeft, "abc", "Fail." };
- yield return new object[] { @"ab+bc", RegexOptions.RightToLeft, "abq", "Fail." };
- yield return new object[] { @"ab{1,}bc", RegexOptions.RightToLeft, "abq", "Fail." };
- yield return new object[] { @"ab+bc", RegexOptions.RightToLeft, "abbbbc", "Pass. Group[0]=(0,6)" };
- yield return new object[] { @"ab{1,}bc", RegexOptions.RightToLeft, "abbbbc", "Pass. Group[0]=(0,6)" };
- yield return new object[] { @"ab{1,3}bc", RegexOptions.RightToLeft, "abbbbc", "Pass. Group[0]=(0,6)" };
- yield return new object[] { @"ab{3,4}bc", RegexOptions.RightToLeft, "abbbbc", "Pass. Group[0]=(0,6)" };
- yield return new object[] { @"ab{4,5}bc", RegexOptions.RightToLeft, "abbbbc", "Fail." };
- yield return new object[] { @"ab?bc", RegexOptions.RightToLeft, "abbc", "Pass. Group[0]=(0,4)" };
- yield return new object[] { @"ab?bc", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"ab{0,1}bc", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"ab?bc", RegexOptions.RightToLeft, "abbbbc", "Fail." };
- yield return new object[] { @"ab?c", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"ab{0,1}c", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"^abc$", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"^abc$", RegexOptions.RightToLeft, "abcc", "Fail." };
- yield return new object[] { @"^abc", RegexOptions.RightToLeft, "abcc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"^abc$", RegexOptions.RightToLeft, "aabc", "Fail." };
- yield return new object[] { @"abc$", RegexOptions.RightToLeft, "aabc", "Pass. Group[0]=(1,3)" };
- yield return new object[] { @"abc$", RegexOptions.RightToLeft, "aabcd", "Fail." };
- yield return new object[] { @"^", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,0)" };
- yield return new object[] { @"$", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(3,0)" };
- yield return new object[] { @"a.c", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a.c", RegexOptions.RightToLeft, "axc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a.*c", RegexOptions.RightToLeft, "axyzc", "Pass. Group[0]=(0,5)" };
- yield return new object[] { @"a.*c", RegexOptions.RightToLeft, "axyzd", "Fail." };
- yield return new object[] { @"a[bc]d", RegexOptions.RightToLeft, "abc", "Fail." };
- yield return new object[] { @"a[bc]d", RegexOptions.RightToLeft, "abd", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a[b-d]e", RegexOptions.RightToLeft, "abd", "Fail." };
- yield return new object[] { @"a[b-d]e", RegexOptions.RightToLeft, "ace", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a[b-d]", RegexOptions.RightToLeft, "aac", "Pass. Group[0]=(1,2)" };
- yield return new object[] { @"a[-b]", RegexOptions.RightToLeft, "a-", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"a[b-]", RegexOptions.RightToLeft, "a-", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"a[b-a]", RegexOptions.RightToLeft, "-", "Error." };
- yield return new object[] { @"a[]b", RegexOptions.RightToLeft, "-", "Error." };
- yield return new object[] { @"a[", RegexOptions.RightToLeft, "-", "Error." };
- yield return new object[] { @"a]", RegexOptions.RightToLeft, "a]", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"a[]]b", RegexOptions.RightToLeft, "a]b", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a[^bc]d", RegexOptions.RightToLeft, "aed", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a[^bc]d", RegexOptions.RightToLeft, "abd", "Fail." };
- yield return new object[] { @"a[^-b]c", RegexOptions.RightToLeft, "adc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a[^-b]c", RegexOptions.RightToLeft, "a-c", "Fail." };
- yield return new object[] { @"a[^]b]c", RegexOptions.RightToLeft, "a]c", "Fail." };
- yield return new object[] { @"a[^]b]c", RegexOptions.RightToLeft, "adc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"\ba\b", RegexOptions.RightToLeft, "a-", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"\ba\b", RegexOptions.RightToLeft, "-a", "Pass. Group[0]=(1,1)" };
- yield return new object[] { @"\ba\b", RegexOptions.RightToLeft, "-a-", "Pass. Group[0]=(1,1)" };
- yield return new object[] { @"\by\b", RegexOptions.RightToLeft, "xy", "Fail." };
- yield return new object[] { @"\by\b", RegexOptions.RightToLeft, "yz", "Fail." };
- yield return new object[] { @"\by\b", RegexOptions.RightToLeft, "xyz", "Fail." };
- yield return new object[] { @"\Ba\B", RegexOptions.RightToLeft, "a-", "Fail." };
- yield return new object[] { @"\Ba\B", RegexOptions.RightToLeft, "-a", "Fail." };
- yield return new object[] { @"\Ba\B", RegexOptions.RightToLeft, "-a-", "Fail." };
- yield return new object[] { @"\By\b", RegexOptions.RightToLeft, "xy", "Pass. Group[0]=(1,1)" };
- yield return new object[] { @"\by\B", RegexOptions.RightToLeft, "yz", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"\By\B", RegexOptions.RightToLeft, "xyz", "Pass. Group[0]=(1,1)" };
- yield return new object[] { @"\w", RegexOptions.RightToLeft, "a", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"\w", RegexOptions.RightToLeft, "-", "Fail." };
- yield return new object[] { @"\W", RegexOptions.RightToLeft, "a", "Fail." };
- yield return new object[] { @"\W", RegexOptions.RightToLeft, "-", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"a\sb", RegexOptions.RightToLeft, "a b", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a\sb", RegexOptions.RightToLeft, "a-b", "Fail." };
- yield return new object[] { @"a\Sb", RegexOptions.RightToLeft, "a b", "Fail." };
- yield return new object[] { @"a\Sb", RegexOptions.RightToLeft, "a-b", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"\d", RegexOptions.RightToLeft, "1", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"\d", RegexOptions.RightToLeft, "-", "Fail." };
- yield return new object[] { @"\D", RegexOptions.RightToLeft, "1", "Fail." };
- yield return new object[] { @"\D", RegexOptions.RightToLeft, "-", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"[\w]", RegexOptions.RightToLeft, "a", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"[\w]", RegexOptions.RightToLeft, "-", "Fail." };
- yield return new object[] { @"[\W]", RegexOptions.RightToLeft, "a", "Fail." };
- yield return new object[] { @"[\W]", RegexOptions.RightToLeft, "-", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"a[\s]b", RegexOptions.RightToLeft, "a b", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a[\s]b", RegexOptions.RightToLeft, "a-b", "Fail." };
- yield return new object[] { @"a[\S]b", RegexOptions.RightToLeft, "a b", "Fail." };
- yield return new object[] { @"a[\S]b", RegexOptions.RightToLeft, "a-b", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"[\d]", RegexOptions.RightToLeft, "1", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"[\d]", RegexOptions.RightToLeft, "-", "Fail." };
- yield return new object[] { @"[\D]", RegexOptions.RightToLeft, "1", "Fail." };
- yield return new object[] { @"[\D]", RegexOptions.RightToLeft, "-", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"ab|cd", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"ab|cd", RegexOptions.RightToLeft, "abcd", "Pass. Group[0]=(2,2)" };
- yield return new object[] { @"()ef", RegexOptions.RightToLeft, "def", "Pass. Group[0]=(1,2) Group[1]=(1,0)" };
- yield return new object[] { @"*a", RegexOptions.RightToLeft, "-", "Error." };
- yield return new object[] { @"(*)b", RegexOptions.RightToLeft, "-", "Error." };
- yield return new object[] { @"$b", RegexOptions.RightToLeft, "b", "Fail." };
- yield return new object[] { @"a\", RegexOptions.RightToLeft, "-", "Error." };
- yield return new object[] { @"a\(b", RegexOptions.RightToLeft, "a(b", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"a\(*b", RegexOptions.RightToLeft, "ab", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"a\(*b", RegexOptions.RightToLeft, "a((b", "Pass. Group[0]=(0,4)" };
- yield return new object[] { @"a\\b", RegexOptions.RightToLeft, "a\\b", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"abc)", RegexOptions.RightToLeft, "-", "Error." };
- yield return new object[] { @"(abc", RegexOptions.RightToLeft, "-", "Error." };
- yield return new object[] { @"((a))", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1)" };
- yield return new object[] { @"(a)b(c)", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(2,1)" };
- yield return new object[] { @"a+b+c", RegexOptions.RightToLeft, "aabbabc", "Pass. Group[0]=(4,3)" };
- yield return new object[] { @"a{1,}b{1,}c", RegexOptions.RightToLeft, "aabbabc", "Pass. Group[0]=(4,3)" };
- yield return new object[] { @"a**", RegexOptions.RightToLeft, "-", "Error." };
- yield return new object[] { @"a.+?c", RegexOptions.RightToLeft, "abcabc", "Pass. Group[0]=(3,3)" };
- yield return new object[] { @"(a+|b)*", RegexOptions.RightToLeft, "ab", "Pass. Group[0]=(0,2) Group[1]=(1,1)(0,1)" };
- yield return new object[] { @"(a+|b){0,}", RegexOptions.RightToLeft, "ab", "Pass. Group[0]=(0,2) Group[1]=(1,1)(0,1)" };
- yield return new object[] { @"(a+|b)+", RegexOptions.RightToLeft, "ab", "Pass. Group[0]=(0,2) Group[1]=(1,1)(0,1)" };
- yield return new object[] { @"(a+|b){1,}", RegexOptions.RightToLeft, "ab", "Pass. Group[0]=(0,2) Group[1]=(1,1)(0,1)" };
- yield return new object[] { @"(a+|b)?", RegexOptions.RightToLeft, "ab", "Pass. Group[0]=(1,1) Group[1]=(1,1)" };
- yield return new object[] { @"(a+|b){0,1}", RegexOptions.RightToLeft, "ab", "Pass. Group[0]=(1,1) Group[1]=(1,1)" };
- yield return new object[] { @")(", RegexOptions.RightToLeft, "-", "Error." };
- yield return new object[] { @"[^ab]*", RegexOptions.RightToLeft, "cde", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"abc", RegexOptions.RightToLeft, "", "Fail." };
- yield return new object[] { @"a*", RegexOptions.RightToLeft, "", "Pass. Group[0]=(0,0)" };
- yield return new object[] { @"([abc])*d", RegexOptions.RightToLeft, "abbbcd", "Pass. Group[0]=(0,6) Group[1]=(4,1)(3,1)(2,1)(1,1)(0,1)" };
- yield return new object[] { @"([abc])*bcd", RegexOptions.RightToLeft, "abcd", "Pass. Group[0]=(0,4) Group[1]=(0,1)" };
- yield return new object[] { @"a|b|c|d|e", RegexOptions.RightToLeft, "e", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"(a|b|c|d|e)f", RegexOptions.RightToLeft, "ef", "Pass. Group[0]=(0,2) Group[1]=(0,1)" };
- yield return new object[] { @"abcd*efg", RegexOptions.RightToLeft, "abcdefg", "Pass. Group[0]=(0,7)" };
- yield return new object[] { @"ab*", RegexOptions.RightToLeft, "xabyabbbz", "Pass. Group[0]=(4,4)" };
- yield return new object[] { @"ab*", RegexOptions.RightToLeft, "xayabbbz", "Pass. Group[0]=(3,4)" };
- yield return new object[] { @"(ab|cd)e", RegexOptions.RightToLeft, "abcde", "Pass. Group[0]=(2,3) Group[1]=(2,2)" };
- yield return new object[] { @"[abhgefdc]ij", RegexOptions.RightToLeft, "hij", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"^(ab|cd)e", RegexOptions.RightToLeft, "abcde", "Fail." };
- yield return new object[] { @"(abc|)ef", RegexOptions.RightToLeft, "abcdef", "Pass. Group[0]=(4,2) Group[1]=(4,0)" };
- yield return new object[] { @"(a|b)c*d", RegexOptions.RightToLeft, "abcd", "Pass. Group[0]=(1,3) Group[1]=(1,1)" };
- yield return new object[] { @"(ab|ab*)bc", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,1)" };
- yield return new object[] { @"a([bc]*)c*", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3) Group[1]=(1,1)" };
- yield return new object[] { @"a([bc]*)(c*d)", RegexOptions.RightToLeft, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,1) Group[2]=(2,2)" };
- yield return new object[] { @"a([bc]+)(c*d)", RegexOptions.RightToLeft, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,1) Group[2]=(2,2)" };
- yield return new object[] { @"a([bc]*)(c+d)", RegexOptions.RightToLeft, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,1) Group[2]=(2,2)" };
- yield return new object[] { @"a[bcd]*dcdcde", RegexOptions.RightToLeft, "adcdcde", "Pass. Group[0]=(0,7)" };
- yield return new object[] { @"a[bcd]+dcdcde", RegexOptions.RightToLeft, "adcdcde", "Fail." };
- yield return new object[] { @"(ab|a)b*c", RegexOptions.RightToLeft, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,1)" };
- yield return new object[] { @"((a)(b)c)(d)", RegexOptions.RightToLeft, "abcd", "Pass. Group[0]=(0,4) Group[1]=(0,3) Group[2]=(0,1) Group[3]=(1,1) Group[4]=(3,1)" };
- yield return new object[] { @"[a-zA-Z_][a-zA-Z0-9_]*", RegexOptions.RightToLeft, "alpha", "Pass. Group[0]=(0,5)" };
- yield return new object[] { @"^a(bc+|b[eh])g|.h$", RegexOptions.RightToLeft, "abh", "Pass. Group[0]=(1,2) Group[1]=" };
- yield return new object[] { @"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.RightToLeft, "effgz", "Pass. Group[0]=(0,5) Group[1]=(0,5) Group[2]=" };
- yield return new object[] { @"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.RightToLeft, "ij", "Pass. Group[0]=(0,2) Group[1]=(0,2) Group[2]=(1,1)" };
- yield return new object[] { @"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.RightToLeft, "effg", "Fail." };
- yield return new object[] { @"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.RightToLeft, "bcdd", "Fail." };
- yield return new object[] { @"(bc+d$|ef*g.|h?i(j|k))", RegexOptions.RightToLeft, "reffgz", "Pass. Group[0]=(1,5) Group[1]=(1,5) Group[2]=" };
- yield return new object[] { @"((((((((((a))))))))))", RegexOptions.RightToLeft, "a", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)" };
- yield return new object[] { @"((((((((((a))))))))))\10", RegexOptions.RightToLeft, "aa", "Fail." };
- yield return new object[] { @"\10((((((((((a))))))))))", RegexOptions.RightToLeft, "aa", "Pass. Group[0]=(0,2) Group[1]=(1,1) Group[2]=(1,1) Group[3]=(1,1) Group[4]=(1,1) Group[5]=(1,1) Group[6]=(1,1) Group[7]=(1,1) Group[8]=(1,1) Group[9]=(1,1) Group[10]=(1,1)" };
- yield return new object[] { @"((((((((((a))))))))))!", RegexOptions.RightToLeft, "aa", "Fail." };
- yield return new object[] { @"((((((((((a))))))))))!", RegexOptions.RightToLeft, "a!", "Pass. Group[0]=(0,2) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1) Group[10]=(0,1)" };
- yield return new object[] { @"(((((((((a)))))))))", RegexOptions.RightToLeft, "a", "Pass. Group[0]=(0,1) Group[1]=(0,1) Group[2]=(0,1) Group[3]=(0,1) Group[4]=(0,1) Group[5]=(0,1) Group[6]=(0,1) Group[7]=(0,1) Group[8]=(0,1) Group[9]=(0,1)" };
- yield return new object[] { @"multiple words of text", RegexOptions.RightToLeft, "uh-uh", "Fail." };
- yield return new object[] { @"multiple words", RegexOptions.RightToLeft, "multiple words, yeah", "Pass. Group[0]=(0,14)" };
- yield return new object[] { @"(.*)c(.*)", RegexOptions.RightToLeft, "abcde", "Pass. Group[0]=(0,5) Group[1]=(0,2) Group[2]=(3,2)" };
- yield return new object[] { @"\((.*), (.*)\)", RegexOptions.RightToLeft, "(a, b)", "Pass. Group[0]=(0,6) Group[1]=(1,1) Group[2]=(4,1)" };
- yield return new object[] { @"[k]", RegexOptions.RightToLeft, "ab", "Fail." };
- yield return new object[] { @"abcd", RegexOptions.RightToLeft, "abcd", "Pass. Group[0]=(0,4)" };
- yield return new object[] { @"a(bc)d", RegexOptions.RightToLeft, "abcd", "Pass. Group[0]=(0,4) Group[1]=(1,2)" };
- yield return new object[] { @"a[-]?c", RegexOptions.RightToLeft, "ac", "Pass. Group[0]=(0,2)" };
- yield return new object[] { @"(abc)\1", RegexOptions.RightToLeft, "abcabc", "Fail." };
- yield return new object[] { @"\1(abc)", RegexOptions.RightToLeft, "abcabc", "Pass. Group[0]=(0,6) Group[1]=(3,3)" };
- yield return new object[] { @"([a-c]*)\1", RegexOptions.RightToLeft, "abcabc", "Fail." };
- yield return new object[] { @"\1([a-c]*)", RegexOptions.RightToLeft, "abcabc", "Pass. Group[0]=(0,6) Group[1]=(3,3)" };
- yield return new object[] { @"\1", RegexOptions.RightToLeft, "-", "Error." };
- yield return new object[] { @"\2", RegexOptions.RightToLeft, "-", "Error." };
- yield return new object[] { @"(a)|\1", RegexOptions.RightToLeft, "a", "Pass. Group[0]=(0,1) Group[1]=(0,1)" };
- yield return new object[] { @"(a)|\1", RegexOptions.RightToLeft, "x", "Fail." };
- yield return new object[] { @"(a)|\2", RegexOptions.RightToLeft, "-", "Error." };
- yield return new object[] { @"(([a-c])b*?\2)*", RegexOptions.RightToLeft, "ababbbcbc", "Pass. Group[0]=(9,0) Group[1]= Group[2]=" };
- yield return new object[] { @"(([a-c])b*?\2){3}", RegexOptions.RightToLeft, "ababbbcbc", "Fail." };
- yield return new object[] { @"((\3|b)\2(a)x)+", RegexOptions.RightToLeft, "aaxabxbaxbbx", "Fail." };
- yield return new object[] { @"((\3|b)\2(a)x)+", RegexOptions.RightToLeft, "aaaxabaxbaaxbbax", "Fail." };
- yield return new object[] { @"((\3|b)\2(a)){2,}", RegexOptions.RightToLeft, "bbaababbabaaaaabbaaaabba", "Fail." };
- yield return new object[] { @"\((?>[^()]+|\((?<depth>)|\)(?<-depth>))*(?(depth)(?!))\)", RegexOptions.None, "((a(b))c)", "Pass. Group[0]=(0,9) Group[1]=", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^\((?>[^()]+|\((?<depth>)|\)(?<-depth>))*(?(depth)(?!))\)$", RegexOptions.None, "((a(b))c)", "Pass. Group[0]=(0,9) Group[1]=", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^\((?>[^()]+|\((?<depth>)|\)(?<-depth>))*(?(depth)(?!))\)$", RegexOptions.None, "((a(b))c", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^\((?>[^()]+|\((?<depth>)|\)(?<-depth>))*(?(depth)(?!))\)$", RegexOptions.None, "())", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(((?<foo>\()[^()]*)+((?<bar-foo>\))[^()]*)+)+(?(foo)(?!))", RegexOptions.None, "((a(b))c)", "Pass. Group[0]=(0,9) Group[1]=(0,9) Group[2]=(0,1)(1,2)(3,2) Group[3]=(5,1)(6,2)(8,1) Group[4]= Group[5]=(4,1)(2,4)(1,7)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(((?<foo>\()[^()]*)+((?<bar-foo>\))[^()]*)+)+(?(foo)(?!))$", RegexOptions.None, "((a(b))c)", "Pass. Group[0]=(0,9) Group[1]=(0,9) Group[2]=(0,1)(1,2)(3,2) Group[3]=(5,1)(6,2)(8,1) Group[4]= Group[5]=(4,1)(2,4)(1,7)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(((?<foo>\()[^()]*)+((?<bar-foo>\))[^()]*)+)+(?(foo)(?!))", RegexOptions.None, "x(a((b)))b)x", "Pass. Group[0]=(1,9) Group[1]=(1,9) Group[2]=(1,2)(3,1)(4,2) Group[3]=(6,1)(7,1)(8,2) Group[4]= Group[5]=(5,1)(4,3)(2,6)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(((?<foo>\()[^()]*)+((?<bar-foo>\))[^()]*)+)+(?(foo)(?!))", RegexOptions.None, "x((a((b)))x", "Pass. Group[0]=(2,9) Group[1]=(2,9) Group[2]=(2,2)(4,1)(5,2) Group[3]=(7,1)(8,1)(9,2) Group[4]= Group[5]=(6,1)(5,3)(3,6)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(((?<foo>\()[^()]*)+((?<bar-foo>\))[^()]*)+)+(?(foo)(?!))$", RegexOptions.None, "((a(b))c","Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(((?<foo>\()[^()]*)+((?<bar-foo>\))[^()]*)+)+(?(foo)(?!))$", RegexOptions.None, "((a(b))c))","Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(((?<foo>\()[^()]*)+((?<bar-foo>\))[^()]*)+)+(?(foo)(?!))$", RegexOptions.None, ")(","Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^(((?<foo>\()[^()]*)+((?<bar-foo>\))[^()]*)+)+(?(foo)(?!))$", RegexOptions.None, "((a((b))c)","Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"^((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "[n]", "Pass. Group[0]=(0,3) Group[1]=(1,1)" };
- yield return new object[] { @"^((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "n", "Pass. Group[0]=(0,1) Group[1]=(0,1)" };
- yield return new object[] { @"^((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "n[i]e", "Fail." };
- yield return new object[] { @"^((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "[n", "Fail." };
- yield return new object[] { @"^((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "]n]", "Fail." };
- yield return new object[] { @"^((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, @"\[n\]", "Fail." };
- yield return new object[] { @"^((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, @"[n\]", "Pass. Group[0]=(0,4) Group[1]=(1,2)" };
- yield return new object[] { @"^((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, @"[n\[]", "Pass. Group[0]=(0,5) Group[1]=(1,3)" };
- yield return new object[] { @"^((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, @"[[n]", "Pass. Group[0]=(0,4) Group[1]=(1,2)" };
- yield return new object[] { @"^((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "[s] . [n]", "Pass. Group[0]=(0,9) Group[1]=(1,1) Group[2]=(7,1)" };
- yield return new object[] { @"^((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "[s] . n", "Pass. Group[0]=(0,7) Group[1]=(1,1) Group[2]=(6,1)" };
- yield return new object[] { @"^((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "s.[ n ]", "Pass. Group[0]=(0,7) Group[1]=(0,1) Group[2]=(3,3)" };
- yield return new object[] { @"^((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, " . n", "Pass. Group[0]=(0,4) Group[1]=(0,1) Group[2]=(3,1)" };
- yield return new object[] { @"^((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "s. ", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(2,1)" };
- yield return new object[] { @"^((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "[.]. ", "Pass. Group[0]=(0,5) Group[1]=(1,1) Group[2]=(4,1)" };
- yield return new object[] { @"^((\[(?<CATALOG>[^\]]+)\])|(?<CATALOG>[^\.\[\]]+))\s*\.\s*((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "[c].[s].[n]", "Pass. Group[0]=(0,11) Group[1]=(1,1) Group[2]=(5,1) Group[3]=(9,1)" };
- yield return new object[] { @"^((\[(?<CATALOG>[^\]]+)\])|(?<CATALOG>[^\.\[\]]+))\s*\.\s*((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, " c . s . n ", "Pass. Group[0]=(0,11) Group[1]=(0,3) Group[2]=(5,2) Group[3]=(9,2)" };
- yield return new object[] { @"^((\[(?<CATALOG>[^\]]+)\])|(?<CATALOG>[^\.\[\]]+))\s*\.\s*((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, " . [.] . [ ]", "Pass. Group[0]=(0,12) Group[1]=(0,1) Group[2]=(4,1) Group[3]=(10,1)" };
- yield return new object[] { @"^((\[(?<CATALOG>[^\]]+)\])|(?<CATALOG>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "c.n", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(2,1)" };
- yield return new object[] { @"^((\[(?<CATALOG>[^\]]+)\])|(?<CATALOG>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "[c] .[n]", "Pass. Group[0]=(0,8) Group[1]=(1,1) Group[2]=(6,1)" };
- yield return new object[] { @"^((\[(?<CATALOG>[^\]]+)\])|(?<CATALOG>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "c.n.", "Fail." };
- yield return new object[] { @"^((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<CATALOG>[^\]]+)\])|(?<CATALOG>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "s.c.n", "Pass. Group[0]=(0,5) Group[1]=(0,1) Group[2]=(2,1) Group[3]=(4,1)" };
- yield return new object[] { @"^((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<CATALOG>[^\]]+)\])|(?<CATALOG>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "[s].[c].[n]", "Pass. Group[0]=(0,11) Group[1]=(1,1) Group[2]=(5,1) Group[3]=(9,1)" };
- yield return new object[] { @"^((\[(?<SCHEMA>[^\]]+)\])|(?<SCHEMA>[^\.\[\]]+))\s*\.\s*((\[(?<CATALOG>[^\]]+)\])|(?<CATALOG>[^\.\[\]]+))\s*\.\s*((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture, "[s].[c].", "Fail." };
- yield return new object[] { @"^((\[(?<ColName>.+)\])|(?<ColName>\S+))([ ]+(?<Order>ASC|DESC))?$", RegexOptions.IgnoreCase|RegexOptions.ExplicitCapture, "[id]]", "Pass. Group[0]=(0,5) Group[1]=(1,3) Group[2]=" };
- yield return new object[] { @"a{1,2147483647}", RegexOptions.None, "a", "Pass. Group[0]=(0,1)" };
- yield return new object[] { @"^((\[(?<NAME>[^\]]+)\])|(?<NAME>[^\.\[\]]+))$", RegexOptions.None, "[a]", "Pass. Group[0]=(0,3) Group[1]=(0,3) Group[2]=(0,3) Group[3]=(1,1)" };
-
- // Ported from https://github.com/mono/mono/blob/0f2995e95e98e082c7c7039e17175cf2c6a00034/mcs/class/System/Test/System.Text.RegularExpressions/RegexMatchTests.cs
- yield return new object[] { @"(a)(b)(c)", RegexOptions.ExplicitCapture, "abc", "Pass. Group[0]=(0,3)" };
- yield return new object[] { @"(a)(?<1>b)(c)", RegexOptions.ExplicitCapture, "abc", "Pass. Group[0]=(0,3) Group[1]=(1,1)" };
- yield return new object[] { @"(a)(?<2>b)(c)", RegexOptions.None, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,1) Group[2]=(1,1)(2,1)" };
- yield return new object[] { @"(a)(?<foo>b)(c)", RegexOptions.ExplicitCapture, "abc", "Pass. Group[0]=(0,3) Group[1]=(1,1)" };
- yield return new object[] { @"(F)(2)(3)(4)(5)(6)(7)(8)(9)(10)(L)\11", RegexOptions.None, "F2345678910LL", "Pass. Group[0]=(0,13) Group[1]=(0,1) Group[2]=(1,1) Group[3]=(2,1) Group[4]=(3,1) Group[5]=(4,1) Group[6]=(5,1) Group[7]=(6,1) Group[8]=(7,1) Group[9]=(8,1) Group[10]=(9,2) Group[11]=(11,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(F)(2)(3)(4)(5)(6)(7)(8)(9)(10)(L)\11", RegexOptions.ExplicitCapture, "F2345678910LL", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(F)(2)(3)(4)(5)(6)(?<S>7)(8)(9)(10)(L)\1", RegexOptions.None, "F2345678910L71", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(F)(2)(3)(4)(5)(6)(7)(8)(9)(10)(L)\11", RegexOptions.None, "F2345678910LF1", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(F)(2)(3)(4)(5)(6)(?<S>7)(8)(9)(10)(L)\11", RegexOptions.None, "F2345678910L71", "Pass. Group[0]=(0,13) Group[1]=(0,1) Group[2]=(1,1) Group[3]=(2,1) Group[4]=(3,1) Group[5]=(4,1) Group[6]=(5,1) Group[7]=(7,1) Group[8]=(8,1) Group[9]=(9,2) Group[10]=(11,1) Group[11]=(6,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)\10", RegexOptions.None, "F2345678910L71", "Pass. Group[0]=(0,13) Group[1]=(0,1) Group[2]=(1,1) Group[3]=(2,1) Group[4]=(4,1) Group[5]=(5,1) Group[6]=(7,1) Group[7]=(8,1) Group[8]=(9,2) Group[9]=(11,1) Group[10]=(3,1)(6,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)\10", RegexOptions.ExplicitCapture, "F2345678910L70", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)\1", RegexOptions.ExplicitCapture, "F2345678910L70", "Pass. Group[0]=(0,13) Group[1]=(3,1)(6,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?n:(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)\1)", RegexOptions.None, "F2345678910L70", "Pass. Group[0]=(0,13) Group[1]=(3,1)(6,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)(?(10)\10)", RegexOptions.None, "F2345678910L70","Pass. Group[0]=(0,13) Group[1]=(0,1) Group[2]=(1,1) Group[3]=(2,1) Group[4]=(4,1) Group[5]=(5,1) Group[6]=(7,1) Group[7]=(8,1) Group[8]=(9,2) Group[9]=(11,1) Group[10]=(3,1)(6,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)(?(S)|\10)", RegexOptions.None, "F2345678910L70","Pass. Group[0]=(0,12) Group[1]=(0,1) Group[2]=(1,1) Group[3]=(2,1) Group[4]=(4,1) Group[5]=(5,1) Group[6]=(7,1) Group[7]=(8,1) Group[8]=(9,2) Group[9]=(11,1) Group[10]=(3,1)(6,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)(?(7)|\10)", RegexOptions.None, "F2345678910L70","Pass. Group[0]=(0,12) Group[1]=(0,1) Group[2]=(1,1) Group[3]=(2,1) Group[4]=(4,1) Group[5]=(5,1) Group[6]=(7,1) Group[7]=(8,1) Group[8]=(9,2) Group[9]=(11,1) Group[10]=(3,1)(6,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(F)(2)(3)(?<S>4)(5)(6)(?'S'7)(8)(9)(10)(L)(?(K)|\10)", RegexOptions.None, "F2345678910L70","Pass. Group[0]=(0,13) Group[1]=(0,1) Group[2]=(1,1) Group[3]=(2,1) Group[4]=(4,1) Group[5]=(5,1) Group[6]=(7,1) Group[7]=(8,1) Group[8]=(9,2) Group[9]=(11,1) Group[10]=(3,1)(6,1)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"\P{IsHebrew}", RegexOptions.None, "\u05D0a", "Pass. Group[0]=(1,1)" };
- yield return new object[] { @"\p{IsHebrew}", RegexOptions.None, "abc\u05D0def", "Pass. Group[0]=(3,1)" };
- yield return new object[] { @"(?<=a+)(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?<=a*)(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(0,4)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?<=a{1,5})(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?<=a{1})(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?<=a{1,})(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?<=a+?)(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?<=a*?)(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(0,4)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?<=a{1,5}?)(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?<=a{1}?)(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(1,3)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?<!a+)(?:a)*bc", RegexOptions.None, "aabc", "Pass. Group[0]=(0,4)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?<!a*)(?:a)*bc", RegexOptions.None, "aabc", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"abc*(?=c*)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,4)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"abc*(?=c+)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"abc*(?=c{1})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"abc*(?=c{1,5})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"abc*(?=c{1,})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"abc*(?=c*?)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,4)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"abc*(?=c+?)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"abc*(?=c{1}?)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"abc*(?=c{1,5}?)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"abc*(?=c{1,}?)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,3)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"abc*?(?=c*)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,2)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"abc*?(?=c+)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,2)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"abc*?(?=c{1})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,2)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"abc*?(?=c{1,5})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,2)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"abc*?(?=c{1,})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,2)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"abc*(?!c*)", RegexOptions.None, "abcc", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"abc*(?!c+)", RegexOptions.None, "abcc", "Pass. Group[0]=(0,4)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"abc*(?!c{1})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,4)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"abc*(?!c{1,5})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,4)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"abc*(?!c{1,})", RegexOptions.None, "abcc", "Pass. Group[0]=(0,4)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(a)(?<1>b)(?'1'c)", RegexOptions.ExplicitCapture, "abc", "Pass. Group[0]=(0,3) Group[1]=(1,1)(2,1)" };
- yield return new object[] { @"(?>a*).", RegexOptions.ExplicitCapture, "aaaa", "Fail.", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"(?<ab>ab)c\1", RegexOptions.None, "abcabc", "Pass. Group[0]=(0,5) Group[1]=(0,2)", "NONBACKTRACKINGINCOMPATIBLE" };
- yield return new object[] { @"\1", RegexOptions.ECMAScript, "-", "Fail." };
- yield return new object[] { @"\2", RegexOptions.ECMAScript, "-", "Fail." };
- yield return new object[] { @"(a)|\2", RegexOptions.ECMAScript, "-", "Fail." };
- yield return new object[] { @"\4400", RegexOptions.None, "asdf 012", "Pass. Group[0]=(4,2)" };
- yield return new object[] { @"\4400", RegexOptions.ECMAScript, "asdf 012", "Fail." };
- yield return new object[] { @"\4400", RegexOptions.None, "asdf$0012", "Fail." };
- yield return new object[] { @"\4400", RegexOptions.ECMAScript, "asdf$0012", "Pass. Group[0]=(4,3)" };
- yield return new object[] { @"(?<2>ab)(?<c>c)(?<d>d)", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(2,1) Group[2]=(0,2) Group[3]=(3,1)" };// 61
- yield return new object[] { @"(?<1>ab)(c)", RegexOptions.None, "abc", "Pass. Group[0]=(0,3) Group[1]=(0,2)(2,1)" };
- yield return new object[] { @"(?<44>a)", RegexOptions.None, "a", "Pass. Group[0]=(0,1) Group[44]=(0,1)" };
- yield return new object[] { @"(?<44>a)(?<8>b)", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[8]=(1,1) Group[44]=(0,1)" };
- yield return new object[] { @"(?<44>a)(?<8>b)(?<1>c)(d)", RegexOptions.None, "abcd", "Pass. Group[0]=(0,4) Group[1]=(2,1)(3,1) Group[8]=(1,1) Group[44]=(0,1)" };
- yield return new object[] { @"(?<44>a)(?<44>b)", RegexOptions.None, "ab", "Pass. Group[0]=(0,2) Group[44]=(0,1)(1,1)" };
- yield return new object[] { @"(?<44>a)\440", RegexOptions.None, "a ", "Pass. Group[0]=(0,2) Group[44]=(0,1)" };
- yield return new object[] { @"(?<44>a)\440", RegexOptions.ECMAScript, "a ", "Fail." };
- yield return new object[] { @"(?<44>a)\440", RegexOptions.None, "aa0", "Fail." };
- yield return new object[] { @"(?<44>a)\440", RegexOptions.ECMAScript, "aa0", "Pass. Group[0]=(0,3) Group[44]=(0,1)" };
+ Assert.ThrowsAny<ArgumentException>(() => new Regex(pattern, options));
}
}
}
using System.Tests;
using Microsoft.DotNet.RemoteExecutor;
using Xunit;
-using Microsoft.DotNet.XUnitExtensions;
namespace System.Text.RegularExpressions.Tests
{
public class RegexMatchTests
{
- public static IEnumerable<object[]> Match_Basic_TestData_LazyLoops()
+ public static IEnumerable<object[]> Match_MemberData()
{
- var allOptions = new List<RegexOptions>() { RegexOptions.Singleline, RegexOptions.Compiled | RegexOptions.Singleline };
- if (PlatformDetection.IsNetCore)
- {
- allOptions.Add(RegexHelpers.RegexOptionNonBacktracking | RegexOptions.Singleline);
- }
-
- foreach (RegexOptions options in allOptions)
+ foreach (RegexEngine engine in RegexHelpers.AvailableEngines)
{
- yield return new object[] { @"\W.*?\D", "seq 012 of 3 digits", options, 0, 19, true, " 012 " };
- yield return new object[] { @"\W.+?\D", "seq 012 of 3 digits", options, 0, 19, true, " 012 " };
- yield return new object[] { @"\W.{1,7}?\D", "seq 012 of 3 digits", options, 0, 19, true, " 012 " };
- yield return new object[] { @"\W.{1,2}?\D", "seq 012 of 3 digits", options, 0, 19, true, " of" };
- yield return new object[] { @"\W.*?\b", "digits:0123456789", options, 0, 17, true, ":" };
- yield return new object[] { @"\B.*?\B", "e.g:abc", options, 0, 7, true, "" };
- yield return new object[] { @"\B\W+?", "e.g:abc", options, 0, 7, false, "" };
- yield return new object[] { @"\B\W*?", "e.g:abc", options, 0, 7, true, "" };
-
- // While not lazy loops themselves, variants of the prior case that should give same results here
- yield return new object[] { @"\B\W*", "e.g:abc", options, 0, 7, true, "" };
- yield return new object[] { @"\B\W?", "e.g:abc", options, 0, 7, true, "" };
-
- //mixed lazy and eager counting
- yield return new object[] { "z(a{0,5}|a{0,10}?)", "xyzaaaaaaaaaxyz", options, 0, 15, true, "zaaaaa" };
+ (string Pattern, string Input, RegexOptions Options, int Beginning, int Length, bool ExpectedSuccess, string ExpectedValue)[] cases = Cases(engine).ToArray();
+ Regex[] regexes = RegexHelpers.GetRegexesAsync(engine, cases.Select(c => (c.Pattern, (RegexOptions?)c.Options, (TimeSpan?)null)).ToArray()).Result;
+ for (int i = 0; i < regexes.Length; i++)
+ {
+ yield return new object[] { engine, cases[i].Pattern, cases[i].Input, cases[i].Options, regexes[i], cases[i].Beginning, cases[i].Length, cases[i].ExpectedSuccess, cases[i].ExpectedValue };
+ }
}
- }
- public static IEnumerable<object[]> Match_Basic_TestData()
- {
- foreach (RegexEngine engine in RegexHelpers.AvailableEngines)
+ static IEnumerable<(string Pattern, string Input, RegexOptions Options, int Beginning, int Length, bool ExpectedSuccess, string ExpectedValue)> Cases(RegexEngine engine)
{
// pattern, input, options, beginning, length, expectedSuccess, expectedValue
- yield return new object[] { engine, @"H#", "#H#", RegexOptions.IgnoreCase, 0, 3, true, "H#" }; // https://github.com/dotnet/runtime/issues/39390
- yield return new object[] { engine, @"H#", "#H#", RegexOptions.None, 0, 3, true, "H#" };
+ yield return (@"H#", "#H#", RegexOptions.IgnoreCase, 0, 3, true, "H#"); // https://github.com/dotnet/runtime/issues/39390
+ yield return (@"H#", "#H#", RegexOptions.None, 0, 3, true, "H#");
// Testing octal sequence matches: "\\060(\\061)?\\061"
// Octal \061 is ASCII 49 ('1')
- yield return new object[] { engine, @"\060(\061)?\061", "011", RegexOptions.None, 0, 3, true, "011" };
+ yield return (@"\060(\061)?\061", "011", RegexOptions.None, 0, 3, true, "011");
// Testing hexadecimal sequence matches: "(\\x30\\x31\\x32)"
// Hex \x31 is ASCII 49 ('1')
- yield return new object[] { engine, @"(\x30\x31\x32)", "012", RegexOptions.None, 0, 3, true, "012" };
+ yield return (@"(\x30\x31\x32)", "012", RegexOptions.None, 0, 3, true, "012");
// Testing control character escapes???: "2", "(\u0032)"
- yield return new object[] { engine, "(\u0034)", "4", RegexOptions.None, 0, 1, true, "4", };
+ yield return ("(\u0034)", "4", RegexOptions.None, 0, 1, true, "4");
// Using long loop prefix
- yield return new object[] { engine, @"a{10}", new string('a', 10), RegexOptions.None, 0, 10, true, new string('a', 10) };
- yield return new object[] { engine, @"a{100}", new string('a', 100), RegexOptions.None, 0, 100, true, new string('a', 100) };
+ yield return (@"a{10}", new string('a', 10), RegexOptions.None, 0, 10, true, new string('a', 10));
+ yield return (@"a{100}", new string('a', 100), RegexOptions.None, 0, 100, true, new string('a', 100));
- yield return new object[] { engine, @"a{10}b", new string('a', 10) + "bc", RegexOptions.None, 0, 12, true, new string('a', 10) + "b" };
- yield return new object[] { engine, @"a{100}b", new string('a', 100) + "bc", RegexOptions.None, 0, 102, true, new string('a', 100) + "b" };
+ yield return (@"a{10}b", new string('a', 10) + "bc", RegexOptions.None, 0, 12, true, new string('a', 10) + "b");
+ yield return (@"a{100}b", new string('a', 100) + "bc", RegexOptions.None, 0, 102, true, new string('a', 100) + "b");
- yield return new object[] { engine, @"a{11}b", new string('a', 10) + "bc", RegexOptions.None, 0, 12, false, string.Empty };
- yield return new object[] { engine, @"a{101}b", new string('a', 100) + "bc", RegexOptions.None, 0, 102, false, string.Empty };
+ yield return (@"a{11}b", new string('a', 10) + "bc", RegexOptions.None, 0, 12, false, string.Empty);
+ yield return (@"a{101}b", new string('a', 100) + "bc", RegexOptions.None, 0, 102, false, string.Empty);
- yield return new object[] { engine, @"a{1,3}b", "bc", RegexOptions.None, 0, 2, false, string.Empty };
- yield return new object[] { engine, @"a{1,3}b", "abc", RegexOptions.None, 0, 3, true, "ab" };
- yield return new object[] { engine, @"a{1,3}b", "aaabc", RegexOptions.None, 0, 5, true, "aaab" };
- yield return new object[] { engine, @"a{1,3}b", "aaaabc", RegexOptions.None, 0, 6, true, "aaab" };
+ yield return (@"a{1,3}b", "bc", RegexOptions.None, 0, 2, false, string.Empty);
+ yield return (@"a{1,3}b", "abc", RegexOptions.None, 0, 3, true, "ab");
+ yield return (@"a{1,3}b", "aaabc", RegexOptions.None, 0, 5, true, "aaab");
+ yield return (@"a{1,3}b", "aaaabc", RegexOptions.None, 0, 6, true, "aaab");
- yield return new object[] { engine, @"a{2,}b", "abc", RegexOptions.None, 0, 3, false, string.Empty };
- yield return new object[] { engine, @"a{2,}b", "aabc", RegexOptions.None, 0, 4, true, "aab" };
+ yield return (@"a{2,}b", "abc", RegexOptions.None, 0, 3, false, string.Empty);
+ yield return (@"a{2,}b", "aabc", RegexOptions.None, 0, 4, true, "aab");
// {,n} is treated as a literal rather than {0,n} as it should be
- yield return new object[] { engine, @"a{,3}b", "a{,3}bc", RegexOptions.None, 0, 6, true, "a{,3}b" };
- yield return new object[] { engine, @"a{,3}b", "aaabc", RegexOptions.None, 0, 5, false, string.Empty };
+ yield return (@"a{,3}b", "a{,3}bc", RegexOptions.None, 0, 6, true, "a{,3}b");
+ yield return (@"a{,3}b", "aaabc", RegexOptions.None, 0, 5, false, string.Empty);
// Using [a-z], \s, \w: Actual - "([a-zA-Z]+)\\s(\\w+)"
- yield return new object[] { engine, @"([a-zA-Z]+)\s(\w+)", "David Bau", RegexOptions.None, 0, 9, true, "David Bau" };
+ yield return (@"([a-zA-Z]+)\s(\w+)", "David Bau", RegexOptions.None, 0, 9, true, "David Bau");
// \\S, \\d, \\D, \\W: Actual - "(\\S+):\\W(\\d+)\\s(\\D+)"
- yield return new object[] { engine, @"(\S+):\W(\d+)\s(\D+)", "Price: 5 dollars", RegexOptions.None, 0, 16, true, "Price: 5 dollars" };
+ yield return (@"(\S+):\W(\d+)\s(\D+)", "Price: 5 dollars", RegexOptions.None, 0, 16, true, "Price: 5 dollars");
// \\S, \\d, \\D, \\W: Actual - "[^0-9]+(\\d+)"
- yield return new object[] { engine, @"[^0-9]+(\d+)", "Price: 30 dollars", RegexOptions.None, 0, 17, true, "Price: 30" };
+ yield return (@"[^0-9]+(\d+)", "Price: 30 dollars", RegexOptions.None, 0, 17, true, "Price: 30");
if (!RegexHelpers.IsNonBacktracking(engine))
{
// Zero-width negative lookahead assertion: Actual - "abc(?!XXX)\\w+"
- yield return new object[] { engine, @"abc(?!XXX)\w+", "abcXXXdef", RegexOptions.None, 0, 9, false, string.Empty };
+ yield return (@"abc(?!XXX)\w+", "abcXXXdef", RegexOptions.None, 0, 9, false, string.Empty);
// Zero-width positive lookbehind assertion: Actual - "(\\w){6}(?<=XXX)def"
- yield return new object[] { engine, @"(\w){6}(?<=XXX)def", "abcXXXdef", RegexOptions.None, 0, 9, true, "abcXXXdef" };
+ yield return (@"(\w){6}(?<=XXX)def", "abcXXXdef", RegexOptions.None, 0, 9, true, "abcXXXdef");
// Zero-width negative lookbehind assertion: Actual - "(\\w){6}(?<!XXX)def"
- yield return new object[] { engine, @"(\w){6}(?<!XXX)def", "XXXabcdef", RegexOptions.None, 0, 9, true, "XXXabcdef" };
+ yield return (@"(\w){6}(?<!XXX)def", "XXXabcdef", RegexOptions.None, 0, 9, true, "XXXabcdef");
// Nonbacktracking subexpression: Actual - "[^0-9]+(?>[0-9]+)3"
// The last 3 causes the match to fail, since the non backtracking subexpression does not give up the last digit it matched
// for it to be a success. For a correct match, remove the last character, '3' from the pattern
- yield return new object[] { engine, "[^0-9]+(?>[0-9]+)3", "abc123", RegexOptions.None, 0, 6, false, string.Empty };
- yield return new object[] { engine, "[^0-9]+(?>[0-9]+)", "abc123", RegexOptions.None, 0, 6, true, "abc123" };
+ yield return ("[^0-9]+(?>[0-9]+)3", "abc123", RegexOptions.None, 0, 6, false, string.Empty);
+ yield return ("[^0-9]+(?>[0-9]+)", "abc123", RegexOptions.None, 0, 6, true, "abc123");
}
// More nonbacktracking expressions
{
string Case(string s) => (options & RegexOptions.IgnoreCase) != 0 ? s.ToUpper() : s;
- yield return new object[] { engine, Case("(?:hi|hello|hey)hi"), "hellohi", options, 0, 7, true, "hellohi" }; // allow backtracking and it succeeds
- yield return new object[] { engine, Case(@"a[^wyz]*w"), "abczw", RegexOptions.IgnoreCase, 0, 0, false, string.Empty };
+ yield return (Case("(?:hi|hello|hey)hi"), "hellohi", options, 0, 7, true, "hellohi"); // allow backtracking and it succeeds
+ yield return (Case(@"a[^wyz]*w"), "abczw", RegexOptions.IgnoreCase, 0, 0, false, string.Empty);
if (!RegexHelpers.IsNonBacktracking(engine))
{
- yield return new object[] { engine, Case("(?>[0-9]+)abc"), "abc12345abc", options, 3, 8, true, "12345abc" };
- yield return new object[] { engine, Case("(?>(?>[0-9]+))abc"), "abc12345abc", options, 3, 8, true, "12345abc" };
- yield return new object[] { engine, Case("(?>[0-9]*)abc"), "abc12345abc", options, 3, 8, true, "12345abc" };
- yield return new object[] { engine, Case("(?>[^z]+)z"), "zzzzxyxyxyz123", options, 4, 9, true, "xyxyxyz" };
- yield return new object[] { engine, Case("(?>(?>[^z]+))z"), "zzzzxyxyxyz123", options, 4, 9, true, "xyxyxyz" };
- yield return new object[] { engine, Case("(?>[^z]*)z123"), "zzzzxyxyxyz123", options, 4, 10, true, "xyxyxyz123" };
- yield return new object[] { engine, Case("(?>a+)123"), "aa1234", options, 0, 5, true, "aa123" };
- yield return new object[] { engine, Case("(?>a*)123"), "aa1234", options, 0, 5, true, "aa123" };
- yield return new object[] { engine, Case("(?>(?>a*))123"), "aa1234", options, 0, 5, true, "aa123" };
- yield return new object[] { engine, Case("(?>a+?)a"), "aaaaa", options, 0, 2, true, "aa" };
- yield return new object[] { engine, Case("(?>a*?)a"), "aaaaa", options, 0, 1, true, "a" };
- yield return new object[] { engine, Case("(?>hi|hello|hey)hi"), "hellohi", options, 0, 0, false, string.Empty };
- yield return new object[] { engine, Case("(?>hi|hello|hey)hi"), "hihi", options, 0, 4, true, "hihi" };
+ yield return (Case("(?>[0-9]+)abc"), "abc12345abc", options, 3, 8, true, "12345abc");
+ yield return (Case("(?>(?>[0-9]+))abc"), "abc12345abc", options, 3, 8, true, "12345abc");
+ yield return (Case("(?>[0-9]*)abc"), "abc12345abc", options, 3, 8, true, "12345abc");
+ yield return (Case("(?>[^z]+)z"), "zzzzxyxyxyz123", options, 4, 9, true, "xyxyxyz");
+ yield return (Case("(?>(?>[^z]+))z"), "zzzzxyxyxyz123", options, 4, 9, true, "xyxyxyz");
+ yield return (Case("(?>[^z]*)z123"), "zzzzxyxyxyz123", options, 4, 10, true, "xyxyxyz123");
+ yield return (Case("(?>a+)123"), "aa1234", options, 0, 5, true, "aa123");
+ yield return (Case("(?>a*)123"), "aa1234", options, 0, 5, true, "aa123");
+ yield return (Case("(?>(?>a*))123"), "aa1234", options, 0, 5, true, "aa123");
+ yield return (Case("(?>a+?)a"), "aaaaa", options, 0, 2, true, "aa");
+ yield return (Case("(?>a*?)a"), "aaaaa", options, 0, 1, true, "a");
+ yield return (Case("(?>hi|hello|hey)hi"), "hellohi", options, 0, 0, false, string.Empty);
+ yield return (Case("(?>hi|hello|hey)hi"), "hihi", options, 0, 4, true, "hihi");
}
}
// Loops at beginning of expressions
- yield return new object[] { engine, @"a+", "aaa", RegexOptions.None, 0, 3, true, "aaa" };
- yield return new object[] { engine, @"a+\d+", "a1", RegexOptions.None, 0, 2, true, "a1" };
- yield return new object[] { engine, @".+\d+", "a1", RegexOptions.None, 0, 2, true, "a1" };
- yield return new object[] { engine, ".+\nabc", "a\nabc", RegexOptions.None, 0, 5, true, "a\nabc" };
- yield return new object[] { engine, @"\d+", "abcd123efg", RegexOptions.None, 0, 10, true, "123" };
- yield return new object[] { engine, @"\d+\d+", "abcd123efg", RegexOptions.None, 0, 10, true, "123" };
- yield return new object[] { engine, @"\w+123\w+", "abcd123efg", RegexOptions.None, 0, 10, true, "abcd123efg" };
- yield return new object[] { engine, @"\d+\w+", "abcd123efg", RegexOptions.None, 0, 10, true, "123efg" };
- yield return new object[] { engine, @"\w+@\w+.com", "abc@def.com", RegexOptions.None, 0, 11, true, "abc@def.com" };
- yield return new object[] { engine, @"\w{3,}@\w+.com", "abc@def.com", RegexOptions.None, 0, 11, true, "abc@def.com" };
- yield return new object[] { engine, @"\w{4,}@\w+.com", "abc@def.com", RegexOptions.None, 0, 11, false, string.Empty };
- yield return new object[] { engine, @"\w{2,5}@\w+.com", "abc@def.com", RegexOptions.None, 0, 11, true, "abc@def.com" };
- yield return new object[] { engine, @"\w{3}@\w+.com", "abc@def.com", RegexOptions.None, 0, 11, true, "abc@def.com" };
- yield return new object[] { engine, @"\w{0,3}@\w+.com", "abc@def.com", RegexOptions.None, 0, 11, true, "abc@def.com" };
- yield return new object[] { engine, @"\w{0,2}c@\w+.com", "abc@def.com", RegexOptions.None, 0, 11, true, "abc@def.com" };
- yield return new object[] { engine, @"\w*@\w+.com", "abc@def.com", RegexOptions.None, 0, 11, true, "abc@def.com" };
- yield return new object[] { engine, @"(\w+)@\w+.com", "abc@def.com", RegexOptions.None, 0, 11, true, "abc@def.com" };
- yield return new object[] { engine, @"((\w+))@\w+.com", "abc@def.com", RegexOptions.None, 0, 11, true, "abc@def.com" };
- yield return new object[] { engine, @"(\w+)c@\w+.com", "abc@def.comabcdef", RegexOptions.None, 0, 17, true, "abc@def.com" };
+ yield return (@"a+", "aaa", RegexOptions.None, 0, 3, true, "aaa");
+ yield return (@"a+\d+", "a1", RegexOptions.None, 0, 2, true, "a1");
+ yield return (@".+\d+", "a1", RegexOptions.None, 0, 2, true, "a1");
+ yield return (".+\nabc", "a\nabc", RegexOptions.None, 0, 5, true, "a\nabc");
+ yield return (@"\d+", "abcd123efg", RegexOptions.None, 0, 10, true, "123");
+ yield return (@"\d+\d+", "abcd123efg", RegexOptions.None, 0, 10, true, "123");
+ yield return (@"\w+123\w+", "abcd123efg", RegexOptions.None, 0, 10, true, "abcd123efg");
+ yield return (@"\d+\w+", "abcd123efg", RegexOptions.None, 0, 10, true, "123efg");
+ yield return (@"\w+@\w+.com", "abc@def.com", RegexOptions.None, 0, 11, true, "abc@def.com");
+ yield return (@"\w{3,}@\w+.com", "abc@def.com", RegexOptions.None, 0, 11, true, "abc@def.com");
+ yield return (@"\w{4,}@\w+.com", "abc@def.com", RegexOptions.None, 0, 11, false, string.Empty);
+ yield return (@"\w{2,5}@\w+.com", "abc@def.com", RegexOptions.None, 0, 11, true, "abc@def.com");
+ yield return (@"\w{3}@\w+.com", "abc@def.com", RegexOptions.None, 0, 11, true, "abc@def.com");
+ yield return (@"\w{0,3}@\w+.com", "abc@def.com", RegexOptions.None, 0, 11, true, "abc@def.com");
+ yield return (@"\w{0,2}c@\w+.com", "abc@def.com", RegexOptions.None, 0, 11, true, "abc@def.com");
+ yield return (@"\w*@\w+.com", "abc@def.com", RegexOptions.None, 0, 11, true, "abc@def.com");
+ yield return (@"(\w+)@\w+.com", "abc@def.com", RegexOptions.None, 0, 11, true, "abc@def.com");
+ yield return (@"((\w+))@\w+.com", "abc@def.com", RegexOptions.None, 0, 11, true, "abc@def.com");
+ yield return (@"(\w+)c@\w+.com", "abc@def.comabcdef", RegexOptions.None, 0, 17, true, "abc@def.com");
if (!RegexHelpers.IsNonBacktracking(engine))
{
- yield return new object[] { engine, @"(\w+)c@\w+.com\1", "abc@def.comabcdef", RegexOptions.None, 0, 17, true, "abc@def.comab" };
- yield return new object[] { engine, @"(\w+)@def.com\1", "abc@def.comab", RegexOptions.None, 0, 13, false, string.Empty };
- yield return new object[] { engine, @"(\w+)@def.com\1", "abc@def.combc", RegexOptions.None, 0, 13, true, "bc@def.combc" };
- yield return new object[] { engine, @"(\w*)@def.com\1", "abc@def.com", RegexOptions.None, 0, 11, true, "@def.com" };
- yield return new object[] { engine, @"\w+(?<!a)", "a", RegexOptions.None, 0, 1, false, string.Empty };
- yield return new object[] { engine, @"\w+(?<!a)", "aa", RegexOptions.None, 0, 2, false, string.Empty };
- yield return new object[] { engine, @"(?>\w+)(?<!a)", "a", RegexOptions.None, 0, 1, false, string.Empty };
- yield return new object[] { engine, @"(?>\w+)(?<!a)", "aa", RegexOptions.None, 0, 2, false, string.Empty };
+ yield return (@"(\w+)c@\w+.com\1", "abc@def.comabcdef", RegexOptions.None, 0, 17, true, "abc@def.comab");
+ yield return (@"(\w+)@def.com\1", "abc@def.comab", RegexOptions.None, 0, 13, false, string.Empty);
+ yield return (@"(\w+)@def.com\1", "abc@def.combc", RegexOptions.None, 0, 13, true, "bc@def.combc");
+ yield return (@"(\w*)@def.com\1", "abc@def.com", RegexOptions.None, 0, 11, true, "@def.com");
+ yield return (@"\w+(?<!a)", "a", RegexOptions.None, 0, 1, false, string.Empty);
+ yield return (@"\w+(?<!a)", "aa", RegexOptions.None, 0, 2, false, string.Empty);
+ yield return (@"(?>\w+)(?<!a)", "a", RegexOptions.None, 0, 1, false, string.Empty);
+ yield return (@"(?>\w+)(?<!a)", "aa", RegexOptions.None, 0, 2, false, string.Empty);
}
- yield return new object[] { engine, @".+a", "baa", RegexOptions.None, 0, 3, true, "baa" };
- yield return new object[] { engine, @"[ab]+a", "cacbaac", RegexOptions.None, 0, 7, true, "baa" };
- yield return new object[] { engine, @"^(\d{2,3}){2}$", "1234", RegexOptions.None, 0, 4, true, "1234" };
- yield return new object[] { engine, @"(\d{2,3}){2}", "1234", RegexOptions.None, 0, 4, true, "1234" };
- yield return new object[] { engine, @"((\d{2,3})){2}", "1234", RegexOptions.None, 0, 4, true, "1234" };
+ yield return (@".+a", "baa", RegexOptions.None, 0, 3, true, "baa");
+ yield return (@"[ab]+a", "cacbaac", RegexOptions.None, 0, 7, true, "baa");
+ yield return (@"^(\d{2,3}){2}$", "1234", RegexOptions.None, 0, 4, true, "1234");
+ yield return (@"(\d{2,3}){2}", "1234", RegexOptions.None, 0, 4, true, "1234");
+ yield return (@"((\d{2,3})){2}", "1234", RegexOptions.None, 0, 4, true, "1234");
if (!RegexHelpers.IsNonBacktracking(engine))
{
- yield return new object[] { engine, @"(\d{2,3})+", "1234", RegexOptions.None, 0, 4, true, "123" };
- yield return new object[] { engine, @"(\d{2,3})*", "123456", RegexOptions.None, 0, 4, true, "123" };
+ yield return (@"(\d{2,3})+", "1234", RegexOptions.None, 0, 4, true, "123");
+ yield return (@"(\d{2,3})*", "123456", RegexOptions.None, 0, 4, true, "123");
}
else
{
// In NonBacktracking engine the alternation in the inner loop allows the alternate longer eager match of \d{2}\d{2}
- yield return new object[] { engine, @"(\d{2,3})+", "1234", RegexOptions.None, 0, 4, true, "1234" };
- yield return new object[] { engine, @"(\d{2,3})*", "123456", RegexOptions.None, 0, 4, true, "1234" };
+ yield return (@"(\d{2,3})+", "1234", RegexOptions.None, 0, 4, true, "1234");
+ yield return (@"(\d{2,3})*", "123456", RegexOptions.None, 0, 4, true, "1234");
}
- yield return new object[] { engine, @"(abc\d{2,3}){2}", "abc123abc4567", RegexOptions.None, 0, 12, true, "abc123abc456" };
+ yield return (@"(abc\d{2,3}){2}", "abc123abc4567", RegexOptions.None, 0, 12, true, "abc123abc456");
foreach (RegexOptions lineOption in new[] { RegexOptions.None, RegexOptions.Singleline, RegexOptions.Multiline })
{
- yield return new object[] { engine, @".*", "abc", lineOption, 1, 2, true, "bc" };
- yield return new object[] { engine, @".*c", "abc", lineOption, 1, 2, true, "bc" };
- yield return new object[] { engine, @"b.*", "abc", lineOption, 1, 2, true, "bc" };
- yield return new object[] { engine, @".*", "abc", lineOption, 2, 1, true, "c" };
+ yield return (@".*", "abc", lineOption, 1, 2, true, "bc");
+ yield return (@".*c", "abc", lineOption, 1, 2, true, "bc");
+ yield return (@"b.*", "abc", lineOption, 1, 2, true, "bc");
+ yield return (@".*", "abc", lineOption, 2, 1, true, "c");
}
// Using beginning/end of string chars \A, \Z: Actual - "\\Aaaa\\w+zzz\\Z"
- yield return new object[] { engine, @"\Aaaa\w+zzz\Z", "aaaasdfajsdlfjzzz", RegexOptions.IgnoreCase, 0, 17, true, "aaaasdfajsdlfjzzz" };
- yield return new object[] { engine, @"\Aaaaaa\w+zzz\Z", "aaaa", RegexOptions.IgnoreCase, 0, 4, false, string.Empty };
+ yield return (@"\Aaaa\w+zzz\Z", "aaaasdfajsdlfjzzz", RegexOptions.IgnoreCase, 0, 17, true, "aaaasdfajsdlfjzzz");
+ yield return (@"\Aaaaaa\w+zzz\Z", "aaaa", RegexOptions.IgnoreCase, 0, 4, false, string.Empty);
if (!RegexHelpers.IsNonBacktracking(engine))
{
- yield return new object[] { engine, @"\Aaaaaa\w+zzz\Z", "aaaa", RegexOptions.RightToLeft, 0, 4, false, string.Empty };
- yield return new object[] { engine, @"\Aaaaaa\w+zzzzz\Z", "aaaa", RegexOptions.RightToLeft, 0, 4, false, string.Empty };
- yield return new object[] { engine, @"\Aaaaaa\w+zzz\Z", "aaaa", RegexOptions.RightToLeft | RegexOptions.IgnoreCase, 0, 4, false, string.Empty };
+ yield return (@"\Aaaaaa\w+zzz\Z", "aaaa", RegexOptions.RightToLeft, 0, 4, false, string.Empty);
+ yield return (@"\Aaaaaa\w+zzzzz\Z", "aaaa", RegexOptions.RightToLeft, 0, 4, false, string.Empty);
+ yield return (@"\Aaaaaa\w+zzz\Z", "aaaa", RegexOptions.RightToLeft | RegexOptions.IgnoreCase, 0, 4, false, string.Empty);
}
- yield return new object[] { engine, @"abc\Adef", "abcdef", RegexOptions.None, 0, 0, false, string.Empty };
- yield return new object[] { engine, @"abc\adef", "abcdef", RegexOptions.None, 0, 0, false, string.Empty };
+ yield return (@"abc\Adef", "abcdef", RegexOptions.None, 0, 0, false, string.Empty);
+ yield return (@"abc\adef", "abcdef", RegexOptions.None, 0, 0, false, string.Empty);
if (!RegexHelpers.IsNonBacktracking(engine))
{
- yield return new object[] { engine, @"abc\Gdef", "abcdef", RegexOptions.None, 0, 0, false, string.Empty };
+ yield return (@"abc\Gdef", "abcdef", RegexOptions.None, 0, 0, false, string.Empty);
}
- yield return new object[] { engine, @"abc^def", "abcdef", RegexOptions.None, 0, 0, false, string.Empty };
- yield return new object[] { engine, @"abc\Zef", "abcdef", RegexOptions.None, 0, 0, false, string.Empty };
- yield return new object[] { engine, @"abc\zef", "abcdef", RegexOptions.None, 0, 0, false, string.Empty };
+ yield return (@"abc^def", "abcdef", RegexOptions.None, 0, 0, false, string.Empty);
+ yield return (@"abc\Zef", "abcdef", RegexOptions.None, 0, 0, false, string.Empty);
+ yield return (@"abc\zef", "abcdef", RegexOptions.None, 0, 0, false, string.Empty);
// Using beginning/end of string chars \A, \Z: Actual - "\\Aaaa\\w+zzz\\Z"
- yield return new object[] { engine, @"\Aaaa\w+zzz\Z", "aaaasdfajsdlfjzzza", RegexOptions.None, 0, 18, false, string.Empty };
+ yield return (@"\Aaaa\w+zzz\Z", "aaaasdfajsdlfjzzza", RegexOptions.None, 0, 18, false, string.Empty);
// Anchors and multiline
- yield return new object[] { engine, @"^A$", "ABC\n", RegexOptions.Multiline, 0, 2, false, string.Empty };
+ yield return (@"^A$", "ABC\n", RegexOptions.Multiline, 0, 2, false, string.Empty);
// Using beginning/end of string chars \A, \Z: Actual - "\\Aaaa\\w+zzz\\Z"
- yield return new object[] { engine, @"\A(line2\n)line3\Z", "line2\nline3\n", RegexOptions.Multiline, 0, 12, true, "line2\nline3" };
+ yield return (@"\A(line2\n)line3\Z", "line2\nline3\n", RegexOptions.Multiline, 0, 12, true, "line2\nline3");
// Using beginning/end of string chars ^: Actual - "^b"
- yield return new object[] { engine, "^b", "ab", RegexOptions.None, 0, 2, false, string.Empty };
+ yield return ("^b", "ab", RegexOptions.None, 0, 2, false, string.Empty);
if (!RegexHelpers.IsNonBacktracking(engine))
{
// Actual - "(?<char>\\w)\\<char>"
- yield return new object[] { engine, @"(?<char>\w)\<char>", "aa", RegexOptions.None, 0, 2, true, "aa" };
+ yield return (@"(?<char>\w)\<char>", "aa", RegexOptions.None, 0, 2, true, "aa");
// Actual - "(?<43>\\w)\\43"
- yield return new object[] { engine, @"(?<43>\w)\43", "aa", RegexOptions.None, 0, 2, true, "aa" };
+ yield return (@"(?<43>\w)\43", "aa", RegexOptions.None, 0, 2, true, "aa");
// Actual - "abc(?(1)111|222)"
- yield return new object[] { engine, "(abbc)(?(1)111|222)", "abbc222", RegexOptions.None, 0, 7, false, string.Empty };
+ yield return ("(abbc)(?(1)111|222)", "abbc222", RegexOptions.None, 0, 7, false, string.Empty);
}
// "x" option. Removes unescaped whitespace from the pattern: Actual - " ([^/]+) ","x"
- yield return new object[] { engine, " ((.)+) #comment ", "abc", RegexOptions.IgnorePatternWhitespace, 0, 3, true, "abc" };
+ yield return (" ((.)+) #comment ", "abc", RegexOptions.IgnorePatternWhitespace, 0, 3, true, "abc");
// "x" option. Removes unescaped whitespace from the pattern. : Actual - "\x20([^/]+)\x20","x"
- yield return new object[] { engine, "\x20([^/]+)\x20\x20\x20\x20\x20\x20\x20", " abc ", RegexOptions.IgnorePatternWhitespace, 0, 10, true, " abc " };
+ yield return ("\x20([^/]+)\x20\x20\x20\x20\x20\x20\x20", " abc ", RegexOptions.IgnorePatternWhitespace, 0, 10, true, " abc ");
// Turning on case insensitive option in mid-pattern : Actual - "aaa(?i:match this)bbb"
if ("i".ToUpper() == "I")
{
- yield return new object[] { engine, "aaa(?i:match this)bbb", "aaaMaTcH ThIsbbb", RegexOptions.None, 0, 16, true, "aaaMaTcH ThIsbbb" };
+ yield return ("aaa(?i:match this)bbb", "aaaMaTcH ThIsbbb", RegexOptions.None, 0, 16, true, "aaaMaTcH ThIsbbb");
}
// Turning off case insensitive option in mid-pattern : Actual - "aaa(?-i:match this)bbb", "i"
- yield return new object[] { engine, "aAa(?-i:match this)bbb", "AaAmatch thisBBb", RegexOptions.IgnoreCase, 0, 16, true, "AaAmatch thisBBb" };
+ yield return ("aAa(?-i:match this)bbb", "AaAmatch thisBBb", RegexOptions.IgnoreCase, 0, 16, true, "AaAmatch thisBBb");
// Turning on/off all the options at once : Actual - "aaa(?imnsx-imnsx:match this)bbb", "i"
- yield return new object[] { engine, "aaa(?imnsx-imnsx:match this)bbb", "AaAmatcH thisBBb", RegexOptions.IgnoreCase, 0, 16, false, string.Empty };
+ yield return ("aaa(?imnsx-imnsx:match this)bbb", "AaAmatcH thisBBb", RegexOptions.IgnoreCase, 0, 16, false, string.Empty);
// Actual - "aaa(?#ignore this completely)bbb"
- yield return new object[] { engine, "aAa(?#ignore this completely)bbb", "aAabbb", RegexOptions.None, 0, 6, true, "aAabbb" };
+ yield return ("aAa(?#ignore this completely)bbb", "aAabbb", RegexOptions.None, 0, 6, true, "aAabbb");
// Trying empty string: Actual "[a-z0-9]+", ""
- yield return new object[] { engine, "[a-z0-9]+", "", RegexOptions.None, 0, 0, false, string.Empty };
+ yield return ("[a-z0-9]+", "", RegexOptions.None, 0, 0, false, string.Empty);
// Numbering pattern slots: "(?<1>\\d{3})(?<2>\\d{3})(?<3>\\d{4})"
- yield return new object[] { engine, @"(?<1>\d{3})(?<2>\d{3})(?<3>\d{4})", "8885551111", RegexOptions.None, 0, 10, true, "8885551111" };
- yield return new object[] { engine, @"(?<1>\d{3})(?<2>\d{3})(?<3>\d{4})", "Invalid string", RegexOptions.None, 0, 14, false, string.Empty };
+ yield return (@"(?<1>\d{3})(?<2>\d{3})(?<3>\d{4})", "8885551111", RegexOptions.None, 0, 10, true, "8885551111");
+ yield return (@"(?<1>\d{3})(?<2>\d{3})(?<3>\d{4})", "Invalid string", RegexOptions.None, 0, 14, false, string.Empty);
// Not naming pattern slots at all: "^(cat|chat)"
- yield return new object[] { engine, "^(cat|chat)", "cats are bad", RegexOptions.None, 0, 12, true, "cat" };
+ yield return ("^(cat|chat)", "cats are bad", RegexOptions.None, 0, 12, true, "cat");
- yield return new object[] { engine, "abc", "abc", RegexOptions.None, 0, 3, true, "abc" };
- yield return new object[] { engine, "abc", "aBc", RegexOptions.None, 0, 3, false, string.Empty };
- yield return new object[] { engine, "abc", "aBc", RegexOptions.IgnoreCase, 0, 3, true, "aBc" };
- yield return new object[] { engine, @"abc.*def", "abcghiDEF", RegexOptions.IgnoreCase, 0, 9, true, "abcghiDEF" };
+ yield return ("abc", "abc", RegexOptions.None, 0, 3, true, "abc");
+ yield return ("abc", "aBc", RegexOptions.None, 0, 3, false, string.Empty);
+ yield return ("abc", "aBc", RegexOptions.IgnoreCase, 0, 3, true, "aBc");
+ yield return (@"abc.*def", "abcghiDEF", RegexOptions.IgnoreCase, 0, 9, true, "abcghiDEF");
// Using *, +, ?, {}: Actual - "a+\\.?b*\\.?c{2}"
- yield return new object[] { engine, @"a+\.?b*\.+c{2}", "ab.cc", RegexOptions.None, 0, 5, true, "ab.cc" };
- yield return new object[] { engine, @"[^a]+\.[^z]+", "zzzzz", RegexOptions.None, 0, 5, false, string.Empty };
+ yield return (@"a+\.?b*\.+c{2}", "ab.cc", RegexOptions.None, 0, 5, true, "ab.cc");
+ yield return (@"[^a]+\.[^z]+", "zzzzz", RegexOptions.None, 0, 5, false, string.Empty);
// IgnoreCase
- yield return new object[] { engine, "AAA", "aaabbb", RegexOptions.IgnoreCase, 0, 6, true, "aaa" };
- yield return new object[] { engine, @"\p{Lu}", "1bc", RegexOptions.IgnoreCase, 0, 3, true, "b" };
- yield return new object[] { engine, @"\p{Ll}", "1bc", RegexOptions.IgnoreCase, 0, 3, true, "b" };
- yield return new object[] { engine, @"\p{Lt}", "1bc", RegexOptions.IgnoreCase, 0, 3, true, "b" };
- yield return new object[] { engine, @"\p{Lo}", "1bc", RegexOptions.IgnoreCase, 0, 3, false, string.Empty };
+ yield return ("AAA", "aaabbb", RegexOptions.IgnoreCase, 0, 6, true, "aaa");
+ yield return (@"\p{Lu}", "1bc", RegexOptions.IgnoreCase, 0, 3, true, "b");
+ yield return (@"\p{Ll}", "1bc", RegexOptions.IgnoreCase, 0, 3, true, "b");
+ yield return (@"\p{Lt}", "1bc", RegexOptions.IgnoreCase, 0, 3, true, "b");
+ yield return (@"\p{Lo}", "1bc", RegexOptions.IgnoreCase, 0, 3, false, string.Empty);
// "\D+"
- yield return new object[] { engine, @"\D+", "12321", RegexOptions.None, 0, 5, false, string.Empty };
+ yield return (@"\D+", "12321", RegexOptions.None, 0, 5, false, string.Empty);
// Groups
- yield return new object[] { engine, "(?<first_name>\\S+)\\s(?<last_name>\\S+)", "David Bau", RegexOptions.None, 0, 9, true, "David Bau" };
+ yield return ("(?<first_name>\\S+)\\s(?<last_name>\\S+)", "David Bau", RegexOptions.None, 0, 9, true, "David Bau");
// "^b"
- yield return new object[] { engine, "^b", "abc", RegexOptions.None, 0, 3, false, string.Empty };
+ yield return ("^b", "abc", RegexOptions.None, 0, 3, false, string.Empty);
// Trim leading and trailing whitespace
- yield return new object[] { engine, @"\s*(.*?)\s*$", " Hello World ", RegexOptions.None, 0, 13, true, " Hello World " };
+ yield return (@"\s*(.*?)\s*$", " Hello World ", RegexOptions.None, 0, 13, true, " Hello World ");
if (!RegexHelpers.IsNonBacktracking(engine))
{
// Throws NotSupported with NonBacktracking engine because of the balancing group dog-0
- yield return new object[] { engine, @"(?<cat>cat)\w+(?<dog-0>dog)", "cat_Hello_World_dog", RegexOptions.None, 0, 19, false, string.Empty };
+ yield return (@"(?<cat>cat)\w+(?<dog-0>dog)", "cat_Hello_World_dog", RegexOptions.None, 0, 19, false, string.Empty);
}
// Atomic Zero-Width Assertions \A \Z \z \b \B
- yield return new object[] { engine, @"\A(cat)\s+(dog)", "cat \n\n\ncat dog", RegexOptions.None, 0, 20, false, string.Empty };
- yield return new object[] { engine, @"\A(cat)\s+(dog)", "cat \n\n\ncat dog", RegexOptions.Multiline, 0, 20, false, string.Empty };
+ yield return (@"\A(cat)\s+(dog)", "cat \n\n\ncat dog", RegexOptions.None, 0, 20, false, string.Empty);
+ yield return (@"\A(cat)\s+(dog)", "cat \n\n\ncat dog", RegexOptions.Multiline, 0, 20, false, string.Empty);
if (!RegexHelpers.IsNonBacktracking(engine))
{
- yield return new object[] { engine, @"\A(cat)\s+(dog)", "cat \n\n\ncat dog", RegexOptions.ECMAScript, 0, 20, false, string.Empty };
+ yield return (@"\A(cat)\s+(dog)", "cat \n\n\ncat dog", RegexOptions.ECMAScript, 0, 20, false, string.Empty);
}
- yield return new object[] { engine, @"(cat)\s+(dog)\Z", "cat dog\n\n\ncat", RegexOptions.None, 0, 15, false, string.Empty };
- yield return new object[] { engine, @"(cat)\s+(dog)\Z", "cat dog\n\n\ncat ", RegexOptions.Multiline, 0, 20, false, string.Empty };
+ yield return (@"(cat)\s+(dog)\Z", "cat dog\n\n\ncat", RegexOptions.None, 0, 15, false, string.Empty);
+ yield return (@"(cat)\s+(dog)\Z", "cat dog\n\n\ncat ", RegexOptions.Multiline, 0, 20, false, string.Empty);
if (!RegexHelpers.IsNonBacktracking(engine))
{
- yield return new object[] { engine, @"(cat)\s+(dog)\Z", "cat dog\n\n\ncat ", RegexOptions.ECMAScript, 0, 20, false, string.Empty };
+ yield return (@"(cat)\s+(dog)\Z", "cat dog\n\n\ncat ", RegexOptions.ECMAScript, 0, 20, false, string.Empty);
}
- yield return new object[] { engine, @"(cat)\s+(dog)\z", "cat dog\n\n\ncat", RegexOptions.None, 0, 15, false, string.Empty };
- yield return new object[] { engine, @"(cat)\s+(dog)\z", "cat dog\n\n\ncat ", RegexOptions.Multiline, 0, 20, false, string.Empty };
+ yield return (@"(cat)\s+(dog)\z", "cat dog\n\n\ncat", RegexOptions.None, 0, 15, false, string.Empty);
+ yield return (@"(cat)\s+(dog)\z", "cat dog\n\n\ncat ", RegexOptions.Multiline, 0, 20, false, string.Empty);
if (!RegexHelpers.IsNonBacktracking(engine))
{
- yield return new object[] { engine, @"(cat)\s+(dog)\z", "cat dog\n\n\ncat ", RegexOptions.ECMAScript, 0, 20, false, string.Empty };
+ yield return (@"(cat)\s+(dog)\z", "cat dog\n\n\ncat ", RegexOptions.ECMAScript, 0, 20, false, string.Empty);
}
- yield return new object[] { engine, @"(cat)\s+(dog)\z", "cat \n\n\n dog\n", RegexOptions.None, 0, 16, false, string.Empty };
- yield return new object[] { engine, @"(cat)\s+(dog)\z", "cat \n\n\n dog\n", RegexOptions.Multiline, 0, 16, false, string.Empty };
+ yield return (@"(cat)\s+(dog)\z", "cat \n\n\n dog\n", RegexOptions.None, 0, 16, false, string.Empty);
+ yield return (@"(cat)\s+(dog)\z", "cat \n\n\n dog\n", RegexOptions.Multiline, 0, 16, false, string.Empty);
if (!RegexHelpers.IsNonBacktracking(engine))
{
- yield return new object[] { engine, @"(cat)\s+(dog)\z", "cat \n\n\n dog\n", RegexOptions.ECMAScript, 0, 16, false, string.Empty };
+ yield return (@"(cat)\s+(dog)\z", "cat \n\n\n dog\n", RegexOptions.ECMAScript, 0, 16, false, string.Empty);
}
- yield return new object[] { engine, @"\b@cat", "123START123;@catEND", RegexOptions.None, 0, 19, false, string.Empty };
- yield return new object[] { engine, @"\b<cat", "123START123'<catEND", RegexOptions.None, 0, 19, false, string.Empty };
- yield return new object[] { engine, @"\b,cat", "satwe,,,START',catEND", RegexOptions.None, 0, 21, false, string.Empty };
- yield return new object[] { engine, @"\b\[cat", "`12START123'[catEND", RegexOptions.None, 0, 19, false, string.Empty };
+ yield return (@"\b@cat", "123START123;@catEND", RegexOptions.None, 0, 19, false, string.Empty);
+ yield return (@"\b<cat", "123START123'<catEND", RegexOptions.None, 0, 19, false, string.Empty);
+ yield return (@"\b,cat", "satwe,,,START',catEND", RegexOptions.None, 0, 21, false, string.Empty);
+ yield return (@"\b\[cat", "`12START123'[catEND", RegexOptions.None, 0, 19, false, string.Empty);
- yield return new object[] { engine, @"\B@cat", "123START123@catEND", RegexOptions.None, 0, 18, false, string.Empty };
- yield return new object[] { engine, @"\B<cat", "123START123<catEND", RegexOptions.None, 0, 18, false, string.Empty };
- yield return new object[] { engine, @"\B,cat", "satwe,,,START,catEND", RegexOptions.None, 0, 20, false, string.Empty };
- yield return new object[] { engine, @"\B\[cat", "`12START123[catEND", RegexOptions.None, 0, 18, false, string.Empty };
+ yield return (@"\B@cat", "123START123@catEND", RegexOptions.None, 0, 18, false, string.Empty);
+ yield return (@"\B<cat", "123START123<catEND", RegexOptions.None, 0, 18, false, string.Empty);
+ yield return (@"\B,cat", "satwe,,,START,catEND", RegexOptions.None, 0, 20, false, string.Empty);
+ yield return (@"\B\[cat", "`12START123[catEND", RegexOptions.None, 0, 18, false, string.Empty);
// Lazy operator Backtracking
- yield return new object[] { engine, @"http://([a-zA-z0-9\-]*\.?)*?(:[0-9]*)??/", "http://www.msn.com", RegexOptions.IgnoreCase, 0, 18, false, string.Empty };
+ yield return (@"http://([a-zA-z0-9\-]*\.?)*?(:[0-9]*)??/", "http://www.msn.com", RegexOptions.IgnoreCase, 0, 18, false, string.Empty);
// Grouping Constructs Invalid Regular Expressions
if (!RegexHelpers.IsNonBacktracking(engine))
{
- yield return new object[] { engine, "(?!)", "(?!)cat", RegexOptions.None, 0, 7, false, string.Empty };
- yield return new object[] { engine, "(?<!)", "(?<!)cat", RegexOptions.None, 0, 8, false, string.Empty };
+ yield return ("(?!)", "(?!)cat", RegexOptions.None, 0, 7, false, string.Empty);
+ yield return ("(?<!)", "(?<!)cat", RegexOptions.None, 0, 8, false, string.Empty);
}
// Alternation construct
- yield return new object[] { engine, "[^a-z0-9]etag|[^a-z0-9]digest", "this string has .digest as a substring", RegexOptions.None, 16, 7, true, ".digest" };
+ yield return ("[^a-z0-9]etag|[^a-z0-9]digest", "this string has .digest as a substring", RegexOptions.None, 16, 7, true, ".digest");
if (!RegexHelpers.IsNonBacktracking(engine))
{
- yield return new object[] { engine, "(?(dog2))", "dog2", RegexOptions.None, 0, 4, true, string.Empty };
- yield return new object[] { engine, "(?(a:b))", "a", RegexOptions.None, 0, 1, true, string.Empty };
- yield return new object[] { engine, "(?(a:))", "a", RegexOptions.None, 0, 1, true, string.Empty };
- yield return new object[] { engine, "(?(cat)|dog)", "cat", RegexOptions.None, 0, 3, true, string.Empty };
- yield return new object[] { engine, "(?(cat)|dog)", "catdog", RegexOptions.None, 0, 6, true, string.Empty };
- yield return new object[] { engine, "(?(cat)|dog)", "oof", RegexOptions.None, 0, 3, false, string.Empty };
- yield return new object[] { engine, "(?(cat)dog1|dog2)", "catdog1", RegexOptions.None, 0, 7, false, string.Empty };
- yield return new object[] { engine, "(?(cat)dog1|dog2)", "catdog2", RegexOptions.None, 0, 7, true, "dog2" };
- yield return new object[] { engine, "(?(cat)dog1|dog2)", "catdog1dog2", RegexOptions.None, 0, 11, true, "dog2" };
+ yield return ("(?(dog2))", "dog2", RegexOptions.None, 0, 4, true, string.Empty);
+ yield return ("(?(a:b))", "a", RegexOptions.None, 0, 1, true, string.Empty);
+ yield return ("(?(a:))", "a", RegexOptions.None, 0, 1, true, string.Empty);
+ yield return ("(?(cat)|dog)", "cat", RegexOptions.None, 0, 3, true, string.Empty);
+ yield return ("(?(cat)|dog)", "catdog", RegexOptions.None, 0, 6, true, string.Empty);
+ yield return ("(?(cat)|dog)", "oof", RegexOptions.None, 0, 3, false, string.Empty);
+ yield return ("(?(cat)dog1|dog2)", "catdog1", RegexOptions.None, 0, 7, false, string.Empty);
+ yield return ("(?(cat)dog1|dog2)", "catdog2", RegexOptions.None, 0, 7, true, "dog2");
+ yield return ("(?(cat)dog1|dog2)", "catdog1dog2", RegexOptions.None, 0, 11, true, "dog2");
}
// No Negation
- yield return new object[] { engine, "[abcd-[abcd]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, "[1234-[1234]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
+ yield return ("[abcd-[abcd]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return ("[1234-[1234]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
// All Negation
- yield return new object[] { engine, "[^abcd-[^abcd]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, "[^1234-[^1234]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
+ yield return ("[^abcd-[^abcd]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return ("[^1234-[^1234]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
// No Negation
- yield return new object[] { engine, "[a-z-[a-z]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, "[0-9-[0-9]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
+ yield return ("[a-z-[a-z]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return ("[0-9-[0-9]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
// All Negation
- yield return new object[] { engine, "[^a-z-[^a-z]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, "[^0-9-[^0-9]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
+ yield return ("[^a-z-[^a-z]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return ("[^0-9-[^0-9]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
// No Negation
- yield return new object[] { engine, @"[\w-[\w]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[\W-[\W]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[\s-[\s]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[\S-[\S]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[\d-[\d]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[\D-[\D]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
+ yield return (@"[\w-[\w]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[\W-[\W]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[\s-[\s]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[\S-[\S]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[\d-[\d]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[\D-[\D]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
// All Negation
- yield return new object[] { engine, @"[^\w-[^\w]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[^\W-[^\W]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[^\s-[^\s]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[^\S-[^\S]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[^\d-[^\d]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[^\D-[^\D]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
+ yield return (@"[^\w-[^\w]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[^\W-[^\W]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[^\s-[^\s]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[^\S-[^\S]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[^\d-[^\d]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[^\D-[^\D]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
// MixedNegation
- yield return new object[] { engine, @"[^\w-[\W]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[\w-[^\W]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[^\s-[\S]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[\s-[^\S]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[^\d-[\D]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[\d-[^\D]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
+ yield return (@"[^\w-[\W]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[\w-[^\W]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[^\s-[\S]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[\s-[^\S]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[^\d-[\D]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[\d-[^\D]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
// No Negation
- yield return new object[] { engine, @"[\p{Ll}-[\p{Ll}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[\P{Ll}-[\P{Ll}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[\p{Lu}-[\p{Lu}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[\P{Lu}-[\P{Lu}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[\p{Nd}-[\p{Nd}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[\P{Nd}-[\P{Nd}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
+ yield return (@"[\p{Ll}-[\p{Ll}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[\P{Ll}-[\P{Ll}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[\p{Lu}-[\p{Lu}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[\P{Lu}-[\P{Lu}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[\p{Nd}-[\p{Nd}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[\P{Nd}-[\P{Nd}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
// All Negation
- yield return new object[] { engine, @"[^\p{Ll}-[^\p{Ll}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[^\P{Ll}-[^\P{Ll}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[^\p{Lu}-[^\p{Lu}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[^\P{Lu}-[^\P{Lu}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[^\p{Nd}-[^\p{Nd}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[^\P{Nd}-[^\P{Nd}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
+ yield return (@"[^\p{Ll}-[^\p{Ll}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[^\P{Ll}-[^\P{Ll}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[^\p{Lu}-[^\p{Lu}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[^\P{Lu}-[^\P{Lu}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[^\p{Nd}-[^\p{Nd}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[^\P{Nd}-[^\P{Nd}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
// MixedNegation
- yield return new object[] { engine, @"[^\p{Ll}-[\P{Ll}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[\p{Ll}-[^\P{Ll}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[^\p{Lu}-[\P{Lu}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[\p{Lu}-[^\P{Lu}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[^\p{Nd}-[\P{Nd}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
- yield return new object[] { engine, @"[\p{Nd}-[^\P{Nd}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty };
+ yield return (@"[^\p{Ll}-[\P{Ll}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[\p{Ll}-[^\P{Ll}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[^\p{Lu}-[\P{Lu}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[\p{Lu}-[^\P{Lu}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[^\p{Nd}-[\P{Nd}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
+ yield return (@"[\p{Nd}-[^\P{Nd}]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty);
// Character Class Substraction
- yield return new object[] { engine, @"[ab\-\[cd-[-[]]]]", "[]]", RegexOptions.None, 0, 3, false, string.Empty };
- yield return new object[] { engine, @"[ab\-\[cd-[-[]]]]", "-]]", RegexOptions.None, 0, 3, false, string.Empty };
- yield return new object[] { engine, @"[ab\-\[cd-[-[]]]]", "`]]", RegexOptions.None, 0, 3, false, string.Empty };
- yield return new object[] { engine, @"[ab\-\[cd-[-[]]]]", "e]]", RegexOptions.None, 0, 3, false, string.Empty };
- yield return new object[] { engine, @"[ab\-\[cd-[[]]]]", "']]", RegexOptions.None, 0, 3, false, string.Empty };
- yield return new object[] { engine, @"[ab\-\[cd-[[]]]]", "e]]", RegexOptions.None, 0, 3, false, string.Empty };
- yield return new object[] { engine, @"[a-[a-f]]", "abcdefghijklmnopqrstuvwxyz", RegexOptions.None, 0, 26, false, string.Empty };
+ yield return (@"[ab\-\[cd-[-[]]]]", "[]]", RegexOptions.None, 0, 3, false, string.Empty);
+ yield return (@"[ab\-\[cd-[-[]]]]", "-]]", RegexOptions.None, 0, 3, false, string.Empty);
+ yield return (@"[ab\-\[cd-[-[]]]]", "`]]", RegexOptions.None, 0, 3, false, string.Empty);
+ yield return (@"[ab\-\[cd-[-[]]]]", "e]]", RegexOptions.None, 0, 3, false, string.Empty);
+ yield return (@"[ab\-\[cd-[[]]]]", "']]", RegexOptions.None, 0, 3, false, string.Empty);
+ yield return (@"[ab\-\[cd-[[]]]]", "e]]", RegexOptions.None, 0, 3, false, string.Empty);
+ yield return (@"[a-[a-f]]", "abcdefghijklmnopqrstuvwxyz", RegexOptions.None, 0, 26, false, string.Empty);
// \c
if (!PlatformDetection.IsNetFramework) // missing fix for https://github.com/dotnet/runtime/issues/24759
{
- yield return new object[] { engine, @"(cat)(\c[*)(dog)", "asdlkcat\u00FFdogiwod", RegexOptions.None, 0, 15, false, string.Empty };
+ yield return (@"(cat)(\c[*)(dog)", "asdlkcat\u00FFdogiwod", RegexOptions.None, 0, 15, false, string.Empty);
}
// Surrogate pairs split up into UTF-16 code units.
- yield return new object[] { engine, @"(\uD82F[\uDCA0-\uDCA3])", "\uD82F\uDCA2", RegexOptions.CultureInvariant, 0, 2, true, "\uD82F\uDCA2" };
+ yield return (@"(\uD82F[\uDCA0-\uDCA3])", "\uD82F\uDCA2", RegexOptions.CultureInvariant, 0, 2, true, "\uD82F\uDCA2");
// Unicode text
foreach (RegexOptions options in new[] { RegexOptions.None, RegexOptions.RightToLeft, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant })
{
if (engine != RegexEngine.NonBacktracking || options != RegexOptions.RightToLeft)
{
- yield return new object[] { engine, "\u05D0\u05D1\u05D2\u05D3(\u05D4\u05D5|\u05D6\u05D7|\u05D8)", "abc\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5def", options, 3, 6, true, "\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5" };
- yield return new object[] { engine, "\u05D0(\u05D4\u05D5|\u05D6\u05D7|\u05D8)", "\u05D0\u05D8", options, 0, 2, true, "\u05D0\u05D8" };
- yield return new object[] { engine, "\u05D0(?:\u05D1|\u05D2|\u05D3)", "\u05D0\u05D2", options, 0, 2, true, "\u05D0\u05D2" };
- yield return new object[] { engine, "\u05D0(?:\u05D1|\u05D2|\u05D3)", "\u05D0\u05D4", options, 0, 0, false, "" };
+ yield return ("\u05D0\u05D1\u05D2\u05D3(\u05D4\u05D5|\u05D6\u05D7|\u05D8)", "abc\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5def", options, 3, 6, true, "\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5");
+ yield return ("\u05D0(\u05D4\u05D5|\u05D6\u05D7|\u05D8)", "\u05D0\u05D8", options, 0, 2, true, "\u05D0\u05D8");
+ yield return ("\u05D0(?:\u05D1|\u05D2|\u05D3)", "\u05D0\u05D2", options, 0, 2, true, "\u05D0\u05D2");
+ yield return ("\u05D0(?:\u05D1|\u05D2|\u05D3)", "\u05D0\u05D4", options, 0, 0, false, "");
}
}
// .* : Case sensitive
- yield return new object[] { engine, @".*\nfoo", "This shouldn't match", RegexOptions.None, 0, 20, false, "" };
- yield return new object[] { engine, @"a.*\nfoo", "This shouldn't match", RegexOptions.None, 0, 20, false, "" };
- yield return new object[] { engine, @".*\nFoo", $"\nFooThis should match", RegexOptions.None, 0, 21, true, "\nFoo" };
- yield return new object[] { engine, @".*\nfoo", "\nfooThis should match", RegexOptions.None, 4, 17, false, "" };
+ yield return (@".*\nfoo", "This shouldn't match", RegexOptions.None, 0, 20, false, "");
+ yield return (@"a.*\nfoo", "This shouldn't match", RegexOptions.None, 0, 20, false, "");
+ yield return (@".*\nFoo", $"\nFooThis should match", RegexOptions.None, 0, 21, true, "\nFoo");
+ yield return (@".*\nfoo", "\nfooThis should match", RegexOptions.None, 4, 17, false, "");
- yield return new object[] { engine, @".*\dfoo", "This shouldn't match", RegexOptions.None, 0, 20, false, "" };
- yield return new object[] { engine, @".*\dFoo", "This1Foo should match", RegexOptions.None, 0, 21, true, "This1Foo" };
- yield return new object[] { engine, @".*\dFoo", "This1foo should 2Foo match", RegexOptions.None, 0, 26, true, "This1foo should 2Foo" };
- yield return new object[] { engine, @".*\dFoo", "This1foo shouldn't 2foo match", RegexOptions.None, 0, 29, false, "" };
- yield return new object[] { engine, @".*\dfoo", "This1foo shouldn't 2foo match", RegexOptions.None, 24, 5, false, "" };
+ yield return (@".*\dfoo", "This shouldn't match", RegexOptions.None, 0, 20, false, "");
+ yield return (@".*\dFoo", "This1Foo should match", RegexOptions.None, 0, 21, true, "This1Foo");
+ yield return (@".*\dFoo", "This1foo should 2Foo match", RegexOptions.None, 0, 26, true, "This1foo should 2Foo");
+ yield return (@".*\dFoo", "This1foo shouldn't 2foo match", RegexOptions.None, 0, 29, false, "");
+ yield return (@".*\dfoo", "This1foo shouldn't 2foo match", RegexOptions.None, 24, 5, false, "");
- yield return new object[] { engine, @".*\dfoo", "1fooThis1foo should 1foo match", RegexOptions.None, 4, 9, true, "This1foo" };
- yield return new object[] { engine, @".*\dfoo", "This shouldn't match 1foo", RegexOptions.None, 0, 20, false, "" };
+ yield return (@".*\dfoo", "1fooThis1foo should 1foo match", RegexOptions.None, 4, 9, true, "This1foo");
+ yield return (@".*\dfoo", "This shouldn't match 1foo", RegexOptions.None, 0, 20, false, "");
// Turkish case sensitivity
- yield return new object[] { engine, @"[\u0120-\u0130]", "\u0130", RegexOptions.None, 0, 1, true, "\u0130" };
+ yield return (@"[\u0120-\u0130]", "\u0130", RegexOptions.None, 0, 1, true, "\u0130");
// .* : Case insensitive
- yield return new object[] { engine, @".*\nFoo", "\nfooThis should match", RegexOptions.IgnoreCase, 0, 21, true, "\nfoo" };
- yield return new object[] { engine, @".*\dFoo", "This1foo should match", RegexOptions.IgnoreCase, 0, 21, true, "This1foo" };
- yield return new object[] { engine, @".*\dFoo", "This1foo should 2FoO match", RegexOptions.IgnoreCase, 0, 26, true, "This1foo should 2FoO" };
- yield return new object[] { engine, @".*\dFoo", "This1Foo should 2fOo match", RegexOptions.IgnoreCase, 0, 26, true, "This1Foo should 2fOo" };
- yield return new object[] { engine, @".*\dfoo", "1fooThis1FOO should 1foo match", RegexOptions.IgnoreCase, 4, 9, true, "This1FOO" };
+ yield return (@".*\nFoo", "\nfooThis should match", RegexOptions.IgnoreCase, 0, 21, true, "\nfoo");
+ yield return (@".*\dFoo", "This1foo should match", RegexOptions.IgnoreCase, 0, 21, true, "This1foo");
+ yield return (@".*\dFoo", "This1foo should 2FoO match", RegexOptions.IgnoreCase, 0, 26, true, "This1foo should 2FoO");
+ yield return (@".*\dFoo", "This1Foo should 2fOo match", RegexOptions.IgnoreCase, 0, 26, true, "This1Foo should 2fOo");
+ yield return (@".*\dfoo", "1fooThis1FOO should 1foo match", RegexOptions.IgnoreCase, 4, 9, true, "This1FOO");
if (!RegexHelpers.IsNonBacktracking(engine))
{
// RightToLeft
- yield return new object[] { engine, @"foo\d+", "0123456789foo4567890foo ", RegexOptions.RightToLeft, 0, 32, true, "foo4567890" };
- yield return new object[] { engine, @"foo\d+", "0123456789foo4567890foo ", RegexOptions.RightToLeft, 10, 22, true, "foo4567890" };
- yield return new object[] { engine, @"foo\d+", "0123456789foo4567890foo ", RegexOptions.RightToLeft, 10, 4, true, "foo4" };
- yield return new object[] { engine, @"foo\d+", "0123456789foo4567890foo ", RegexOptions.RightToLeft, 10, 3, false, string.Empty };
- yield return new object[] { engine, @"foo\d+", "0123456789foo4567890foo ", RegexOptions.RightToLeft, 11, 21, false, string.Empty };
+ yield return (@"foo\d+", "0123456789foo4567890foo ", RegexOptions.RightToLeft, 0, 32, true, "foo4567890");
+ yield return (@"foo\d+", "0123456789foo4567890foo ", RegexOptions.RightToLeft, 10, 22, true, "foo4567890");
+ yield return (@"foo\d+", "0123456789foo4567890foo ", RegexOptions.RightToLeft, 10, 4, true, "foo4");
+ yield return (@"foo\d+", "0123456789foo4567890foo ", RegexOptions.RightToLeft, 10, 3, false, string.Empty);
+ yield return (@"foo\d+", "0123456789foo4567890foo ", RegexOptions.RightToLeft, 11, 21, false, string.Empty);
- yield return new object[] { engine, @"\s+\d+", "sdf 12sad", RegexOptions.RightToLeft, 0, 9, true, " 12" };
- yield return new object[] { engine, @"\s+\d+", " asdf12 ", RegexOptions.RightToLeft, 0, 6, false, string.Empty };
- yield return new object[] { engine, "aaa", "aaabbb", RegexOptions.None, 3, 3, false, string.Empty };
- yield return new object[] { engine, "abc|def", "123def456", RegexOptions.RightToLeft | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 9, true, "def" };
+ yield return (@"\s+\d+", "sdf 12sad", RegexOptions.RightToLeft, 0, 9, true, " 12");
+ yield return (@"\s+\d+", " asdf12 ", RegexOptions.RightToLeft, 0, 6, false, string.Empty);
+ yield return ("aaa", "aaabbb", RegexOptions.None, 3, 3, false, string.Empty);
+ yield return ("abc|def", "123def456", RegexOptions.RightToLeft | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 9, true, "def");
// .* : RTL, Case-sensitive
- yield return new object[] { engine, @".*\nfoo", "This shouldn't match", RegexOptions.None | RegexOptions.RightToLeft, 0, 20, false, "" };
- yield return new object[] { engine, @".*\nfoo", "This should matchfoo\n", RegexOptions.None | RegexOptions.RightToLeft, 4, 13, false, "" };
- yield return new object[] { engine, @"a.*\nfoo", "This shouldn't match", RegexOptions.None | RegexOptions.RightToLeft, 0, 20, false, "" };
- yield return new object[] { engine, @".*\nFoo", $"This should match\nFoo", RegexOptions.None | RegexOptions.RightToLeft, 0, 21, true, "This should match\nFoo" };
+ yield return (@".*\nfoo", "This shouldn't match", RegexOptions.None | RegexOptions.RightToLeft, 0, 20, false, "");
+ yield return (@".*\nfoo", "This should matchfoo\n", RegexOptions.None | RegexOptions.RightToLeft, 4, 13, false, "");
+ yield return (@"a.*\nfoo", "This shouldn't match", RegexOptions.None | RegexOptions.RightToLeft, 0, 20, false, "");
+ yield return (@".*\nFoo", $"This should match\nFoo", RegexOptions.None | RegexOptions.RightToLeft, 0, 21, true, "This should match\nFoo");
- yield return new object[] { engine, @".*\dfoo", "This shouldn't match", RegexOptions.None | RegexOptions.RightToLeft, 0, 20, false, "" };
- yield return new object[] { engine, @".*\dFoo", "This1Foo should match", RegexOptions.None | RegexOptions.RightToLeft, 0, 21, true, "This1Foo" };
- yield return new object[] { engine, @".*\dFoo", "This1foo should 2Foo match", RegexOptions.None | RegexOptions.RightToLeft, 0, 26, true, "This1foo should 2Foo" };
- yield return new object[] { engine, @".*\dFoo", "This1foo shouldn't 2foo match", RegexOptions.None | RegexOptions.RightToLeft, 0, 29, false, "" };
- yield return new object[] { engine, @".*\dfoo", "This1foo shouldn't 2foo match", RegexOptions.None | RegexOptions.RightToLeft, 19, 0, false, "" };
+ yield return (@".*\dfoo", "This shouldn't match", RegexOptions.None | RegexOptions.RightToLeft, 0, 20, false, "");
+ yield return (@".*\dFoo", "This1Foo should match", RegexOptions.None | RegexOptions.RightToLeft, 0, 21, true, "This1Foo");
+ yield return (@".*\dFoo", "This1foo should 2Foo match", RegexOptions.None | RegexOptions.RightToLeft, 0, 26, true, "This1foo should 2Foo");
+ yield return (@".*\dFoo", "This1foo shouldn't 2foo match", RegexOptions.None | RegexOptions.RightToLeft, 0, 29, false, "");
+ yield return (@".*\dfoo", "This1foo shouldn't 2foo match", RegexOptions.None | RegexOptions.RightToLeft, 19, 0, false, "");
- yield return new object[] { engine, @".*\dfoo", "1fooThis2foo should 1foo match", RegexOptions.None | RegexOptions.RightToLeft, 8, 4, true, "2foo" };
- yield return new object[] { engine, @".*\dfoo", "This shouldn't match 1foo", RegexOptions.None | RegexOptions.RightToLeft, 0, 20, false, "" };
+ yield return (@".*\dfoo", "1fooThis2foo should 1foo match", RegexOptions.None | RegexOptions.RightToLeft, 8, 4, true, "2foo");
+ yield return (@".*\dfoo", "This shouldn't match 1foo", RegexOptions.None | RegexOptions.RightToLeft, 0, 20, false, "");
// .* : RTL, case insensitive
- yield return new object[] { engine, @".*\nFoo", "\nfooThis should match", RegexOptions.IgnoreCase | RegexOptions.RightToLeft, 0, 21, true, "\nfoo" };
- yield return new object[] { engine, @".*\dFoo", "This1foo should match", RegexOptions.IgnoreCase | RegexOptions.RightToLeft, 0, 21, true, "This1foo" };
- yield return new object[] { engine, @".*\dFoo", "This1foo should 2FoO match", RegexOptions.IgnoreCase | RegexOptions.RightToLeft, 0, 26, true, "This1foo should 2FoO" };
- yield return new object[] { engine, @".*\dFoo", "This1Foo should 2fOo match", RegexOptions.IgnoreCase | RegexOptions.RightToLeft, 0, 26, true, "This1Foo should 2fOo" };
- yield return new object[] { engine, @".*\dfoo", "1fooThis2FOO should 1foo match", RegexOptions.IgnoreCase | RegexOptions.RightToLeft, 8, 4, true, "2FOO" };
+ yield return (@".*\nFoo", "\nfooThis should match", RegexOptions.IgnoreCase | RegexOptions.RightToLeft, 0, 21, true, "\nfoo");
+ yield return (@".*\dFoo", "This1foo should match", RegexOptions.IgnoreCase | RegexOptions.RightToLeft, 0, 21, true, "This1foo");
+ yield return (@".*\dFoo", "This1foo should 2FoO match", RegexOptions.IgnoreCase | RegexOptions.RightToLeft, 0, 26, true, "This1foo should 2FoO");
+ yield return (@".*\dFoo", "This1Foo should 2fOo match", RegexOptions.IgnoreCase | RegexOptions.RightToLeft, 0, 26, true, "This1Foo should 2fOo");
+ yield return (@".*\dfoo", "1fooThis2FOO should 1foo match", RegexOptions.IgnoreCase | RegexOptions.RightToLeft, 8, 4, true, "2FOO");
}
// [ActiveIssue("https://github.com/dotnet/runtime/issues/36149")]
//if (PlatformDetection.IsNetCore)
//{
// // Unicode symbols in character ranges. These are chars whose lowercase values cannot be found by using the offsets specified in s_lcTable.
- // yield return new object[] { engine, @"^(?i:[\u00D7-\u00D8])$", '\u00F7'.ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, false, "" };
- // yield return new object[] { engine, @"^(?i:[\u00C0-\u00DE])$", '\u00F7'.ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, false, "" };
- // yield return new object[] { engine, @"^(?i:[\u00C0-\u00DE])$", ((char)('\u00C0' + 32)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, true, ((char)('\u00C0' + 32)).ToString() };
- // yield return new object[] { engine, @"^(?i:[\u00C0-\u00DE])$", ((char)('\u00DE' + 32)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, true, ((char)('\u00DE' + 32)).ToString() };
- // yield return new object[] { engine, @"^(?i:[\u0391-\u03AB])$", ((char)('\u03A2' + 32)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, false, "" };
- // yield return new object[] { engine, @"^(?i:[\u0391-\u03AB])$", ((char)('\u0391' + 32)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, true, ((char)('\u0391' + 32)).ToString() };
- // yield return new object[] { engine, @"^(?i:[\u0391-\u03AB])$", ((char)('\u03AB' + 32)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, true, ((char)('\u03AB' + 32)).ToString() };
- // yield return new object[] { engine, @"^(?i:[\u1F18-\u1F1F])$", ((char)('\u1F1F' - 8)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, false, "" };
- // yield return new object[] { engine, @"^(?i:[\u1F18-\u1F1F])$", ((char)('\u1F18' - 8)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, true, ((char)('\u1F18' - 8)).ToString() };
- // yield return new object[] { engine, @"^(?i:[\u10A0-\u10C5])$", ((char)('\u10A0' + 7264)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, true, ((char)('\u10A0' + 7264)).ToString() };
- // yield return new object[] { engine, @"^(?i:[\u10A0-\u10C5])$", ((char)('\u1F1F' + 48)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, false, "" };
- // yield return new object[] { engine, @"^(?i:[\u24B6-\u24D0])$", ((char)('\u24D0' + 26)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, false, "" };
- // yield return new object[] { engine, @"^(?i:[\u24B6-\u24D0])$", ((char)('\u24CF' + 26)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, true, ((char)('\u24CF' + 26)).ToString() };
+ // yield return (@"^(?i:[\u00D7-\u00D8])$", '\u00F7'.ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, false, "");
+ // yield return (@"^(?i:[\u00C0-\u00DE])$", '\u00F7'.ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, false, "");
+ // yield return (@"^(?i:[\u00C0-\u00DE])$", ((char)('\u00C0' + 32)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, true, ((char)('\u00C0' + 32)).ToString());
+ // yield return (@"^(?i:[\u00C0-\u00DE])$", ((char)('\u00DE' + 32)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, true, ((char)('\u00DE' + 32)).ToString());
+ // yield return (@"^(?i:[\u0391-\u03AB])$", ((char)('\u03A2' + 32)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, false, "");
+ // yield return (@"^(?i:[\u0391-\u03AB])$", ((char)('\u0391' + 32)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, true, ((char)('\u0391' + 32)).ToString());
+ // yield return (@"^(?i:[\u0391-\u03AB])$", ((char)('\u03AB' + 32)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, true, ((char)('\u03AB' + 32)).ToString());
+ // yield return (@"^(?i:[\u1F18-\u1F1F])$", ((char)('\u1F1F' - 8)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, false, "");
+ // yield return (@"^(?i:[\u1F18-\u1F1F])$", ((char)('\u1F18' - 8)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, true, ((char)('\u1F18' - 8)).ToString());
+ // yield return (@"^(?i:[\u10A0-\u10C5])$", ((char)('\u10A0' + 7264)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, true, ((char)('\u10A0' + 7264)).ToString());
+ // yield return (@"^(?i:[\u10A0-\u10C5])$", ((char)('\u1F1F' + 48)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, false, "");
+ // yield return (@"^(?i:[\u24B6-\u24D0])$", ((char)('\u24D0' + 26)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, false, "");
+ // yield return (@"^(?i:[\u24B6-\u24D0])$", ((char)('\u24CF' + 26)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, true, ((char)('\u24CF' + 26)).ToString());
//}
+
+ foreach (RegexOptions options in new[] { RegexOptions.None, RegexOptions.Singleline })
+ {
+ yield return (@"\W.*?\D", "seq 012 of 3 digits", options, 0, 19, true, " 012 ");
+ yield return (@"\W.+?\D", "seq 012 of 3 digits", options, 0, 19, true, " 012 ");
+ yield return (@"\W.{1,7}?\D", "seq 012 of 3 digits", options, 0, 19, true, " 012 ");
+ yield return (@"\W.{1,2}?\D", "seq 012 of 3 digits", options, 0, 19, true, " of");
+ yield return (@"\W.*?\b", "digits:0123456789", options, 0, 17, true, ":");
+ yield return (@"\B.*?\B", "e.g:abc", options, 0, 7, true, "");
+ yield return (@"\B\W+?", "e.g:abc", options, 0, 7, false, "");
+ yield return (@"\B\W*?", "e.g:abc", options, 0, 7, true, "");
+
+ // While not lazy loops themselves, variants of the prior case that should give same results here
+ yield return (@"\B\W*", "e.g:abc", options, 0, 7, true, "");
+ yield return (@"\B\W?", "e.g:abc", options, 0, 7, true, "");
+
+ //mixed lazy and eager counting
+ yield return ("z(a{0,5}|a{0,10}?)", "xyzaaaaaaaaaxyz", options, 0, 15, true, "zaaaaa");
+ }
}
}
[Theory]
- [MemberData(nameof(Match_Basic_TestData))]
- public async Task Match(RegexEngine engine, string pattern, string input, RegexOptions options, int beginning, int length, bool expectedSuccess, string expectedValue)
+ [MemberData(nameof(Match_MemberData))]
+ public void Match(RegexEngine engine, string pattern, string input, RegexOptions options, Regex r, int beginning, int length, bool expectedSuccess, string expectedValue)
{
bool isDefaultStart = RegexHelpers.IsDefaultStart(input, options, beginning);
bool isDefaultCount = RegexHelpers.IsDefaultCount(input, options, length);
- Regex r = await RegexHelpers.GetRegexAsync(engine, pattern, options);
-
// Test instance method overloads
if (isDefaultStart && isDefaultCount)
{
}
}
+ private async Task CreateAndMatch(RegexEngine engine, string pattern, string input, RegexOptions options, int beginning, int length, bool expectedSuccess, string expectedValue)
+ {
+ Regex r = await RegexHelpers.GetRegexAsync(engine, pattern, options);
+ Match(engine, pattern, input, options, r, beginning, length, expectedSuccess, expectedValue);
+ }
+
public static IEnumerable<object[]> Match_VaryingLengthStrings_MemberData()
{
foreach (RegexEngine engine in RegexHelpers.AvailableEngines)
{
- yield return new object[] { engine, RegexOptions.None };
- yield return new object[] { engine, RegexOptions.IgnoreCase };
- yield return new object[] { engine, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant };
+ foreach (int length in new[] { 2, 3, 7, 8, 9, 64 })
+ {
+ yield return new object[] { engine, RegexOptions.None, length };
+ yield return new object[] { engine, RegexOptions.IgnoreCase, length };
+ yield return new object[] { engine, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, length };
+ }
}
}
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Takes several minutes on .NET Framework")]
- [ConditionalTheory]
+ [Theory]
[MemberData(nameof(Match_VaryingLengthStrings_MemberData))]
- public async Task Match_VaryingLengthStrings(RegexEngine engine, RegexOptions options)
+ public async Task Match_VaryingLengthStrings(RegexEngine engine, RegexOptions options, int length)
{
- var lengths = new List<int>() { 2, 3, 4, 5, 6, 7, 8, 9, 31, 32, 33, 63, 64, 65 };
- if ((options & RegexOptions.IgnoreCase) == 0)
- {
- lengths.Add(100_000); // currently produces too large a compiled method for case-insensitive
- }
-
bool caseInsensitive = (options & RegexOptions.IgnoreCase) != 0;
- foreach (int length in lengths)
- {
- string pattern = "[123]" + string.Concat(Enumerable.Range(0, length).Select(i => (char)('A' + (i % 26))));
- string input = "2" + string.Concat(Enumerable.Range(0, length).Select(i => (char)((caseInsensitive ? 'a' : 'A') + (i % 26))));
- await Match(engine, pattern, input, options, 0, input.Length, expectedSuccess: true, expectedValue: input);
- }
+ string pattern = "[123]" + string.Concat(Enumerable.Range(0, length).Select(i => (char)('A' + (i % 26))));
+ string input = "2" + string.Concat(Enumerable.Range(0, length).Select(i => (char)((caseInsensitive ? 'a' : 'A') + (i % 26))));
+ Regex r = await RegexHelpers.GetRegexAsync(engine, pattern, options);
+ Match(engine, pattern, input, options, r, 0, input.Length, expectedSuccess: true, expectedValue: input);
+ }
+
+ [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Takes several minutes on .NET Framework")]
+ [OuterLoop("Takes several seconds")]
+ [Theory]
+ [MemberData(nameof(RegexHelpers.AvailableEngines_MemberData), MemberType = typeof(RegexHelpers))]
+ public async Task Match_VaryingLengthStrings_Huge(RegexEngine engine)
+ {
+ await Match_VaryingLengthStrings(engine, RegexOptions.None, 100_000);
}
public static IEnumerable<object[]> Match_DeepNesting_MemberData()
{
using (new ThreadCultureChange("en-US"))
{
- await Match(engine, "\u0131", "\u0049", RegexOptions.IgnoreCase, 0, 1, false, string.Empty);
- await Match(engine, "\u0131", "\u0069", RegexOptions.IgnoreCase, 0, 1, false, string.Empty);
+ await CreateAndMatch(engine, "\u0131", "\u0049", RegexOptions.IgnoreCase, 0, 1, false, string.Empty);
+ await CreateAndMatch(engine, "\u0131", "\u0069", RegexOptions.IgnoreCase, 0, 1, false, string.Empty);
}
}
{
using (new ThreadCultureChange(CultureInfo.InvariantCulture))
{
- await Match(engine, "\u0131", "\u0049", RegexOptions.IgnoreCase, 0, 1, false, string.Empty);
- await Match(engine, "\u0131", "\u0069", RegexOptions.IgnoreCase, 0, 1, false, string.Empty);
- await Match(engine, "\u0130", "\u0049", RegexOptions.IgnoreCase, 0, 1, false, string.Empty);
- await Match(engine, "\u0130", "\u0069", RegexOptions.IgnoreCase, 0, 1, false, string.Empty);
+ await CreateAndMatch(engine, "\u0131", "\u0049", RegexOptions.IgnoreCase, 0, 1, false, string.Empty);
+ await CreateAndMatch(engine, "\u0131", "\u0069", RegexOptions.IgnoreCase, 0, 1, false, string.Empty);
+ await CreateAndMatch(engine, "\u0130", "\u0049", RegexOptions.IgnoreCase, 0, 1, false, string.Empty);
+ await CreateAndMatch(engine, "\u0130", "\u0069", RegexOptions.IgnoreCase, 0, 1, false, string.Empty);
}
}