1 # These are: 2 # 3 # (1) Tests of the match-limiting features. The results are different for 4 # interpretive or JIT matching, so this test should not be run with JIT. The 5 # same tests are run using JIT in test 17. 6 7 # (2) Other tests that must not be run with JIT. 8 9 /(a+)*zz/I 10 Capturing subpattern count = 1 11 Starting code units: a z 12 Last code unit = 'z' 13 Subject length lower bound = 2 14 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\=find_limits 15 Minimum match limit = 8 16 Minimum recursion limit = 6 17 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazz 18 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 19 aaaaaaaaaaaaaz\=find_limits 20 Minimum match limit = 32768 21 Minimum recursion limit = 29 22 No match 23 24 !((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)!I 25 Capturing subpattern count = 1 26 May match empty string 27 Subject length lower bound = 0 28 /* this is a C style comment */\=find_limits 29 Minimum match limit = 120 30 Minimum recursion limit = 6 31 0: /* this is a C style comment */ 32 1: /* this is a C style comment */ 33 34 /^(?>a)++/ 35 aa\=find_limits 36 Minimum match limit = 5 37 Minimum recursion limit = 2 38 0: aa 39 aaaaaaaaa\=find_limits 40 Minimum match limit = 12 41 Minimum recursion limit = 2 42 0: aaaaaaaaa 43 44 /(a)(?1)++/ 45 aa\=find_limits 46 Minimum match limit = 7 47 Minimum recursion limit = 4 48 0: aa 49 1: a 50 aaaaaaaaa\=find_limits 51 Minimum match limit = 21 52 Minimum recursion limit = 4 53 0: aaaaaaaaa 54 1: a 55 56 /a(?:.)*?a/ims 57 abbbbbbbbbbbbbbbbbbbbba\=find_limits 58 Minimum match limit = 65 59 Minimum recursion limit = 2 60 0: abbbbbbbbbbbbbbbbbbbbba 61 62 /a(?:.(*THEN))*?a/ims 63 abbbbbbbbbbbbbbbbbbbbba\=find_limits 64 Minimum match limit = 86 65 Minimum recursion limit = 45 66 0: abbbbbbbbbbbbbbbbbbbbba 67 68 /a(?:.(*THEN:ABC))*?a/ims 69 abbbbbbbbbbbbbbbbbbbbba\=find_limits 70 Minimum match limit = 86 71 Minimum recursion limit = 45 72 0: abbbbbbbbbbbbbbbbbbbbba 73 74 /^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/ 75 aabbccddee\=find_limits 76 Minimum match limit = 7 77 Minimum recursion limit = 2 78 0: aabbccddee 79 80 /^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/ 81 aabbccddee\=find_limits 82 Minimum match limit = 17 83 Minimum recursion limit = 16 84 0: aabbccddee 85 1: aa 86 2: bb 87 3: cc 88 4: dd 89 5: ee 90 91 /^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/ 92 aabbccddee\=find_limits 93 Minimum match limit = 13 94 Minimum recursion limit = 10 95 0: aabbccddee 96 1: aa 97 2: cc 98 3: ee 99 100 /(*LIMIT_MATCH=12bc)abc/ 101 Failed: error 160 at offset 17: (*VERB) not recognized or malformed 102 103 /(*LIMIT_MATCH=4294967290)abc/ 104 Failed: error 160 at offset 24: (*VERB) not recognized or malformed 105 106 /(*LIMIT_RECURSION=4294967280)abc/I 107 Capturing subpattern count = 0 108 Recursion limit = 4294967280 109 First code unit = 'a' 110 Last code unit = 'c' 111 Subject length lower bound = 3 112 113 /(a+)*zz/ 114 aaaaaaaaaaaaaz 115 No match 116 aaaaaaaaaaaaaz\=match_limit=3000 117 Failed: error -47: match limit exceeded 118 119 /(a+)*zz/ 120 aaaaaaaaaaaaaz\=recursion_limit=10 121 Failed: error -53: recursion limit exceeded 122 123 /(*LIMIT_MATCH=3000)(a+)*zz/I 124 Capturing subpattern count = 1 125 Match limit = 3000 126 Starting code units: a z 127 Last code unit = 'z' 128 Subject length lower bound = 2 129 aaaaaaaaaaaaaz 130 Failed: error -47: match limit exceeded 131 aaaaaaaaaaaaaz\=match_limit=60000 132 Failed: error -47: match limit exceeded 133 134 /(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I 135 Capturing subpattern count = 1 136 Match limit = 3000 137 Starting code units: a z 138 Last code unit = 'z' 139 Subject length lower bound = 2 140 aaaaaaaaaaaaaz 141 Failed: error -47: match limit exceeded 142 143 /(*LIMIT_MATCH=60000)(a+)*zz/I 144 Capturing subpattern count = 1 145 Match limit = 60000 146 Starting code units: a z 147 Last code unit = 'z' 148 Subject length lower bound = 2 149 aaaaaaaaaaaaaz 150 No match 151 aaaaaaaaaaaaaz\=match_limit=3000 152 Failed: error -47: match limit exceeded 153 154 /(*LIMIT_RECURSION=10)(a+)*zz/I 155 Capturing subpattern count = 1 156 Recursion limit = 10 157 Starting code units: a z 158 Last code unit = 'z' 159 Subject length lower bound = 2 160 aaaaaaaaaaaaaz 161 Failed: error -53: recursion limit exceeded 162 aaaaaaaaaaaaaz\=recursion_limit=1000 163 Failed: error -53: recursion limit exceeded 164 165 /(*LIMIT_RECURSION=10)(*LIMIT_RECURSION=1000)(a+)*zz/I 166 Capturing subpattern count = 1 167 Recursion limit = 1000 168 Starting code units: a z 169 Last code unit = 'z' 170 Subject length lower bound = 2 171 aaaaaaaaaaaaaz 172 No match 173 174 /(*LIMIT_RECURSION=1000)(a+)*zz/I 175 Capturing subpattern count = 1 176 Recursion limit = 1000 177 Starting code units: a z 178 Last code unit = 'z' 179 Subject length lower bound = 2 180 aaaaaaaaaaaaaz 181 No match 182 aaaaaaaaaaaaaz\=recursion_limit=10 183 Failed: error -53: recursion limit exceeded 184 185 # These three have infinitely nested recursions. 186 187 /((?2))((?1))/ 188 abc 189 Failed: error -52: nested recursion at the same subject position 190 191 /((?(R2)a+|(?1)b))/ 192 aaaabcde 193 Failed: error -52: nested recursion at the same subject position 194 195 /(?(R)a*(?1)|((?R))b)/ 196 aaaabcde 197 Failed: error -52: nested recursion at the same subject position 198 199 # The allusedtext modifier does not work with JIT, which does not maintain 200 # the leftchar/rightchar data. 201 202 /abc(?=xyz)/allusedtext 203 abcxyzpqr 204 0: abcxyz 205 >>> 206 abcxyzpqr\=aftertext 207 0: abcxyz 208 >>> 209 0+ xyzpqr 210 211 /(?<=pqr)abc(?=xyz)/allusedtext 212 xyzpqrabcxyzpqr 213 0: pqrabcxyz 214 <<< >>> 215 xyzpqrabcxyzpqr\=aftertext 216 0: pqrabcxyz 217 <<< >>> 218 0+ xyzpqr 219 220 /a\b/ 221 a.\=allusedtext 222 0: a. 223 > 224 a\=allusedtext 225 0: a 226 227 /abc\Kxyz/ 228 abcxyz\=allusedtext 229 0: abcxyz 230 <<< 231 232 /abc(?=xyz(*ACCEPT))/ 233 abcxyz\=allusedtext 234 0: abcxyz 235 >>> 236 237 /abc(?=abcde)(?=ab)/allusedtext 238 abcabcdefg 239 0: abcabcde 240 >>>>> 241 242 # These tests provoke recursion loops, which give a different error message 243 # when JIT is used. 244 245 /(?R)/I 246 Capturing subpattern count = 0 247 May match empty string 248 Subject length lower bound = 0 249 abcd 250 Failed: error -52: nested recursion at the same subject position 251 252 /(a|(?R))/I 253 Capturing subpattern count = 1 254 May match empty string 255 Subject length lower bound = 0 256 abcd 257 0: a 258 1: a 259 defg 260 Failed: error -52: nested recursion at the same subject position 261 262 /(ab|(bc|(de|(?R))))/I 263 Capturing subpattern count = 3 264 May match empty string 265 Subject length lower bound = 0 266 abcd 267 0: ab 268 1: ab 269 fghi 270 Failed: error -52: nested recursion at the same subject position 271 272 /(ab|(bc|(de|(?1))))/I 273 Capturing subpattern count = 3 274 May match empty string 275 Subject length lower bound = 0 276 abcd 277 0: ab 278 1: ab 279 fghi 280 Failed: error -52: nested recursion at the same subject position 281 282 /x(ab|(bc|(de|(?1)x)x)x)/I 283 Capturing subpattern count = 3 284 First code unit = 'x' 285 Subject length lower bound = 3 286 xab123 287 0: xab 288 1: ab 289 xfghi 290 Failed: error -52: nested recursion at the same subject position 291 292 /(?!\w)(?R)/ 293 abcd 294 Failed: error -52: nested recursion at the same subject position 295 =abc 296 Failed: error -52: nested recursion at the same subject position 297 298 /(?=\w)(?R)/ 299 =abc 300 Failed: error -52: nested recursion at the same subject position 301 abcd 302 Failed: error -52: nested recursion at the same subject position 303 304 /(?<!\w)(?R)/ 305 abcd 306 Failed: error -52: nested recursion at the same subject position 307 308 /(?<=\w)(?R)/ 309 abcd 310 Failed: error -52: nested recursion at the same subject position 311 312 /(a+|(?R)b)/ 313 aaa 314 0: aaa 315 1: aaa 316 bbb 317 Failed: error -52: nested recursion at the same subject position 318 319 /[^\xff]((?1))/BI 320 ------------------------------------------------------------------ 321 Bra 322 [^\x{ff}] 323 CBra 1 324 Recurse 325 Ket 326 Ket 327 End 328 ------------------------------------------------------------------ 329 Capturing subpattern count = 1 330 Subject length lower bound = 1 331 abcd 332 Failed: error -52: nested recursion at the same subject position 333 334 # These tests don't behave the same with JIT 335 336 /\w+(?C1)/BI,no_auto_possess 337 ------------------------------------------------------------------ 338 Bra 339 \w+ 340 Callout 1 8 0 341 Ket 342 End 343 ------------------------------------------------------------------ 344 Capturing subpattern count = 0 345 Options: no_auto_possess 346 Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P 347 Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z 348 Subject length lower bound = 1 349 abc\=callout_fail=1 350 --->abc 351 1 ^ ^ 352 1 ^ ^ 353 1 ^^ 354 1 ^ ^ 355 1 ^^ 356 1 ^^ 357 No match 358 359 /(*NO_AUTO_POSSESS)\w+(?C1)/BI 360 ------------------------------------------------------------------ 361 Bra 362 \w+ 363 Callout 1 26 0 364 Ket 365 End 366 ------------------------------------------------------------------ 367 Capturing subpattern count = 0 368 Compile options: <none> 369 Overall options: no_auto_possess 370 Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P 371 Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z 372 Subject length lower bound = 1 373 abc\=callout_fail=1 374 --->abc 375 1 ^ ^ 376 1 ^ ^ 377 1 ^^ 378 1 ^ ^ 379 1 ^^ 380 1 ^^ 381 No match 382 383 # End of testinput15 384