Skip to content

Commit eebbcac

Browse files
Add regression tests
1 parent 70cd9a0 commit eebbcac

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

testdata/lookaround.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@ regex = "(?<=c[def]+(?<!fed))a"
4646
haystack = "cdaceacfeeacfedeacfeda"
4747
matches = [[2, 3], [5, 6], [10, 11], [16, 17]]
4848

49+
[[test]]
50+
name = "nested positive lookbehind"
51+
regex = "(?<=\\w{2}(?<=\\d))d"
52+
haystack = "ad 1d1ada1d1 d a1d"
53+
matches = [[10, 11], [17, 18]]
54+
55+
[[test]]
56+
name = "overlapping lookbehind"
57+
regex = "(?<=abcab)c"
58+
haystack = "abcabcabcabc"
59+
matches = [[5,6], [8,9], [11,12]]
60+
4961
[[test]]
5062
name = "lookbehind with alternation"
5163
regex = "(?<=def|abc)a"

0 commit comments

Comments
 (0)