diff --git a/regex_test.go b/regex_test.go index 9c53195..81978be 100644 --- a/regex_test.go +++ b/regex_test.go @@ -606,6 +606,15 @@ var findTests = []FindTest{ 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36), }, + + // https://github.com/kkos/oniguruma/blob/2a25d8c2c4699c57f4d456ccd13149c0c714723d/test/test_back.c#LL629C1-L631C25 + {"\\R", "\r\n", build(1, 0, 2)}, + {"\\R", "\r", build(1, 0, 1)}, + {"\\R", "\n", build(1, 0, 1)}, + + {`b\R.*\R`, "ab\nc\n", build(1, 1, 5)}, + // equivalent, from Linguist dataset + {`^\s*BEGIN\R\s*.*\R`, "\tBEGIN\n\tMultiUse = -1 'True\n", build(1, 0, 29)}, } // build is a helper to construct a [][]int by extracting n sequences from x.