|
|
|
@ -604,6 +604,10 @@ var groupTests = []struct {
|
|
|
|
|
{`(?:(cat)|(dog))\2`, nil, `catdog`, []Match{}},
|
|
|
|
|
{`(?:a)\1`, nil, `aa`, nil},
|
|
|
|
|
{`((cat)|(dog)|(cow)|(bat))\4`, nil, `cowcow`, []Match{[]Group{{0, 6}, {0, 3}, {-1, -1}, {-1, -1}, {0, 3}, {-1, -1}}}},
|
|
|
|
|
{`(a|b)*\1`, nil, `abb`, []Match{[]Group{{0, 3}, {1, 2}}}},
|
|
|
|
|
{`(a|b)*\1`, nil, `aba`, []Match{}},
|
|
|
|
|
{`(a|b)*\1`, nil, `bab`, []Match{}},
|
|
|
|
|
{`(a|b)*\1`, nil, `baa`, []Match{[]Group{{0, 3}, {1, 2}}}},
|
|
|
|
|
|
|
|
|
|
{`(a)(b)c|ab`, nil, `ab`, []Match{[]Group{{0, 2}}}},
|
|
|
|
|
{`(a)+x`, nil, `aaax`, []Match{[]Group{{0, 4}, {2, 3}}}},
|
|
|
|
|