1# There are two sorts of patterns in this test. A number of them are 2# representative patterns whose lengths and offsets are checked. This is just a 3# doublecheck test to ensure the sizes don't go horribly wrong when something 4# is changed. The operation of these patterns is checked in other tests. 5# 6# This file also contains tests whose output varies with code unit size and/or 7# link size. Unicode support is required for these tests. There are separate 8# output files for each code unit size and link size. 9 10#pattern fullbincode,memory 11 12/((?i)b)/ 13Memory allocation (code space): 25 14------------------------------------------------------------------ 15 0 19 Bra 16 5 9 CBra 1 17 12 /i b 18 14 9 Ket 19 19 19 Ket 20 24 End 21------------------------------------------------------------------ 22 23/(?s)(.*X|^B)/ 24Memory allocation (code space): 35 25------------------------------------------------------------------ 26 0 29 Bra 27 5 11 CBra 1 28 12 AllAny* 29 14 X 30 16 8 Alt 31 21 ^ 32 22 B 33 24 19 Ket 34 29 29 Ket 35 34 End 36------------------------------------------------------------------ 37 38/(?s:.*X|^B)/ 39Memory allocation (code space): 33 40------------------------------------------------------------------ 41 0 27 Bra 42 5 9 Bra 43 10 AllAny* 44 12 X 45 14 8 Alt 46 19 ^ 47 20 B 48 22 17 Ket 49 27 27 Ket 50 32 End 51------------------------------------------------------------------ 52 53/^[[:alnum:]]/ 54Memory allocation (code space): 45 55------------------------------------------------------------------ 56 0 39 Bra 57 5 ^ 58 6 [0-9A-Za-z] 59 39 39 Ket 60 44 End 61------------------------------------------------------------------ 62 63/#/Ix 64Memory allocation (code space): 11 65------------------------------------------------------------------ 66 0 5 Bra 67 5 5 Ket 68 10 End 69------------------------------------------------------------------ 70Capturing subpattern count = 0 71May match empty string 72Options: extended 73Subject length lower bound = 0 74 75/a#/Ix 76Memory allocation (code space): 13 77------------------------------------------------------------------ 78 0 7 Bra 79 5 a 80 7 7 Ket 81 12 End 82------------------------------------------------------------------ 83Capturing subpattern count = 0 84Options: extended 85First code unit = 'a' 86Subject length lower bound = 1 87 88/x?+/ 89Memory allocation (code space): 13 90------------------------------------------------------------------ 91 0 7 Bra 92 5 x?+ 93 7 7 Ket 94 12 End 95------------------------------------------------------------------ 96 97/x++/ 98Memory allocation (code space): 13 99------------------------------------------------------------------ 100 0 7 Bra 101 5 x++ 102 7 7 Ket 103 12 End 104------------------------------------------------------------------ 105 106/x{1,3}+/ 107Memory allocation (code space): 17 108------------------------------------------------------------------ 109 0 11 Bra 110 5 x 111 7 x{0,2}+ 112 11 11 Ket 113 16 End 114------------------------------------------------------------------ 115 116/(x)*+/ 117Memory allocation (code space): 26 118------------------------------------------------------------------ 119 0 20 Bra 120 5 Braposzero 121 6 9 CBraPos 1 122 13 x 123 15 9 KetRpos 124 20 20 Ket 125 25 End 126------------------------------------------------------------------ 127 128/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/ 129Memory allocation (code space): 144 130------------------------------------------------------------------ 131 0 138 Bra 132 5 ^ 133 6 127 CBra 1 134 13 9 CBra 2 135 20 a+ 136 22 9 Ket 137 27 41 CBra 3 138 34 [ab]+? 139 68 41 Ket 140 73 41 CBra 4 141 80 [bc]+ 142114 41 Ket 143119 9 CBra 5 144126 \w*+ 145128 9 Ket 146133 127 Ket 147138 138 Ket 148143 End 149------------------------------------------------------------------ 150 151"8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b" 152Memory allocation (code space): 830 153------------------------------------------------------------------ 154 0 824 Bra 155 5 8J$WE<.rX+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X 156823 \b 157824 824 Ket 158829 End 159------------------------------------------------------------------ 160 161"\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b" 162Memory allocation (code space): 820 163------------------------------------------------------------------ 164 0 814 Bra 165 5 $<.X+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X 166813 \b 167814 814 Ket 168819 End 169------------------------------------------------------------------ 170 171/(a(?1)b)/ 172Memory allocation (code space): 32 173------------------------------------------------------------------ 174 0 26 Bra 175 5 16 CBra 1 176 12 a 177 14 5 Recurse 178 19 b 179 21 16 Ket 180 26 26 Ket 181 31 End 182------------------------------------------------------------------ 183 184/(a(?1)+b)/ 185Memory allocation (code space): 42 186------------------------------------------------------------------ 187 0 36 Bra 188 5 26 CBra 1 189 12 a 190 14 10 SBra 191 19 5 Recurse 192 24 10 KetRmax 193 29 b 194 31 26 Ket 195 36 36 Ket 196 41 End 197------------------------------------------------------------------ 198 199/a(?P<name1>b|c)d(?P<longername2>e)/ 200Memory allocation (code space): 50 201------------------------------------------------------------------ 202 0 44 Bra 203 5 a 204 7 9 CBra 1 205 14 b 206 16 7 Alt 207 21 c 208 23 16 Ket 209 28 d 210 30 9 CBra 2 211 37 e 212 39 9 Ket 213 44 44 Ket 214 49 End 215------------------------------------------------------------------ 216 217/(?:a(?P<c>c(?P<d>d)))(?P<a>a)/ 218Memory allocation (code space): 65 219------------------------------------------------------------------ 220 0 59 Bra 221 5 35 Bra 222 10 a 223 12 23 CBra 1 224 19 c 225 21 9 CBra 2 226 28 d 227 30 9 Ket 228 35 23 Ket 229 40 35 Ket 230 45 9 CBra 3 231 52 a 232 54 9 Ket 233 59 59 Ket 234 64 End 235------------------------------------------------------------------ 236 237/(?P<a>a)...(?P=a)bbb(?P>a)d/ 238Memory allocation (code space): 44 239------------------------------------------------------------------ 240 0 38 Bra 241 5 9 CBra 1 242 12 a 243 14 9 Ket 244 19 Any 245 20 Any 246 21 Any 247 22 \1 248 25 bbb 249 31 5 Recurse 250 36 d 251 38 38 Ket 252 43 End 253------------------------------------------------------------------ 254 255/abc(?C255)de(?C)f/ 256Memory allocation (code space): 43 257------------------------------------------------------------------ 258 0 37 Bra 259 5 abc 260 11 Callout 255 10 1 261 21 de 262 25 Callout 0 16 1 263 35 f 264 37 37 Ket 265 42 End 266------------------------------------------------------------------ 267 268/abcde/auto_callout 269Memory allocation (code space): 81 270------------------------------------------------------------------ 271 0 75 Bra 272 5 Callout 255 0 1 273 15 a 274 17 Callout 255 1 1 275 27 b 276 29 Callout 255 2 1 277 39 c 278 41 Callout 255 3 1 279 51 d 280 53 Callout 255 4 1 281 63 e 282 65 Callout 255 5 0 283 75 75 Ket 284 80 End 285------------------------------------------------------------------ 286 287/\x{100}/utf 288Memory allocation (code space): 14 289------------------------------------------------------------------ 290 0 8 Bra 291 5 \x{100} 292 8 8 Ket 293 13 End 294------------------------------------------------------------------ 295 296/\x{1000}/utf 297Memory allocation (code space): 15 298------------------------------------------------------------------ 299 0 9 Bra 300 5 \x{1000} 301 9 9 Ket 302 14 End 303------------------------------------------------------------------ 304 305/\x{10000}/utf 306Memory allocation (code space): 16 307------------------------------------------------------------------ 308 0 10 Bra 309 5 \x{10000} 310 10 10 Ket 311 15 End 312------------------------------------------------------------------ 313 314/\x{100000}/utf 315Memory allocation (code space): 16 316------------------------------------------------------------------ 317 0 10 Bra 318 5 \x{100000} 319 10 10 Ket 320 15 End 321------------------------------------------------------------------ 322 323/\x{10ffff}/utf 324Memory allocation (code space): 16 325------------------------------------------------------------------ 326 0 10 Bra 327 5 \x{10ffff} 328 10 10 Ket 329 15 End 330------------------------------------------------------------------ 331 332/\x{110000}/utf 333Failed: error 134 at offset 9: character code point value in \x{} or \o{} is too large 334 335/[\x{ff}]/utf 336Memory allocation (code space): 14 337------------------------------------------------------------------ 338 0 8 Bra 339 5 \x{ff} 340 8 8 Ket 341 13 End 342------------------------------------------------------------------ 343 344/[\x{100}]/utf 345Memory allocation (code space): 14 346------------------------------------------------------------------ 347 0 8 Bra 348 5 \x{100} 349 8 8 Ket 350 13 End 351------------------------------------------------------------------ 352 353/\x80/utf 354Memory allocation (code space): 14 355------------------------------------------------------------------ 356 0 8 Bra 357 5 \x{80} 358 8 8 Ket 359 13 End 360------------------------------------------------------------------ 361 362/\xff/utf 363Memory allocation (code space): 14 364------------------------------------------------------------------ 365 0 8 Bra 366 5 \x{ff} 367 8 8 Ket 368 13 End 369------------------------------------------------------------------ 370 371/\x{0041}\x{2262}\x{0391}\x{002e}/I,utf 372Memory allocation (code space): 22 373------------------------------------------------------------------ 374 0 16 Bra 375 5 A\x{2262}\x{391}. 376 16 16 Ket 377 21 End 378------------------------------------------------------------------ 379Capturing subpattern count = 0 380Options: utf 381First code unit = 'A' 382Last code unit = '.' 383Subject length lower bound = 4 384 385/\x{D55c}\x{ad6d}\x{C5B4}/I,utf 386Memory allocation (code space): 23 387------------------------------------------------------------------ 388 0 17 Bra 389 5 \x{d55c}\x{ad6d}\x{c5b4} 390 17 17 Ket 391 22 End 392------------------------------------------------------------------ 393Capturing subpattern count = 0 394Options: utf 395First code unit = \xed 396Last code unit = \xb4 397Subject length lower bound = 3 398 399/\x{65e5}\x{672c}\x{8a9e}/I,utf 400Memory allocation (code space): 23 401------------------------------------------------------------------ 402 0 17 Bra 403 5 \x{65e5}\x{672c}\x{8a9e} 404 17 17 Ket 405 22 End 406------------------------------------------------------------------ 407Capturing subpattern count = 0 408Options: utf 409First code unit = \xe6 410Last code unit = \x9e 411Subject length lower bound = 3 412 413/[\x{100}]/utf 414Memory allocation (code space): 14 415------------------------------------------------------------------ 416 0 8 Bra 417 5 \x{100} 418 8 8 Ket 419 13 End 420------------------------------------------------------------------ 421 422/[Z\x{100}]/utf 423Memory allocation (code space): 53 424------------------------------------------------------------------ 425 0 47 Bra 426 5 [Z\x{100}] 427 47 47 Ket 428 52 End 429------------------------------------------------------------------ 430 431/^[\x{100}\E-\Q\E\x{150}]/utf 432Memory allocation (code space): 24 433------------------------------------------------------------------ 434 0 18 Bra 435 5 ^ 436 6 [\x{100}-\x{150}] 437 18 18 Ket 438 23 End 439------------------------------------------------------------------ 440 441/^[\QĀ\E-\QŐ\E]/utf 442Memory allocation (code space): 24 443------------------------------------------------------------------ 444 0 18 Bra 445 5 ^ 446 6 [\x{100}-\x{150}] 447 18 18 Ket 448 23 End 449------------------------------------------------------------------ 450 451/^[\QĀ\E-\QŐ\E/utf 452Failed: error 106 at offset 15: missing terminating ] for character class 453 454/[\p{L}]/ 455Memory allocation (code space): 21 456------------------------------------------------------------------ 457 0 15 Bra 458 5 [\p{L}] 459 15 15 Ket 460 20 End 461------------------------------------------------------------------ 462 463/[\p{^L}]/ 464Memory allocation (code space): 21 465------------------------------------------------------------------ 466 0 15 Bra 467 5 [\P{L}] 468 15 15 Ket 469 20 End 470------------------------------------------------------------------ 471 472/[\P{L}]/ 473Memory allocation (code space): 21 474------------------------------------------------------------------ 475 0 15 Bra 476 5 [\P{L}] 477 15 15 Ket 478 20 End 479------------------------------------------------------------------ 480 481/[\P{^L}]/ 482Memory allocation (code space): 21 483------------------------------------------------------------------ 484 0 15 Bra 485 5 [\p{L}] 486 15 15 Ket 487 20 End 488------------------------------------------------------------------ 489 490/[abc\p{L}\x{0660}]/utf 491Memory allocation (code space): 56 492------------------------------------------------------------------ 493 0 50 Bra 494 5 [a-c\p{L}\x{660}] 495 50 50 Ket 496 55 End 497------------------------------------------------------------------ 498 499/[\p{Nd}]/utf 500Memory allocation (code space): 21 501------------------------------------------------------------------ 502 0 15 Bra 503 5 [\p{Nd}] 504 15 15 Ket 505 20 End 506------------------------------------------------------------------ 507 508/[\p{Nd}+-]+/utf 509Memory allocation (code space): 54 510------------------------------------------------------------------ 511 0 48 Bra 512 5 [+\-\p{Nd}]++ 513 48 48 Ket 514 53 End 515------------------------------------------------------------------ 516 517/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/i,utf 518Memory allocation (code space): 29 519------------------------------------------------------------------ 520 0 23 Bra 521 5 /i A\x{391}\x{10427}\x{ff3a}\x{1fb0} 522 23 23 Ket 523 28 End 524------------------------------------------------------------------ 525 526/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/utf 527Memory allocation (code space): 29 528------------------------------------------------------------------ 529 0 23 Bra 530 5 A\x{391}\x{10427}\x{ff3a}\x{1fb0} 531 23 23 Ket 532 28 End 533------------------------------------------------------------------ 534 535/[\x{105}-\x{109}]/i,utf 536Memory allocation (code space): 23 537------------------------------------------------------------------ 538 0 17 Bra 539 5 [\x{104}-\x{109}] 540 17 17 Ket 541 22 End 542------------------------------------------------------------------ 543 544/( ( (?(1)0|) )* )/x 545Memory allocation (code space): 56 546------------------------------------------------------------------ 547 0 50 Bra 548 5 40 CBra 1 549 12 Brazero 550 13 27 SCBra 2 551 20 10 Cond 552 25 1 Cond ref 553 28 0 554 30 5 Alt 555 35 15 Ket 556 40 27 KetRmax 557 45 40 Ket 558 50 50 Ket 559 55 End 560------------------------------------------------------------------ 561 562/( (?(1)0|)* )/x 563Memory allocation (code space): 44 564------------------------------------------------------------------ 565 0 38 Bra 566 5 28 CBra 1 567 12 Brazero 568 13 10 SCond 569 18 1 Cond ref 570 21 0 571 23 5 Alt 572 28 15 KetRmax 573 33 28 Ket 574 38 38 Ket 575 43 End 576------------------------------------------------------------------ 577 578/[a]/ 579Memory allocation (code space): 13 580------------------------------------------------------------------ 581 0 7 Bra 582 5 a 583 7 7 Ket 584 12 End 585------------------------------------------------------------------ 586 587/[a]/utf 588Memory allocation (code space): 13 589------------------------------------------------------------------ 590 0 7 Bra 591 5 a 592 7 7 Ket 593 12 End 594------------------------------------------------------------------ 595 596/[\xaa]/ 597Memory allocation (code space): 13 598------------------------------------------------------------------ 599 0 7 Bra 600 5 \x{aa} 601 7 7 Ket 602 12 End 603------------------------------------------------------------------ 604 605/[\xaa]/utf 606Memory allocation (code space): 14 607------------------------------------------------------------------ 608 0 8 Bra 609 5 \x{aa} 610 8 8 Ket 611 13 End 612------------------------------------------------------------------ 613 614/[^a]/ 615Memory allocation (code space): 13 616------------------------------------------------------------------ 617 0 7 Bra 618 5 [^a] 619 7 7 Ket 620 12 End 621------------------------------------------------------------------ 622 623/[^a]/utf 624Memory allocation (code space): 13 625------------------------------------------------------------------ 626 0 7 Bra 627 5 [^a] 628 7 7 Ket 629 12 End 630------------------------------------------------------------------ 631 632/[^\xaa]/ 633Memory allocation (code space): 13 634------------------------------------------------------------------ 635 0 7 Bra 636 5 [^\x{aa}] 637 7 7 Ket 638 12 End 639------------------------------------------------------------------ 640 641/[^\xaa]/utf 642Memory allocation (code space): 14 643------------------------------------------------------------------ 644 0 8 Bra 645 5 [^\x{aa}] 646 8 8 Ket 647 13 End 648------------------------------------------------------------------ 649 650#pattern -memory 651 652/[^\d]/utf,ucp 653------------------------------------------------------------------ 654 0 15 Bra 655 5 [^\p{Nd}] 656 15 15 Ket 657 20 End 658------------------------------------------------------------------ 659 660/[[:^alpha:][:^cntrl:]]+/utf,ucp 661------------------------------------------------------------------ 662 0 19 Bra 663 5 [\P{L}\P{Cc}]++ 664 19 19 Ket 665 24 End 666------------------------------------------------------------------ 667 668/[[:^cntrl:][:^alpha:]]+/utf,ucp 669------------------------------------------------------------------ 670 0 19 Bra 671 5 [\P{Cc}\P{L}]++ 672 19 19 Ket 673 24 End 674------------------------------------------------------------------ 675 676/[[:alpha:]]+/utf,ucp 677------------------------------------------------------------------ 678 0 16 Bra 679 5 [\p{L}]++ 680 16 16 Ket 681 21 End 682------------------------------------------------------------------ 683 684/[[:^alpha:]\S]+/utf,ucp 685------------------------------------------------------------------ 686 0 19 Bra 687 5 [\P{L}\P{Xsp}]++ 688 19 19 Ket 689 24 End 690------------------------------------------------------------------ 691 692/abc(d|e)(*THEN)x(123(*THEN)4|567(b|q)(*THEN)xx)/ 693------------------------------------------------------------------ 694 0 93 Bra 695 5 abc 696 11 9 CBra 1 697 18 d 698 20 7 Alt 699 25 e 700 27 16 Ket 701 32 *THEN 702 33 x 703 35 16 CBra 2 704 42 123 705 48 *THEN 706 49 4 707 51 37 Alt 708 56 567 709 62 9 CBra 3 710 69 b 711 71 7 Alt 712 76 q 713 78 16 Ket 714 83 *THEN 715 84 xx 716 88 53 Ket 717 93 93 Ket 718 98 End 719------------------------------------------------------------------ 720 721/(((a\2)|(a*)\g<-1>))*a?/ 722------------------------------------------------------------------ 723 0 83 Bra 724 5 Brazero 725 6 70 SCBra 1 726 13 58 Once 727 18 24 CBra 2 728 25 12 CBra 3 729 32 a 730 34 \2 731 37 12 Ket 732 42 24 Alt 733 47 9 CBra 4 734 54 a* 735 56 9 Ket 736 61 47 Recurse 737 66 48 Ket 738 71 58 Ket 739 76 70 KetRmax 740 81 a?+ 741 83 83 Ket 742 88 End 743------------------------------------------------------------------ 744 745/((?+1)(\1))/ 746------------------------------------------------------------------ 747 0 47 Bra 748 5 37 Once 749 10 27 CBra 1 750 17 22 Recurse 751 22 10 CBra 2 752 29 \1 753 32 10 Ket 754 37 27 Ket 755 42 37 Ket 756 47 47 Ket 757 52 End 758------------------------------------------------------------------ 759 760"(?1)(?#?'){2}(a)" 761------------------------------------------------------------------ 762 0 29 Bra 763 5 15 Recurse 764 10 15 Recurse 765 15 9 CBra 1 766 22 a 767 24 9 Ket 768 29 29 Ket 769 34 End 770------------------------------------------------------------------ 771 772/.((?2)(?R)|\1|$)()/ 773------------------------------------------------------------------ 774 0 64 Bra 775 5 Any 776 6 41 Once 777 11 17 CBra 1 778 18 52 Recurse 779 23 0 Recurse 780 28 8 Alt 781 33 \1 782 36 6 Alt 783 41 $ 784 42 31 Ket 785 47 41 Ket 786 52 7 CBra 2 787 59 7 Ket 788 64 64 Ket 789 69 End 790------------------------------------------------------------------ 791 792/.((?3)(?R)()(?2)|\1|$)()/ 793------------------------------------------------------------------ 794 0 81 Bra 795 5 Any 796 6 58 Once 797 11 34 CBra 1 798 18 69 Recurse 799 23 0 Recurse 800 28 7 CBra 2 801 35 7 Ket 802 40 28 Recurse 803 45 8 Alt 804 50 \1 805 53 6 Alt 806 58 $ 807 59 48 Ket 808 64 58 Ket 809 69 7 CBra 3 810 76 7 Ket 811 81 81 Ket 812 86 End 813------------------------------------------------------------------ 814 815/(?1)()((((((\1++))\x85)+)|))/ 816------------------------------------------------------------------ 817 0 115 Bra 818 5 10 Recurse 819 10 7 CBra 1 820 17 7 Ket 821 22 88 CBra 2 822 29 71 CBra 3 823 36 59 CBra 4 824 43 47 CBra 5 825 50 33 CBra 6 826 57 21 CBra 7 827 64 9 Once 828 69 \1+ 829 73 9 Ket 830 78 21 Ket 831 83 33 Ket 832 88 \x{85} 833 90 47 KetRmax 834 95 59 Ket 835100 5 Alt 836105 76 Ket 837110 88 Ket 838115 115 Ket 839120 End 840------------------------------------------------------------------ 841 842# Check the absolute limit on nesting (?| etc. This varies with code unit 843# width because the workspace is a different number of bytes. It will fail 844# with link size 2 in 8-bit and 16-bit but not in 32-bit. 845 846/(?|(?|(?J:(?|(?x:(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?| 847))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 848/parens_nest_limit=1000,-fullbincode 849 850# Use "expand" to create some very long patterns with nested parentheses, in 851# order to test workspace overflow. Again, this varies with code unit width, 852# and even when it fails in two modes, the error offset differs. It also varies 853# with link size - hence multiple tests with different values. 854 855/(?'ABC'\[[bar](]{792}*THEN:\[A]{255}\[)]{793}/expand,-fullbincode,parens_nest_limit=1000 856 857/(?'ABC'\[[bar](]{793}*THEN:\[A]{255}\[)]{794}/expand,-fullbincode,parens_nest_limit=1000 858 859/(?'ABC'\[[bar](]{1793}*THEN:\[A]{255}\[)]{1794}/expand,-fullbincode,parens_nest_limit=2000 860Failed: error 186 at offset 12820: regular expression is too complicated 861 862/(?(1)(?1)){8,}+()/debug 863------------------------------------------------------------------ 864 0 181 Bra 865 5 159 Once 866 10 13 Cond 867 15 1 Cond ref 868 18 169 Recurse 869 23 13 Ket 870 28 13 Cond 871 33 1 Cond ref 872 36 169 Recurse 873 41 13 Ket 874 46 13 Cond 875 51 1 Cond ref 876 54 169 Recurse 877 59 13 Ket 878 64 13 Cond 879 69 1 Cond ref 880 72 169 Recurse 881 77 13 Ket 882 82 13 Cond 883 87 1 Cond ref 884 90 169 Recurse 885 95 13 Ket 886100 13 Cond 887105 1 Cond ref 888108 169 Recurse 889113 13 Ket 890118 13 Cond 891123 1 Cond ref 892126 169 Recurse 893131 13 Ket 894136 23 SBraPos 895141 13 SCond 896146 1 Cond ref 897149 169 Recurse 898154 13 Ket 899159 23 KetRpos 900164 159 Ket 901169 7 CBra 1 902176 7 Ket 903181 181 Ket 904186 End 905------------------------------------------------------------------ 906Capturing subpattern count = 1 907Max back reference = 1 908May match empty string 909Subject length lower bound = 0 910 abcd 911 0: 912 1: 913 914/(?(1)|a(?1)b){2,}+()/debug 915------------------------------------------------------------------ 916 0 91 Bra 917 5 69 Once 918 10 8 Cond 919 15 1 Cond ref 920 18 14 Alt 921 23 a 922 25 79 Recurse 923 30 b 924 32 22 Ket 925 37 32 SBraPos 926 42 8 SCond 927 47 1 Cond ref 928 50 14 Alt 929 55 a 930 57 79 Recurse 931 62 b 932 64 22 Ket 933 69 32 KetRpos 934 74 69 Ket 935 79 7 CBra 1 936 86 7 Ket 937 91 91 Ket 938 96 End 939------------------------------------------------------------------ 940Capturing subpattern count = 1 941Max back reference = 1 942May match empty string 943Subject length lower bound = 0 944 abcde 945No match 946 947/((?1)(?2)(?3)(?4)(?5)(?6)(?7)(?8)(?9)(?9)(?8)(?7)(?6)(?5)(?4)(?3)(?2)(?1)(?0)){2,}()()()()()()()()()/debug 948------------------------------------------------------------------ 949 0 327 Bra 950 5 102 CBra 1 951 12 5 Recurse 952 17 219 Recurse 953 22 231 Recurse 954 27 243 Recurse 955 32 255 Recurse 956 37 267 Recurse 957 42 279 Recurse 958 47 291 Recurse 959 52 303 Recurse 960 57 303 Recurse 961 62 291 Recurse 962 67 279 Recurse 963 72 267 Recurse 964 77 255 Recurse 965 82 243 Recurse 966 87 231 Recurse 967 92 219 Recurse 968 97 5 Recurse 969102 0 Recurse 970107 102 Ket 971112 102 SCBra 1 972119 5 Recurse 973124 219 Recurse 974129 231 Recurse 975134 243 Recurse 976139 255 Recurse 977144 267 Recurse 978149 279 Recurse 979154 291 Recurse 980159 303 Recurse 981164 303 Recurse 982169 291 Recurse 983174 279 Recurse 984179 267 Recurse 985184 255 Recurse 986189 243 Recurse 987194 231 Recurse 988199 219 Recurse 989204 5 Recurse 990209 0 Recurse 991214 102 KetRmax 992219 7 CBra 2 993226 7 Ket 994231 7 CBra 3 995238 7 Ket 996243 7 CBra 4 997250 7 Ket 998255 7 CBra 5 999262 7 Ket 1000267 7 CBra 6 1001274 7 Ket 1002279 7 CBra 7 1003286 7 Ket 1004291 7 CBra 8 1005298 7 Ket 1006303 7 CBra 9 1007310 7 Ket 1008315 7 CBra 10 1009322 7 Ket 1010327 327 Ket 1011332 End 1012------------------------------------------------------------------ 1013Capturing subpattern count = 10 1014May match empty string 1015Subject length lower bound = 0 1016 1017/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)/ 1018Failed: error 114 at offset 509: missing closing parenthesis 1019 1020/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))/-fullbincode 1021 1022# End of testinput8 1023