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