diff --git a/re_test.go b/re_test.go index 72a39c8..98519f0 100644 --- a/re_test.go +++ b/re_test.go @@ -19,6 +19,8 @@ var reTests = []struct { {"(b|c|A)", "ooaoobocA", []matchIndex{{5, 6}, {7, 8}, {8, 9}}}, {"ab*", "a", []matchIndex{{0, 1}}}, {"ab*", "abb", []matchIndex{{0, 3}}}, + {"a*b", "aaab", []matchIndex{{0, 4}}}, + {"a*b", "qwqw", []matchIndex{}}, {"(abc)*", "abcabcabc", []matchIndex{{0, 9}}}, {"((abc)|(def))*", "abcdef", []matchIndex{{0, 6}}}, {"(abc)*|(def)*", "abcdef", []matchIndex{{0, 3}, {3, 3}, {3, 6}, {6, 6}}}, @@ -30,6 +32,9 @@ var reTests = []struct { {"a|b", "c", []matchIndex{}}, {"(a|b)*c", "aabbc", []matchIndex{{0, 5}}}, {"a*", "aaaaaaaa", []matchIndex{{0, 8}, {8, 8}}}, + {"ab?", "ab", []matchIndex{{0, 2}}}, + {"a?b", "ab", []matchIndex{{0, 2}}}, + {"a?", "", []matchIndex{{0, 0}}}, } func TestFindAllMatches(t *testing.T) {