| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
[[test]] |
| 5 |
name = "basic" |
| 6 |
regex = '(?mR)^[a-z]+$' |
| 7 |
haystack = "abc\r\ndef\r\nxyz" |
| 8 |
matches = [[0, 3], [5, 8], [10, 13]] |
| 9 |
|
| 10 |
|
| 11 |
[[test]] |
| 12 |
name = "start-end-non-empty" |
| 13 |
regex = '(?mR)^$' |
| 14 |
haystack = "abc\r\ndef\r\nxyz" |
| 15 |
matches = [] |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
[[test]] |
| 20 |
name = "start-end-empty" |
| 21 |
regex = '(?mR)^$' |
| 22 |
haystack = "" |
| 23 |
matches = [[0, 0]] |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
[[test]] |
| 28 |
name = "start-end-before-after" |
| 29 |
regex = '(?mR)^$' |
| 30 |
haystack = "\r\n" |
| 31 |
matches = [[0, 0], [2, 2]] |
| 32 |
|
| 33 |
|
| 34 |
[[test]] |
| 35 |
name = "start-no-split" |
| 36 |
regex = '(?mR)^' |
| 37 |
haystack = "abc\r\ndef\r\nxyz" |
| 38 |
matches = [[0, 0], [5, 5], [10, 10]] |
| 39 |
|
| 40 |
|
| 41 |
[[test]] |
| 42 |
name = "start-no-split-adjacent" |
| 43 |
regex = '(?mR)^' |
| 44 |
haystack = "\r\n\r\n\r\n" |
| 45 |
matches = [[0, 0], [2, 2], [4, 4], [6, 6]] |
| 46 |
|
| 47 |
|
| 48 |
[[test]] |
| 49 |
name = "start-no-split-adjacent-cr" |
| 50 |
regex = '(?mR)^' |
| 51 |
haystack = "\r\r\r" |
| 52 |
matches = [[0, 0], [1, 1], [2, 2], [3, 3]] |
| 53 |
|
| 54 |
|
| 55 |
[[test]] |
| 56 |
name = "start-no-split-adjacent-lf" |
| 57 |
regex = '(?mR)^' |
| 58 |
haystack = "\n\n\n" |
| 59 |
matches = [[0, 0], [1, 1], [2, 2], [3, 3]] |
| 60 |
|
| 61 |
|
| 62 |
[[test]] |
| 63 |
name = "end-no-split" |
| 64 |
regex = '(?mR)$' |
| 65 |
haystack = "abc\r\ndef\r\nxyz" |
| 66 |
matches = [[3, 3], [8, 8], [13, 13]] |
| 67 |
|
| 68 |
|
| 69 |
[[test]] |
| 70 |
name = "end-no-split-adjacent" |
| 71 |
regex = '(?mR)$' |
| 72 |
haystack = "\r\n\r\n\r\n" |
| 73 |
matches = [[0, 0], [2, 2], [4, 4], [6, 6]] |
| 74 |
|
| 75 |
|
| 76 |
[[test]] |
| 77 |
name = "end-no-split-adjacent-cr" |
| 78 |
regex = '(?mR)$' |
| 79 |
haystack = "\r\r\r" |
| 80 |
matches = [[0, 0], [1, 1], [2, 2], [3, 3]] |
| 81 |
|
| 82 |
|
| 83 |
[[test]] |
| 84 |
name = "end-no-split-adjacent-lf" |
| 85 |
regex = '(?mR)$' |
| 86 |
haystack = "\n\n\n" |
| 87 |
matches = [[0, 0], [1, 1], [2, 2], [3, 3]] |
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
[[test]] |
| 92 |
name = "dot-no-crlf" |
| 93 |
regex = '(?R).' |
| 94 |
haystack = "\r\n\r\n\r\n" |
| 95 |
matches = [] |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
[[test]] |
| 103 |
name = "onepass-wrong-crlf-with-capture" |
| 104 |
regex = '(?Rm:().$)' |
| 105 |
haystack = "ZZ\r" |
| 106 |
matches = [[[1, 2], [1, 1]]] |
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
[[test]] |
| 112 |
name = "onepass-wrong-crlf-anchored" |
| 113 |
regex = '(?Rm:.$)' |
| 114 |
haystack = "ZZ\r" |
| 115 |
matches = [[1, 2]] |
| 116 |
anchored = true |
| 117 |
bounds = [1, 3] |