|
|
@ -77,6 +77,7 @@ var reTests = []struct {
|
|
|
|
{"[^a]+", "qqqaq", []MatchIndex{{0, 3}, {4, 5}}},
|
|
|
|
{"[^a]+", "qqqaq", []MatchIndex{{0, 3}, {4, 5}}},
|
|
|
|
{"[^0-9]+", "a1b2c3dd", []MatchIndex{{0, 1}, {2, 3}, {4, 5}, {6, 8}}},
|
|
|
|
{"[^0-9]+", "a1b2c3dd", []MatchIndex{{0, 1}, {2, 3}, {4, 5}, {6, 8}}},
|
|
|
|
{"[^abc]+", "ababababbababaccacacacaca", []MatchIndex{}},
|
|
|
|
{"[^abc]+", "ababababbababaccacacacaca", []MatchIndex{}},
|
|
|
|
|
|
|
|
{`\[`, "a[b[c[]]]", []MatchIndex{{1, 2}, {3, 4}, {5, 6}}},
|
|
|
|
{`\([^)]+\)`, "Not (paranthesized), (so) is (this) not", []MatchIndex{{4, 19}, {21, 25}, {29, 35}}},
|
|
|
|
{`\([^)]+\)`, "Not (paranthesized), (so) is (this) not", []MatchIndex{{4, 19}, {21, 25}, {29, 35}}},
|
|
|
|
|
|
|
|
|
|
|
|
{"^ab", "ab bab", []MatchIndex{{0, 2}}},
|
|
|
|
{"^ab", "ab bab", []MatchIndex{{0, 2}}},
|
|
|
@ -113,6 +114,7 @@ var reTests = []struct {
|
|
|
|
// Unicode tests
|
|
|
|
// Unicode tests
|
|
|
|
{`.+`, "úïäö´«åæïëòöê»éãçâï«úïòíñ", []MatchIndex{{0, 25}}},
|
|
|
|
{`.+`, "úïäö´«åæïëòöê»éãçâï«úïòíñ", []MatchIndex{{0, 25}}},
|
|
|
|
{`a.b`, "a²b", []MatchIndex{{0, 3}}},
|
|
|
|
{`a.b`, "a²b", []MatchIndex{{0, 3}}},
|
|
|
|
|
|
|
|
{`[^a]+`, "úïäö´«åæïëòöê»éãçâï«úïòíñ", []MatchIndex{{0, 25}}},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestFindAllMatches(t *testing.T) {
|
|
|
|
func TestFindAllMatches(t *testing.T) {
|
|
|
|