diff --git a/re_test.go b/re_test.go index 9b20179..804fd8c 100644 --- a/re_test.go +++ b/re_test.go @@ -61,8 +61,17 @@ var reTests = []struct { {".+", "Hello, how is it going?", []matchIndex{{0, 23}}}, {"a.", "a ", []matchIndex{{0, 2}}}, {"a.b", "a/b", []matchIndex{{0, 3}}}, - {".", "a ", []matchIndex{{0, 2}}}, + {".", "a ", []matchIndex{{0, 1}, {1, 2}}}, {"a.", "a ", []matchIndex{{0, 2}}}, + {".+b", "abc", []matchIndex{{0, 2}}}, + + {`\d`, "1a0a3s'''34343s", []matchIndex{{0, 1}, {2, 3}, {4, 5}, {9, 10}, {10, 11}, {11, 12}, {12, 13}, {13, 14}}}, + {`\\`, `a\b\c\qwe\`, []matchIndex{{1, 2}, {3, 4}, {5, 6}, {9, 10}}}, + {`\W`, `"Hello", he said. How are you doing?`, []matchIndex{{0, 1}, {6, 7}, {7, 8}, {8, 9}, {11, 12}, {16, 17}, {17, 18}, {21, 22}, {25, 26}, {29, 30}, {35, 36}}}, + {`\w`, ";';';';';'qwe12", []matchIndex{{10, 11}, {11, 12}, {12, 13}, {13, 14}, {14, 15}}}, + {`\s`, "a b c d", []matchIndex{{1, 2}, {3, 4}, {5, 6}, {6, 7}}}, + {`\<`, "", []matchIndex{{0, 1}, {6, 7}}}, + {`\(.+\)`, "Not (paranthesized), (so) is (this) not", []matchIndex{{4, 18}, {21, 24}, {29, 34}}}, } func TestFindAllMatches(t *testing.T) {