1/-- This set of tests is for features that are compatible with all versions of 2 Perl >= 5.10, in non-UTF-8 mode. It should run clean for both the 8-bit and 3 16-bit PCRE libraries. --/ 4 5/the quick brown fox/ 6 the quick brown fox 7 0: the quick brown fox 8 The quick brown FOX 9No match 10 What do you know about the quick brown fox? 11 0: the quick brown fox 12 What do you know about THE QUICK BROWN FOX? 13No match 14 15/The quick brown fox/i 16 the quick brown fox 17 0: the quick brown fox 18 The quick brown FOX 19 0: The quick brown FOX 20 What do you know about the quick brown fox? 21 0: the quick brown fox 22 What do you know about THE QUICK BROWN FOX? 23 0: THE QUICK BROWN FOX 24 25/abcd\t\n\r\f\a\e\071\x3b\$\\\?caxyz/ 26 abcd\t\n\r\f\a\e9;\$\\?caxyz 27 0: abcd\x09\x0a\x0d\x0c\x07\x1b9;$\?caxyz 28 29/a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/ 30 abxyzpqrrrabbxyyyypqAzz 31 0: abxyzpqrrrabbxyyyypqAzz 32 abxyzpqrrrabbxyyyypqAzz 33 0: abxyzpqrrrabbxyyyypqAzz 34 aabxyzpqrrrabbxyyyypqAzz 35 0: aabxyzpqrrrabbxyyyypqAzz 36 aaabxyzpqrrrabbxyyyypqAzz 37 0: aaabxyzpqrrrabbxyyyypqAzz 38 aaaabxyzpqrrrabbxyyyypqAzz 39 0: aaaabxyzpqrrrabbxyyyypqAzz 40 abcxyzpqrrrabbxyyyypqAzz 41 0: abcxyzpqrrrabbxyyyypqAzz 42 aabcxyzpqrrrabbxyyyypqAzz 43 0: aabcxyzpqrrrabbxyyyypqAzz 44 aaabcxyzpqrrrabbxyyyypAzz 45 0: aaabcxyzpqrrrabbxyyyypAzz 46 aaabcxyzpqrrrabbxyyyypqAzz 47 0: aaabcxyzpqrrrabbxyyyypqAzz 48 aaabcxyzpqrrrabbxyyyypqqAzz 49 0: aaabcxyzpqrrrabbxyyyypqqAzz 50 aaabcxyzpqrrrabbxyyyypqqqAzz 51 0: aaabcxyzpqrrrabbxyyyypqqqAzz 52 aaabcxyzpqrrrabbxyyyypqqqqAzz 53 0: aaabcxyzpqrrrabbxyyyypqqqqAzz 54 aaabcxyzpqrrrabbxyyyypqqqqqAzz 55 0: aaabcxyzpqrrrabbxyyyypqqqqqAzz 56 aaabcxyzpqrrrabbxyyyypqqqqqqAzz 57 0: aaabcxyzpqrrrabbxyyyypqqqqqqAzz 58 aaaabcxyzpqrrrabbxyyyypqAzz 59 0: aaaabcxyzpqrrrabbxyyyypqAzz 60 abxyzzpqrrrabbxyyyypqAzz 61 0: abxyzzpqrrrabbxyyyypqAzz 62 aabxyzzzpqrrrabbxyyyypqAzz 63 0: aabxyzzzpqrrrabbxyyyypqAzz 64 aaabxyzzzzpqrrrabbxyyyypqAzz 65 0: aaabxyzzzzpqrrrabbxyyyypqAzz 66 aaaabxyzzzzpqrrrabbxyyyypqAzz 67 0: aaaabxyzzzzpqrrrabbxyyyypqAzz 68 abcxyzzpqrrrabbxyyyypqAzz 69 0: abcxyzzpqrrrabbxyyyypqAzz 70 aabcxyzzzpqrrrabbxyyyypqAzz 71 0: aabcxyzzzpqrrrabbxyyyypqAzz 72 aaabcxyzzzzpqrrrabbxyyyypqAzz 73 0: aaabcxyzzzzpqrrrabbxyyyypqAzz 74 aaaabcxyzzzzpqrrrabbxyyyypqAzz 75 0: aaaabcxyzzzzpqrrrabbxyyyypqAzz 76 aaaabcxyzzzzpqrrrabbbxyyyypqAzz 77 0: aaaabcxyzzzzpqrrrabbbxyyyypqAzz 78 aaaabcxyzzzzpqrrrabbbxyyyyypqAzz 79 0: aaaabcxyzzzzpqrrrabbbxyyyyypqAzz 80 aaabcxyzpqrrrabbxyyyypABzz 81 0: aaabcxyzpqrrrabbxyyyypABzz 82 aaabcxyzpqrrrabbxyyyypABBzz 83 0: aaabcxyzpqrrrabbxyyyypABBzz 84 >>>aaabxyzpqrrrabbxyyyypqAzz 85 0: aaabxyzpqrrrabbxyyyypqAzz 86 >aaaabxyzpqrrrabbxyyyypqAzz 87 0: aaaabxyzpqrrrabbxyyyypqAzz 88 >>>>abcxyzpqrrrabbxyyyypqAzz 89 0: abcxyzpqrrrabbxyyyypqAzz 90 *** Failers 91No match 92 abxyzpqrrabbxyyyypqAzz 93No match 94 abxyzpqrrrrabbxyyyypqAzz 95No match 96 abxyzpqrrrabxyyyypqAzz 97No match 98 aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz 99No match 100 aaaabcxyzzzzpqrrrabbbxyyypqAzz 101No match 102 aaabcxyzpqrrrabbxyyyypqqqqqqqAzz 103No match 104 105/^(abc){1,2}zz/ 106 abczz 107 0: abczz 108 1: abc 109 abcabczz 110 0: abcabczz 111 1: abc 112 *** Failers 113No match 114 zz 115No match 116 abcabcabczz 117No match 118 >>abczz 119No match 120 121/^(b+?|a){1,2}?c/ 122 bc 123 0: bc 124 1: b 125 bbc 126 0: bbc 127 1: b 128 bbbc 129 0: bbbc 130 1: bb 131 bac 132 0: bac 133 1: a 134 bbac 135 0: bbac 136 1: a 137 aac 138 0: aac 139 1: a 140 abbbbbbbbbbbc 141 0: abbbbbbbbbbbc 142 1: bbbbbbbbbbb 143 bbbbbbbbbbbac 144 0: bbbbbbbbbbbac 145 1: a 146 *** Failers 147No match 148 aaac 149No match 150 abbbbbbbbbbbac 151No match 152 153/^(b+|a){1,2}c/ 154 bc 155 0: bc 156 1: b 157 bbc 158 0: bbc 159 1: bb 160 bbbc 161 0: bbbc 162 1: bbb 163 bac 164 0: bac 165 1: a 166 bbac 167 0: bbac 168 1: a 169 aac 170 0: aac 171 1: a 172 abbbbbbbbbbbc 173 0: abbbbbbbbbbbc 174 1: bbbbbbbbbbb 175 bbbbbbbbbbbac 176 0: bbbbbbbbbbbac 177 1: a 178 *** Failers 179No match 180 aaac 181No match 182 abbbbbbbbbbbac 183No match 184 185/^(b+|a){1,2}?bc/ 186 bbc 187 0: bbc 188 1: b 189 190/^(b*|ba){1,2}?bc/ 191 babc 192 0: babc 193 1: ba 194 bbabc 195 0: bbabc 196 1: ba 197 bababc 198 0: bababc 199 1: ba 200 *** Failers 201No match 202 bababbc 203No match 204 babababc 205No match 206 207/^(ba|b*){1,2}?bc/ 208 babc 209 0: babc 210 1: ba 211 bbabc 212 0: bbabc 213 1: ba 214 bababc 215 0: bababc 216 1: ba 217 *** Failers 218No match 219 bababbc 220No match 221 babababc 222No match 223 224/^\ca\cA\c[\c{\c:/ 225 \x01\x01\e;z 226 0: \x01\x01\x1b;z 227 228/^[ab\]cde]/ 229 athing 230 0: a 231 bthing 232 0: b 233 ]thing 234 0: ] 235 cthing 236 0: c 237 dthing 238 0: d 239 ething 240 0: e 241 *** Failers 242No match 243 fthing 244No match 245 [thing 246No match 247 \\thing 248No match 249 250/^[]cde]/ 251 ]thing 252 0: ] 253 cthing 254 0: c 255 dthing 256 0: d 257 ething 258 0: e 259 *** Failers 260No match 261 athing 262No match 263 fthing 264No match 265 266/^[^ab\]cde]/ 267 fthing 268 0: f 269 [thing 270 0: [ 271 \\thing 272 0: \ 273 *** Failers 274 0: * 275 athing 276No match 277 bthing 278No match 279 ]thing 280No match 281 cthing 282No match 283 dthing 284No match 285 ething 286No match 287 288/^[^]cde]/ 289 athing 290 0: a 291 fthing 292 0: f 293 *** Failers 294 0: * 295 ]thing 296No match 297 cthing 298No match 299 dthing 300No match 301 ething 302No match 303 304/^\�/ 305 � 306 0: \x81 307 308/^�/ 309 � 310 0: \xff 311 312/^[0-9]+$/ 313 0 314 0: 0 315 1 316 0: 1 317 2 318 0: 2 319 3 320 0: 3 321 4 322 0: 4 323 5 324 0: 5 325 6 326 0: 6 327 7 328 0: 7 329 8 330 0: 8 331 9 332 0: 9 333 10 334 0: 10 335 100 336 0: 100 337 *** Failers 338No match 339 abc 340No match 341 342/^.*nter/ 343 enter 344 0: enter 345 inter 346 0: inter 347 uponter 348 0: uponter 349 350/^xxx[0-9]+$/ 351 xxx0 352 0: xxx0 353 xxx1234 354 0: xxx1234 355 *** Failers 356No match 357 xxx 358No match 359 360/^.+[0-9][0-9][0-9]$/ 361 x123 362 0: x123 363 xx123 364 0: xx123 365 123456 366 0: 123456 367 *** Failers 368No match 369 123 370No match 371 x1234 372 0: x1234 373 374/^.+?[0-9][0-9][0-9]$/ 375 x123 376 0: x123 377 xx123 378 0: xx123 379 123456 380 0: 123456 381 *** Failers 382No match 383 123 384No match 385 x1234 386 0: x1234 387 388/^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/ 389 abc!pqr=apquxz.ixr.zzz.ac.uk 390 0: abc!pqr=apquxz.ixr.zzz.ac.uk 391 1: abc 392 2: pqr 393 *** Failers 394No match 395 !pqr=apquxz.ixr.zzz.ac.uk 396No match 397 abc!=apquxz.ixr.zzz.ac.uk 398No match 399 abc!pqr=apquxz:ixr.zzz.ac.uk 400No match 401 abc!pqr=apquxz.ixr.zzz.ac.ukk 402No match 403 404/:/ 405 Well, we need a colon: somewhere 406 0: : 407 *** Fail if we don't 408No match 409 410/([\da-f:]+)$/i 411 0abc 412 0: 0abc 413 1: 0abc 414 abc 415 0: abc 416 1: abc 417 fed 418 0: fed 419 1: fed 420 E 421 0: E 422 1: E 423 :: 424 0: :: 425 1: :: 426 5f03:12C0::932e 427 0: 5f03:12C0::932e 428 1: 5f03:12C0::932e 429 fed def 430 0: def 431 1: def 432 Any old stuff 433 0: ff 434 1: ff 435 *** Failers 436No match 437 0zzz 438No match 439 gzzz 440No match 441 fed\x20 442No match 443 Any old rubbish 444No match 445 446/^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/ 447 .1.2.3 448 0: .1.2.3 449 1: 1 450 2: 2 451 3: 3 452 A.12.123.0 453 0: A.12.123.0 454 1: 12 455 2: 123 456 3: 0 457 *** Failers 458No match 459 .1.2.3333 460No match 461 1.2.3 462No match 463 1234.2.3 464No match 465 466/^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/ 467 1 IN SOA non-sp1 non-sp2( 468 0: 1 IN SOA non-sp1 non-sp2( 469 1: 1 470 2: non-sp1 471 3: non-sp2 472 1 IN SOA non-sp1 non-sp2 ( 473 0: 1 IN SOA non-sp1 non-sp2 ( 474 1: 1 475 2: non-sp1 476 3: non-sp2 477 *** Failers 478No match 479 1IN SOA non-sp1 non-sp2( 480No match 481 482/^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/ 483 a. 484 0: a. 485 Z. 486 0: Z. 487 2. 488 0: 2. 489 ab-c.pq-r. 490 0: ab-c.pq-r. 491 1: .pq-r 492 sxk.zzz.ac.uk. 493 0: sxk.zzz.ac.uk. 494 1: .uk 495 x-.y-. 496 0: x-.y-. 497 1: .y- 498 *** Failers 499No match 500 -abc.peq. 501No match 502 503/^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/ 504 *.a 505 0: *.a 506 *.b0-a 507 0: *.b0-a 508 1: 0-a 509 *.c3-b.c 510 0: *.c3-b.c 511 1: 3-b 512 2: .c 513 *.c-a.b-c 514 0: *.c-a.b-c 515 1: -a 516 2: .b-c 517 3: -c 518 *** Failers 519No match 520 *.0 521No match 522 *.a- 523No match 524 *.a-b.c- 525No match 526 *.c-a.0-c 527No match 528 529/^(?=ab(de))(abd)(e)/ 530 abde 531 0: abde 532 1: de 533 2: abd 534 3: e 535 536/^(?!(ab)de|x)(abd)(f)/ 537 abdf 538 0: abdf 539 1: <unset> 540 2: abd 541 3: f 542 543/^(?=(ab(cd)))(ab)/ 544 abcd 545 0: ab 546 1: abcd 547 2: cd 548 3: ab 549 550/^[\da-f](\.[\da-f])*$/i 551 a.b.c.d 552 0: a.b.c.d 553 1: .d 554 A.B.C.D 555 0: A.B.C.D 556 1: .D 557 a.b.c.1.2.3.C 558 0: a.b.c.1.2.3.C 559 1: .C 560 561/^\".*\"\s*(;.*)?$/ 562 \"1234\" 563 0: "1234" 564 \"abcd\" ; 565 0: "abcd" ; 566 1: ; 567 \"\" ; rhubarb 568 0: "" ; rhubarb 569 1: ; rhubarb 570 *** Failers 571No match 572 \"1234\" : things 573No match 574 575/^$/ 576 \ 577 0: 578 *** Failers 579No match 580 581/ ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x 582 ab c 583 0: ab c 584 *** Failers 585No match 586 abc 587No match 588 ab cde 589No match 590 591/(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/ 592 ab c 593 0: ab c 594 *** Failers 595No match 596 abc 597No match 598 ab cde 599No match 600 601/^ a\ b[c ]d $/x 602 a bcd 603 0: a bcd 604 a b d 605 0: a b d 606 *** Failers 607No match 608 abcd 609No match 610 ab d 611No match 612 613/^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/ 614 abcdefhijklm 615 0: abcdefhijklm 616 1: abc 617 2: bc 618 3: c 619 4: def 620 5: ef 621 6: f 622 7: hij 623 8: ij 624 9: j 62510: klm 62611: lm 62712: m 628 629/^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/ 630 abcdefhijklm 631 0: abcdefhijklm 632 1: bc 633 2: c 634 3: ef 635 4: f 636 5: ij 637 6: j 638 7: lm 639 8: m 640 641/^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/ 642 a+ Z0+\x08\n\x1d\x12 643 0: a+ Z0+\x08\x0a\x1d\x12 644 645/^[.^$|()*+?{,}]+/ 646 .^\$(*+)|{?,?} 647 0: .^$(*+)|{?,?} 648 649/^a*\w/ 650 z 651 0: z 652 az 653 0: az 654 aaaz 655 0: aaaz 656 a 657 0: a 658 aa 659 0: aa 660 aaaa 661 0: aaaa 662 a+ 663 0: a 664 aa+ 665 0: aa 666 667/^a*?\w/ 668 z 669 0: z 670 az 671 0: a 672 aaaz 673 0: a 674 a 675 0: a 676 aa 677 0: a 678 aaaa 679 0: a 680 a+ 681 0: a 682 aa+ 683 0: a 684 685/^a+\w/ 686 az 687 0: az 688 aaaz 689 0: aaaz 690 aa 691 0: aa 692 aaaa 693 0: aaaa 694 aa+ 695 0: aa 696 697/^a+?\w/ 698 az 699 0: az 700 aaaz 701 0: aa 702 aa 703 0: aa 704 aaaa 705 0: aa 706 aa+ 707 0: aa 708 709/^\d{8}\w{2,}/ 710 1234567890 711 0: 1234567890 712 12345678ab 713 0: 12345678ab 714 12345678__ 715 0: 12345678__ 716 *** Failers 717No match 718 1234567 719No match 720 721/^[aeiou\d]{4,5}$/ 722 uoie 723 0: uoie 724 1234 725 0: 1234 726 12345 727 0: 12345 728 aaaaa 729 0: aaaaa 730 *** Failers 731No match 732 123456 733No match 734 735/^[aeiou\d]{4,5}?/ 736 uoie 737 0: uoie 738 1234 739 0: 1234 740 12345 741 0: 1234 742 aaaaa 743 0: aaaa 744 123456 745 0: 1234 746 747/\A(abc|def)=(\1){2,3}\Z/ 748 abc=abcabc 749 0: abc=abcabc 750 1: abc 751 2: abc 752 def=defdefdef 753 0: def=defdefdef 754 1: def 755 2: def 756 *** Failers 757No match 758 abc=defdef 759No match 760 761/^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\11*(\3\4)\1(?#)2$/ 762 abcdefghijkcda2 763 0: abcdefghijkcda2 764 1: a 765 2: b 766 3: c 767 4: d 768 5: e 769 6: f 770 7: g 771 8: h 772 9: i 77310: j 77411: k 77512: cd 776 abcdefghijkkkkcda2 777 0: abcdefghijkkkkcda2 778 1: a 779 2: b 780 3: c 781 4: d 782 5: e 783 6: f 784 7: g 785 8: h 786 9: i 78710: j 78811: k 78912: cd 790 791/(cat(a(ract|tonic)|erpillar)) \1()2(3)/ 792 cataract cataract23 793 0: cataract cataract23 794 1: cataract 795 2: aract 796 3: ract 797 4: 798 5: 3 799 catatonic catatonic23 800 0: catatonic catatonic23 801 1: catatonic 802 2: atonic 803 3: tonic 804 4: 805 5: 3 806 caterpillar caterpillar23 807 0: caterpillar caterpillar23 808 1: caterpillar 809 2: erpillar 810 3: <unset> 811 4: 812 5: 3 813 814 815/^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/ 816 From abcd Mon Sep 01 12:33:02 1997 817 0: From abcd Mon Sep 01 12:33 818 1: abcd 819 820/^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/ 821 From abcd Mon Sep 01 12:33:02 1997 822 0: From abcd Mon Sep 01 12:33 823 1: Sep 824 From abcd Mon Sep 1 12:33:02 1997 825 0: From abcd Mon Sep 1 12:33 826 1: Sep 827 *** Failers 828No match 829 From abcd Sep 01 12:33:02 1997 830No match 831 832/^12.34/s 833 12\n34 834 0: 12\x0a34 835 12\r34 836 0: 12\x0d34 837 838/\w+(?=\t)/ 839 the quick brown\t fox 840 0: brown 841 842/foo(?!bar)(.*)/ 843 foobar is foolish see? 844 0: foolish see? 845 1: lish see? 846 847/(?:(?!foo)...|^.{0,2})bar(.*)/ 848 foobar crowbar etc 849 0: rowbar etc 850 1: etc 851 barrel 852 0: barrel 853 1: rel 854 2barrel 855 0: 2barrel 856 1: rel 857 A barrel 858 0: A barrel 859 1: rel 860 861/^(\D*)(?=\d)(?!123)/ 862 abc456 863 0: abc 864 1: abc 865 *** Failers 866No match 867 abc123 868No match 869 870/^1234(?# test newlines 871 inside)/ 872 1234 873 0: 1234 874 875/^1234 #comment in extended re 876 /x 877 1234 878 0: 1234 879 880/#rhubarb 881 abcd/x 882 abcd 883 0: abcd 884 885/^abcd#rhubarb/x 886 abcd 887 0: abcd 888 889/^(a)\1{2,3}(.)/ 890 aaab 891 0: aaab 892 1: a 893 2: b 894 aaaab 895 0: aaaab 896 1: a 897 2: b 898 aaaaab 899 0: aaaaa 900 1: a 901 2: a 902 aaaaaab 903 0: aaaaa 904 1: a 905 2: a 906 907/(?!^)abc/ 908 the abc 909 0: abc 910 *** Failers 911No match 912 abc 913No match 914 915/(?=^)abc/ 916 abc 917 0: abc 918 *** Failers 919No match 920 the abc 921No match 922 923/^[ab]{1,3}(ab*|b)/ 924 aabbbbb 925 0: aabb 926 1: b 927 928/^[ab]{1,3}?(ab*|b)/ 929 aabbbbb 930 0: aabbbbb 931 1: abbbbb 932 933/^[ab]{1,3}?(ab*?|b)/ 934 aabbbbb 935 0: aa 936 1: a 937 938/^[ab]{1,3}(ab*?|b)/ 939 aabbbbb 940 0: aabb 941 1: b 942 943/ (?: [\040\t] | \( 944(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 945\) )* # optional leading comment 946(?: (?: 947[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 948(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 949| 950" (?: # opening quote... 951[^\\\x80-\xff\n\015"] # Anything except backslash and quote 952| # or 953\\ [^\x80-\xff] # Escaped something (something != CR) 954)* " # closing quote 955) # initial word 956(?: (?: [\040\t] | \( 957(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 958\) )* \. (?: [\040\t] | \( 959(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 960\) )* (?: 961[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 962(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 963| 964" (?: # opening quote... 965[^\\\x80-\xff\n\015"] # Anything except backslash and quote 966| # or 967\\ [^\x80-\xff] # Escaped something (something != CR) 968)* " # closing quote 969) )* # further okay, if led by a period 970(?: [\040\t] | \( 971(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 972\) )* @ (?: [\040\t] | \( 973(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 974\) )* (?: 975[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 976(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 977| \[ # [ 978(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 979\] # ] 980) # initial subdomain 981(?: # 982(?: [\040\t] | \( 983(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 984\) )* \. # if led by a period... 985(?: [\040\t] | \( 986(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 987\) )* (?: 988[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 989(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 990| \[ # [ 991(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 992\] # ] 993) # ...further okay 994)* 995# address 996| # or 997(?: 998[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 999(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1000| 1001" (?: # opening quote... 1002[^\\\x80-\xff\n\015"] # Anything except backslash and quote 1003| # or 1004\\ [^\x80-\xff] # Escaped something (something != CR) 1005)* " # closing quote 1006) # one word, optionally followed by.... 1007(?: 1008[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or... 1009\( 1010(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1011\) | # comments, or... 1012 1013" (?: # opening quote... 1014[^\\\x80-\xff\n\015"] # Anything except backslash and quote 1015| # or 1016\\ [^\x80-\xff] # Escaped something (something != CR) 1017)* " # closing quote 1018# quoted strings 1019)* 1020< (?: [\040\t] | \( 1021(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1022\) )* # leading < 1023(?: @ (?: [\040\t] | \( 1024(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1025\) )* (?: 1026[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1027(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1028| \[ # [ 1029(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 1030\] # ] 1031) # initial subdomain 1032(?: # 1033(?: [\040\t] | \( 1034(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1035\) )* \. # if led by a period... 1036(?: [\040\t] | \( 1037(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1038\) )* (?: 1039[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1040(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1041| \[ # [ 1042(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 1043\] # ] 1044) # ...further okay 1045)* 1046 1047(?: (?: [\040\t] | \( 1048(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1049\) )* , (?: [\040\t] | \( 1050(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1051\) )* @ (?: [\040\t] | \( 1052(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1053\) )* (?: 1054[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1055(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1056| \[ # [ 1057(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 1058\] # ] 1059) # initial subdomain 1060(?: # 1061(?: [\040\t] | \( 1062(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1063\) )* \. # if led by a period... 1064(?: [\040\t] | \( 1065(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1066\) )* (?: 1067[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1068(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1069| \[ # [ 1070(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 1071\] # ] 1072) # ...further okay 1073)* 1074)* # further okay, if led by comma 1075: # closing colon 1076(?: [\040\t] | \( 1077(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1078\) )* )? # optional route 1079(?: 1080[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1081(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1082| 1083" (?: # opening quote... 1084[^\\\x80-\xff\n\015"] # Anything except backslash and quote 1085| # or 1086\\ [^\x80-\xff] # Escaped something (something != CR) 1087)* " # closing quote 1088) # initial word 1089(?: (?: [\040\t] | \( 1090(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1091\) )* \. (?: [\040\t] | \( 1092(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1093\) )* (?: 1094[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1095(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1096| 1097" (?: # opening quote... 1098[^\\\x80-\xff\n\015"] # Anything except backslash and quote 1099| # or 1100\\ [^\x80-\xff] # Escaped something (something != CR) 1101)* " # closing quote 1102) )* # further okay, if led by a period 1103(?: [\040\t] | \( 1104(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1105\) )* @ (?: [\040\t] | \( 1106(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1107\) )* (?: 1108[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1109(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1110| \[ # [ 1111(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 1112\] # ] 1113) # initial subdomain 1114(?: # 1115(?: [\040\t] | \( 1116(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1117\) )* \. # if led by a period... 1118(?: [\040\t] | \( 1119(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1120\) )* (?: 1121[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1122(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1123| \[ # [ 1124(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 1125\] # ] 1126) # ...further okay 1127)* 1128# address spec 1129(?: [\040\t] | \( 1130(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1131\) )* > # trailing > 1132# name and address 1133) (?: [\040\t] | \( 1134(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1135\) )* # optional trailing comment 1136/x 1137 Alan Other <user\@dom.ain> 1138 0: Alan Other <user@dom.ain> 1139 <user\@dom.ain> 1140 0: user@dom.ain 1141 user\@dom.ain 1142 0: user@dom.ain 1143 \"A. Other\" <user.1234\@dom.ain> (a comment) 1144 0: "A. Other" <user.1234@dom.ain> (a comment) 1145 A. Other <user.1234\@dom.ain> (a comment) 1146 0: Other <user.1234@dom.ain> (a comment) 1147 \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay 1148 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay 1149 A missing angle <user\@some.where 1150 0: user@some.where 1151 *** Failers 1152No match 1153 The quick brown fox 1154No match 1155 1156/[\040\t]* # Nab whitespace. 1157(?: 1158\( # ( 1159[^\\\x80-\xff\n\015()] * # normal* 1160(?: # ( 1161(?: \\ [^\x80-\xff] | 1162\( # ( 1163[^\\\x80-\xff\n\015()] * # normal* 1164(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1165\) # ) 1166) # special 1167[^\\\x80-\xff\n\015()] * # normal* 1168)* # )* 1169\) # ) 1170[\040\t]* )* # If comment found, allow more spaces. 1171# optional leading comment 1172(?: 1173(?: 1174[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1175(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1176# Atom 1177| # or 1178" # " 1179[^\\\x80-\xff\n\015"] * # normal 1180(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* 1181" # " 1182# Quoted string 1183) 1184[\040\t]* # Nab whitespace. 1185(?: 1186\( # ( 1187[^\\\x80-\xff\n\015()] * # normal* 1188(?: # ( 1189(?: \\ [^\x80-\xff] | 1190\( # ( 1191[^\\\x80-\xff\n\015()] * # normal* 1192(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1193\) # ) 1194) # special 1195[^\\\x80-\xff\n\015()] * # normal* 1196)* # )* 1197\) # ) 1198[\040\t]* )* # If comment found, allow more spaces. 1199(?: 1200\. 1201[\040\t]* # Nab whitespace. 1202(?: 1203\( # ( 1204[^\\\x80-\xff\n\015()] * # normal* 1205(?: # ( 1206(?: \\ [^\x80-\xff] | 1207\( # ( 1208[^\\\x80-\xff\n\015()] * # normal* 1209(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1210\) # ) 1211) # special 1212[^\\\x80-\xff\n\015()] * # normal* 1213)* # )* 1214\) # ) 1215[\040\t]* )* # If comment found, allow more spaces. 1216(?: 1217[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1218(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1219# Atom 1220| # or 1221" # " 1222[^\\\x80-\xff\n\015"] * # normal 1223(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* 1224" # " 1225# Quoted string 1226) 1227[\040\t]* # Nab whitespace. 1228(?: 1229\( # ( 1230[^\\\x80-\xff\n\015()] * # normal* 1231(?: # ( 1232(?: \\ [^\x80-\xff] | 1233\( # ( 1234[^\\\x80-\xff\n\015()] * # normal* 1235(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1236\) # ) 1237) # special 1238[^\\\x80-\xff\n\015()] * # normal* 1239)* # )* 1240\) # ) 1241[\040\t]* )* # If comment found, allow more spaces. 1242# additional words 1243)* 1244@ 1245[\040\t]* # Nab whitespace. 1246(?: 1247\( # ( 1248[^\\\x80-\xff\n\015()] * # normal* 1249(?: # ( 1250(?: \\ [^\x80-\xff] | 1251\( # ( 1252[^\\\x80-\xff\n\015()] * # normal* 1253(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1254\) # ) 1255) # special 1256[^\\\x80-\xff\n\015()] * # normal* 1257)* # )* 1258\) # ) 1259[\040\t]* )* # If comment found, allow more spaces. 1260(?: 1261[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1262(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1263| 1264\[ # [ 1265(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 1266\] # ] 1267) 1268[\040\t]* # Nab whitespace. 1269(?: 1270\( # ( 1271[^\\\x80-\xff\n\015()] * # normal* 1272(?: # ( 1273(?: \\ [^\x80-\xff] | 1274\( # ( 1275[^\\\x80-\xff\n\015()] * # normal* 1276(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1277\) # ) 1278) # special 1279[^\\\x80-\xff\n\015()] * # normal* 1280)* # )* 1281\) # ) 1282[\040\t]* )* # If comment found, allow more spaces. 1283# optional trailing comments 1284(?: 1285\. 1286[\040\t]* # Nab whitespace. 1287(?: 1288\( # ( 1289[^\\\x80-\xff\n\015()] * # normal* 1290(?: # ( 1291(?: \\ [^\x80-\xff] | 1292\( # ( 1293[^\\\x80-\xff\n\015()] * # normal* 1294(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1295\) # ) 1296) # special 1297[^\\\x80-\xff\n\015()] * # normal* 1298)* # )* 1299\) # ) 1300[\040\t]* )* # If comment found, allow more spaces. 1301(?: 1302[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1303(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1304| 1305\[ # [ 1306(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 1307\] # ] 1308) 1309[\040\t]* # Nab whitespace. 1310(?: 1311\( # ( 1312[^\\\x80-\xff\n\015()] * # normal* 1313(?: # ( 1314(?: \\ [^\x80-\xff] | 1315\( # ( 1316[^\\\x80-\xff\n\015()] * # normal* 1317(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1318\) # ) 1319) # special 1320[^\\\x80-\xff\n\015()] * # normal* 1321)* # )* 1322\) # ) 1323[\040\t]* )* # If comment found, allow more spaces. 1324# optional trailing comments 1325)* 1326# address 1327| # or 1328(?: 1329[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1330(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1331# Atom 1332| # or 1333" # " 1334[^\\\x80-\xff\n\015"] * # normal 1335(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* 1336" # " 1337# Quoted string 1338) 1339# leading word 1340[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces 1341(?: 1342(?: 1343\( # ( 1344[^\\\x80-\xff\n\015()] * # normal* 1345(?: # ( 1346(?: \\ [^\x80-\xff] | 1347\( # ( 1348[^\\\x80-\xff\n\015()] * # normal* 1349(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1350\) # ) 1351) # special 1352[^\\\x80-\xff\n\015()] * # normal* 1353)* # )* 1354\) # ) 1355| 1356" # " 1357[^\\\x80-\xff\n\015"] * # normal 1358(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* 1359" # " 1360) # "special" comment or quoted string 1361[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal" 1362)* 1363< 1364[\040\t]* # Nab whitespace. 1365(?: 1366\( # ( 1367[^\\\x80-\xff\n\015()] * # normal* 1368(?: # ( 1369(?: \\ [^\x80-\xff] | 1370\( # ( 1371[^\\\x80-\xff\n\015()] * # normal* 1372(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1373\) # ) 1374) # special 1375[^\\\x80-\xff\n\015()] * # normal* 1376)* # )* 1377\) # ) 1378[\040\t]* )* # If comment found, allow more spaces. 1379# < 1380(?: 1381@ 1382[\040\t]* # Nab whitespace. 1383(?: 1384\( # ( 1385[^\\\x80-\xff\n\015()] * # normal* 1386(?: # ( 1387(?: \\ [^\x80-\xff] | 1388\( # ( 1389[^\\\x80-\xff\n\015()] * # normal* 1390(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1391\) # ) 1392) # special 1393[^\\\x80-\xff\n\015()] * # normal* 1394)* # )* 1395\) # ) 1396[\040\t]* )* # If comment found, allow more spaces. 1397(?: 1398[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1399(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1400| 1401\[ # [ 1402(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 1403\] # ] 1404) 1405[\040\t]* # Nab whitespace. 1406(?: 1407\( # ( 1408[^\\\x80-\xff\n\015()] * # normal* 1409(?: # ( 1410(?: \\ [^\x80-\xff] | 1411\( # ( 1412[^\\\x80-\xff\n\015()] * # normal* 1413(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1414\) # ) 1415) # special 1416[^\\\x80-\xff\n\015()] * # normal* 1417)* # )* 1418\) # ) 1419[\040\t]* )* # If comment found, allow more spaces. 1420# optional trailing comments 1421(?: 1422\. 1423[\040\t]* # Nab whitespace. 1424(?: 1425\( # ( 1426[^\\\x80-\xff\n\015()] * # normal* 1427(?: # ( 1428(?: \\ [^\x80-\xff] | 1429\( # ( 1430[^\\\x80-\xff\n\015()] * # normal* 1431(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1432\) # ) 1433) # special 1434[^\\\x80-\xff\n\015()] * # normal* 1435)* # )* 1436\) # ) 1437[\040\t]* )* # If comment found, allow more spaces. 1438(?: 1439[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1440(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1441| 1442\[ # [ 1443(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 1444\] # ] 1445) 1446[\040\t]* # Nab whitespace. 1447(?: 1448\( # ( 1449[^\\\x80-\xff\n\015()] * # normal* 1450(?: # ( 1451(?: \\ [^\x80-\xff] | 1452\( # ( 1453[^\\\x80-\xff\n\015()] * # normal* 1454(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1455\) # ) 1456) # special 1457[^\\\x80-\xff\n\015()] * # normal* 1458)* # )* 1459\) # ) 1460[\040\t]* )* # If comment found, allow more spaces. 1461# optional trailing comments 1462)* 1463(?: , 1464[\040\t]* # Nab whitespace. 1465(?: 1466\( # ( 1467[^\\\x80-\xff\n\015()] * # normal* 1468(?: # ( 1469(?: \\ [^\x80-\xff] | 1470\( # ( 1471[^\\\x80-\xff\n\015()] * # normal* 1472(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1473\) # ) 1474) # special 1475[^\\\x80-\xff\n\015()] * # normal* 1476)* # )* 1477\) # ) 1478[\040\t]* )* # If comment found, allow more spaces. 1479@ 1480[\040\t]* # Nab whitespace. 1481(?: 1482\( # ( 1483[^\\\x80-\xff\n\015()] * # normal* 1484(?: # ( 1485(?: \\ [^\x80-\xff] | 1486\( # ( 1487[^\\\x80-\xff\n\015()] * # normal* 1488(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1489\) # ) 1490) # special 1491[^\\\x80-\xff\n\015()] * # normal* 1492)* # )* 1493\) # ) 1494[\040\t]* )* # If comment found, allow more spaces. 1495(?: 1496[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1497(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1498| 1499\[ # [ 1500(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 1501\] # ] 1502) 1503[\040\t]* # Nab whitespace. 1504(?: 1505\( # ( 1506[^\\\x80-\xff\n\015()] * # normal* 1507(?: # ( 1508(?: \\ [^\x80-\xff] | 1509\( # ( 1510[^\\\x80-\xff\n\015()] * # normal* 1511(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1512\) # ) 1513) # special 1514[^\\\x80-\xff\n\015()] * # normal* 1515)* # )* 1516\) # ) 1517[\040\t]* )* # If comment found, allow more spaces. 1518# optional trailing comments 1519(?: 1520\. 1521[\040\t]* # Nab whitespace. 1522(?: 1523\( # ( 1524[^\\\x80-\xff\n\015()] * # normal* 1525(?: # ( 1526(?: \\ [^\x80-\xff] | 1527\( # ( 1528[^\\\x80-\xff\n\015()] * # normal* 1529(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1530\) # ) 1531) # special 1532[^\\\x80-\xff\n\015()] * # normal* 1533)* # )* 1534\) # ) 1535[\040\t]* )* # If comment found, allow more spaces. 1536(?: 1537[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1538(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1539| 1540\[ # [ 1541(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 1542\] # ] 1543) 1544[\040\t]* # Nab whitespace. 1545(?: 1546\( # ( 1547[^\\\x80-\xff\n\015()] * # normal* 1548(?: # ( 1549(?: \\ [^\x80-\xff] | 1550\( # ( 1551[^\\\x80-\xff\n\015()] * # normal* 1552(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1553\) # ) 1554) # special 1555[^\\\x80-\xff\n\015()] * # normal* 1556)* # )* 1557\) # ) 1558[\040\t]* )* # If comment found, allow more spaces. 1559# optional trailing comments 1560)* 1561)* # additional domains 1562: 1563[\040\t]* # Nab whitespace. 1564(?: 1565\( # ( 1566[^\\\x80-\xff\n\015()] * # normal* 1567(?: # ( 1568(?: \\ [^\x80-\xff] | 1569\( # ( 1570[^\\\x80-\xff\n\015()] * # normal* 1571(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1572\) # ) 1573) # special 1574[^\\\x80-\xff\n\015()] * # normal* 1575)* # )* 1576\) # ) 1577[\040\t]* )* # If comment found, allow more spaces. 1578# optional trailing comments 1579)? # optional route 1580(?: 1581[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1582(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1583# Atom 1584| # or 1585" # " 1586[^\\\x80-\xff\n\015"] * # normal 1587(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* 1588" # " 1589# Quoted string 1590) 1591[\040\t]* # Nab whitespace. 1592(?: 1593\( # ( 1594[^\\\x80-\xff\n\015()] * # normal* 1595(?: # ( 1596(?: \\ [^\x80-\xff] | 1597\( # ( 1598[^\\\x80-\xff\n\015()] * # normal* 1599(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1600\) # ) 1601) # special 1602[^\\\x80-\xff\n\015()] * # normal* 1603)* # )* 1604\) # ) 1605[\040\t]* )* # If comment found, allow more spaces. 1606(?: 1607\. 1608[\040\t]* # Nab whitespace. 1609(?: 1610\( # ( 1611[^\\\x80-\xff\n\015()] * # normal* 1612(?: # ( 1613(?: \\ [^\x80-\xff] | 1614\( # ( 1615[^\\\x80-\xff\n\015()] * # normal* 1616(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1617\) # ) 1618) # special 1619[^\\\x80-\xff\n\015()] * # normal* 1620)* # )* 1621\) # ) 1622[\040\t]* )* # If comment found, allow more spaces. 1623(?: 1624[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1625(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1626# Atom 1627| # or 1628" # " 1629[^\\\x80-\xff\n\015"] * # normal 1630(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* 1631" # " 1632# Quoted string 1633) 1634[\040\t]* # Nab whitespace. 1635(?: 1636\( # ( 1637[^\\\x80-\xff\n\015()] * # normal* 1638(?: # ( 1639(?: \\ [^\x80-\xff] | 1640\( # ( 1641[^\\\x80-\xff\n\015()] * # normal* 1642(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1643\) # ) 1644) # special 1645[^\\\x80-\xff\n\015()] * # normal* 1646)* # )* 1647\) # ) 1648[\040\t]* )* # If comment found, allow more spaces. 1649# additional words 1650)* 1651@ 1652[\040\t]* # Nab whitespace. 1653(?: 1654\( # ( 1655[^\\\x80-\xff\n\015()] * # normal* 1656(?: # ( 1657(?: \\ [^\x80-\xff] | 1658\( # ( 1659[^\\\x80-\xff\n\015()] * # normal* 1660(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1661\) # ) 1662) # special 1663[^\\\x80-\xff\n\015()] * # normal* 1664)* # )* 1665\) # ) 1666[\040\t]* )* # If comment found, allow more spaces. 1667(?: 1668[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1669(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1670| 1671\[ # [ 1672(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 1673\] # ] 1674) 1675[\040\t]* # Nab whitespace. 1676(?: 1677\( # ( 1678[^\\\x80-\xff\n\015()] * # normal* 1679(?: # ( 1680(?: \\ [^\x80-\xff] | 1681\( # ( 1682[^\\\x80-\xff\n\015()] * # normal* 1683(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1684\) # ) 1685) # special 1686[^\\\x80-\xff\n\015()] * # normal* 1687)* # )* 1688\) # ) 1689[\040\t]* )* # If comment found, allow more spaces. 1690# optional trailing comments 1691(?: 1692\. 1693[\040\t]* # Nab whitespace. 1694(?: 1695\( # ( 1696[^\\\x80-\xff\n\015()] * # normal* 1697(?: # ( 1698(?: \\ [^\x80-\xff] | 1699\( # ( 1700[^\\\x80-\xff\n\015()] * # normal* 1701(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1702\) # ) 1703) # special 1704[^\\\x80-\xff\n\015()] * # normal* 1705)* # )* 1706\) # ) 1707[\040\t]* )* # If comment found, allow more spaces. 1708(?: 1709[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1710(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1711| 1712\[ # [ 1713(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 1714\] # ] 1715) 1716[\040\t]* # Nab whitespace. 1717(?: 1718\( # ( 1719[^\\\x80-\xff\n\015()] * # normal* 1720(?: # ( 1721(?: \\ [^\x80-\xff] | 1722\( # ( 1723[^\\\x80-\xff\n\015()] * # normal* 1724(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1725\) # ) 1726) # special 1727[^\\\x80-\xff\n\015()] * # normal* 1728)* # )* 1729\) # ) 1730[\040\t]* )* # If comment found, allow more spaces. 1731# optional trailing comments 1732)* 1733# address spec 1734> # > 1735# name and address 1736) 1737/x 1738 Alan Other <user\@dom.ain> 1739 0: Alan Other <user@dom.ain> 1740 <user\@dom.ain> 1741 0: user@dom.ain 1742 user\@dom.ain 1743 0: user@dom.ain 1744 \"A. Other\" <user.1234\@dom.ain> (a comment) 1745 0: "A. Other" <user.1234@dom.ain> 1746 A. Other <user.1234\@dom.ain> (a comment) 1747 0: Other <user.1234@dom.ain> 1748 \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay 1749 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay 1750 A missing angle <user\@some.where 1751 0: user@some.where 1752 *** Failers 1753No match 1754 The quick brown fox 1755No match 1756 1757/abc\0def\00pqr\000xyz\0000AB/ 1758 abc\0def\00pqr\000xyz\0000AB 1759 0: abc\x00def\x00pqr\x00xyz\x000AB 1760 abc456 abc\0def\00pqr\000xyz\0000ABCDE 1761 0: abc\x00def\x00pqr\x00xyz\x000AB 1762 1763/abc\x0def\x00pqr\x000xyz\x0000AB/ 1764 abc\x0def\x00pqr\x000xyz\x0000AB 1765 0: abc\x0def\x00pqr\x000xyz\x0000AB 1766 abc456 abc\x0def\x00pqr\x000xyz\x0000ABCDE 1767 0: abc\x0def\x00pqr\x000xyz\x0000AB 1768 1769/^[\000-\037]/ 1770 \0A 1771 0: \x00 1772 \01B 1773 0: \x01 1774 \037C 1775 0: \x1f 1776 1777/\0*/ 1778 \0\0\0\0 1779 0: \x00\x00\x00\x00 1780 1781/A\x0{2,3}Z/ 1782 The A\x0\x0Z 1783 0: A\x00\x00Z 1784 An A\0\x0\0Z 1785 0: A\x00\x00\x00Z 1786 *** Failers 1787No match 1788 A\0Z 1789No match 1790 A\0\x0\0\x0Z 1791No match 1792 1793/^(cow|)\1(bell)/ 1794 cowcowbell 1795 0: cowcowbell 1796 1: cow 1797 2: bell 1798 bell 1799 0: bell 1800 1: 1801 2: bell 1802 *** Failers 1803No match 1804 cowbell 1805No match 1806 1807/^\s/ 1808 \040abc 1809 0: 1810 \x0cabc 1811 0: \x0c 1812 \nabc 1813 0: \x0a 1814 \rabc 1815 0: \x0d 1816 \tabc 1817 0: \x09 1818 *** Failers 1819No match 1820 abc 1821No match 1822 1823/^a b 1824 c/x 1825 abc 1826 0: abc 1827 1828/^(a|)\1*b/ 1829 ab 1830 0: ab 1831 1: a 1832 aaaab 1833 0: aaaab 1834 1: a 1835 b 1836 0: b 1837 1: 1838 *** Failers 1839No match 1840 acb 1841No match 1842 1843/^(a|)\1+b/ 1844 aab 1845 0: aab 1846 1: a 1847 aaaab 1848 0: aaaab 1849 1: a 1850 b 1851 0: b 1852 1: 1853 *** Failers 1854No match 1855 ab 1856No match 1857 1858/^(a|)\1?b/ 1859 ab 1860 0: ab 1861 1: a 1862 aab 1863 0: aab 1864 1: a 1865 b 1866 0: b 1867 1: 1868 *** Failers 1869No match 1870 acb 1871No match 1872 1873/^(a|)\1{2}b/ 1874 aaab 1875 0: aaab 1876 1: a 1877 b 1878 0: b 1879 1: 1880 *** Failers 1881No match 1882 ab 1883No match 1884 aab 1885No match 1886 aaaab 1887No match 1888 1889/^(a|)\1{2,3}b/ 1890 aaab 1891 0: aaab 1892 1: a 1893 aaaab 1894 0: aaaab 1895 1: a 1896 b 1897 0: b 1898 1: 1899 *** Failers 1900No match 1901 ab 1902No match 1903 aab 1904No match 1905 aaaaab 1906No match 1907 1908/ab{1,3}bc/ 1909 abbbbc 1910 0: abbbbc 1911 abbbc 1912 0: abbbc 1913 abbc 1914 0: abbc 1915 *** Failers 1916No match 1917 abc 1918No match 1919 abbbbbc 1920No match 1921 1922/([^.]*)\.([^:]*):[T ]+(.*)/ 1923 track1.title:TBlah blah blah 1924 0: track1.title:TBlah blah blah 1925 1: track1 1926 2: title 1927 3: Blah blah blah 1928 1929/([^.]*)\.([^:]*):[T ]+(.*)/i 1930 track1.title:TBlah blah blah 1931 0: track1.title:TBlah blah blah 1932 1: track1 1933 2: title 1934 3: Blah blah blah 1935 1936/([^.]*)\.([^:]*):[t ]+(.*)/i 1937 track1.title:TBlah blah blah 1938 0: track1.title:TBlah blah blah 1939 1: track1 1940 2: title 1941 3: Blah blah blah 1942 1943/^[W-c]+$/ 1944 WXY_^abc 1945 0: WXY_^abc 1946 *** Failers 1947No match 1948 wxy 1949No match 1950 1951/^[W-c]+$/i 1952 WXY_^abc 1953 0: WXY_^abc 1954 wxy_^ABC 1955 0: wxy_^ABC 1956 1957/^[\x3f-\x5F]+$/i 1958 WXY_^abc 1959 0: WXY_^abc 1960 wxy_^ABC 1961 0: wxy_^ABC 1962 1963/^abc$/m 1964 abc 1965 0: abc 1966 qqq\nabc 1967 0: abc 1968 abc\nzzz 1969 0: abc 1970 qqq\nabc\nzzz 1971 0: abc 1972 1973/^abc$/ 1974 abc 1975 0: abc 1976 *** Failers 1977No match 1978 qqq\nabc 1979No match 1980 abc\nzzz 1981No match 1982 qqq\nabc\nzzz 1983No match 1984 1985/\Aabc\Z/m 1986 abc 1987 0: abc 1988 abc\n 1989 0: abc 1990 *** Failers 1991No match 1992 qqq\nabc 1993No match 1994 abc\nzzz 1995No match 1996 qqq\nabc\nzzz 1997No match 1998 1999/\A(.)*\Z/s 2000 abc\ndef 2001 0: abc\x0adef 2002 1: f 2003 2004/\A(.)*\Z/m 2005 *** Failers 2006 0: *** Failers 2007 1: s 2008 abc\ndef 2009No match 2010 2011/(?:b)|(?::+)/ 2012 b::c 2013 0: b 2014 c::b 2015 0: :: 2016 2017/[-az]+/ 2018 az- 2019 0: az- 2020 *** Failers 2021 0: a 2022 b 2023No match 2024 2025/[az-]+/ 2026 za- 2027 0: za- 2028 *** Failers 2029 0: a 2030 b 2031No match 2032 2033/[a\-z]+/ 2034 a-z 2035 0: a-z 2036 *** Failers 2037 0: a 2038 b 2039No match 2040 2041/[a-z]+/ 2042 abcdxyz 2043 0: abcdxyz 2044 2045/[\d-]+/ 2046 12-34 2047 0: 12-34 2048 *** Failers 2049No match 2050 aaa 2051No match 2052 2053/[\d-z]+/ 2054 12-34z 2055 0: 12-34z 2056 *** Failers 2057No match 2058 aaa 2059No match 2060 2061/\x5c/ 2062 \\ 2063 0: \ 2064 2065/\x20Z/ 2066 the Zoo 2067 0: Z 2068 *** Failers 2069No match 2070 Zulu 2071No match 2072 2073/(abc)\1/i 2074 abcabc 2075 0: abcabc 2076 1: abc 2077 ABCabc 2078 0: ABCabc 2079 1: ABC 2080 abcABC 2081 0: abcABC 2082 1: abc 2083 2084/ab{3cd/ 2085 ab{3cd 2086 0: ab{3cd 2087 2088/ab{3,cd/ 2089 ab{3,cd 2090 0: ab{3,cd 2091 2092/ab{3,4a}cd/ 2093 ab{3,4a}cd 2094 0: ab{3,4a}cd 2095 2096/{4,5a}bc/ 2097 {4,5a}bc 2098 0: {4,5a}bc 2099 2100/abc$/ 2101 abc 2102 0: abc 2103 abc\n 2104 0: abc 2105 *** Failers 2106No match 2107 abc\ndef 2108No match 2109 2110/(abc)\123/ 2111 abc\x53 2112 0: abcS 2113 1: abc 2114 2115/(abc)\223/ 2116 abc\x93 2117 0: abc\x93 2118 1: abc 2119 2120/(abc)\323/ 2121 abc\xd3 2122 0: abc\xd3 2123 1: abc 2124 2125/(abc)\100/ 2126 abc\x40 2127 0: abc@ 2128 1: abc 2129 abc\100 2130 0: abc@ 2131 1: abc 2132 2133/(abc)\1000/ 2134 abc\x400 2135 0: abc@0 2136 1: abc 2137 abc\x40\x30 2138 0: abc@0 2139 1: abc 2140 abc\1000 2141 0: abc@0 2142 1: abc 2143 abc\100\x30 2144 0: abc@0 2145 1: abc 2146 abc\100\060 2147 0: abc@0 2148 1: abc 2149 abc\100\60 2150 0: abc@0 2151 1: abc 2152 2153/abc\81/ 2154 abc\081 2155 0: abc\x0081 2156 abc\0\x38\x31 2157 0: abc\x0081 2158 2159/abc\91/ 2160 abc\091 2161 0: abc\x0091 2162 abc\0\x39\x31 2163 0: abc\x0091 2164 2165/(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)\12\123/ 2166 abcdefghijkllS 2167 0: abcdefghijkllS 2168 1: a 2169 2: b 2170 3: c 2171 4: d 2172 5: e 2173 6: f 2174 7: g 2175 8: h 2176 9: i 217710: j 217811: k 217912: l 2180 2181/(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\123/ 2182 abcdefghijk\12S 2183 0: abcdefghijk\x0aS 2184 1: a 2185 2: b 2186 3: c 2187 4: d 2188 5: e 2189 6: f 2190 7: g 2191 8: h 2192 9: i 219310: j 219411: k 2195 2196/ab\idef/ 2197 abidef 2198 0: abidef 2199 2200/a{0}bc/ 2201 bc 2202 0: bc 2203 2204/(a|(bc)){0,0}?xyz/ 2205 xyz 2206 0: xyz 2207 2208/abc[\10]de/ 2209 abc\010de 2210 0: abc\x08de 2211 2212/abc[\1]de/ 2213 abc\1de 2214 0: abc\x01de 2215 2216/(abc)[\1]de/ 2217 abc\1de 2218 0: abc\x01de 2219 1: abc 2220 2221/(?s)a.b/ 2222 a\nb 2223 0: a\x0ab 2224 2225/^([^a])([^\b])([^c]*)([^d]{3,4})/ 2226 baNOTccccd 2227 0: baNOTcccc 2228 1: b 2229 2: a 2230 3: NOT 2231 4: cccc 2232 baNOTcccd 2233 0: baNOTccc 2234 1: b 2235 2: a 2236 3: NOT 2237 4: ccc 2238 baNOTccd 2239 0: baNOTcc 2240 1: b 2241 2: a 2242 3: NO 2243 4: Tcc 2244 bacccd 2245 0: baccc 2246 1: b 2247 2: a 2248 3: 2249 4: ccc 2250 *** Failers 2251 0: *** Failers 2252 1: * 2253 2: * 2254 3: * Fail 2255 4: ers 2256 anything 2257No match 2258 b\bc 2259No match 2260 baccd 2261No match 2262 2263/[^a]/ 2264 Abc 2265 0: A 2266 2267/[^a]/i 2268 Abc 2269 0: b 2270 2271/[^a]+/ 2272 AAAaAbc 2273 0: AAA 2274 2275/[^a]+/i 2276 AAAaAbc 2277 0: bc 2278 2279/[^a]+/ 2280 bbb\nccc 2281 0: bbb\x0accc 2282 2283/[^k]$/ 2284 abc 2285 0: c 2286 *** Failers 2287 0: s 2288 abk 2289No match 2290 2291/[^k]{2,3}$/ 2292 abc 2293 0: abc 2294 kbc 2295 0: bc 2296 kabc 2297 0: abc 2298 *** Failers 2299 0: ers 2300 abk 2301No match 2302 akb 2303No match 2304 akk 2305No match 2306 2307/^\d{8,}\@.+[^k]$/ 2308 12345678\@a.b.c.d 2309 0: 12345678@a.b.c.d 2310 123456789\@x.y.z 2311 0: 123456789@x.y.z 2312 *** Failers 2313No match 2314 12345678\@x.y.uk 2315No match 2316 1234567\@a.b.c.d 2317No match 2318 2319/(a)\1{8,}/ 2320 aaaaaaaaa 2321 0: aaaaaaaaa 2322 1: a 2323 aaaaaaaaaa 2324 0: aaaaaaaaaa 2325 1: a 2326 *** Failers 2327No match 2328 aaaaaaa 2329No match 2330 2331/[^a]/ 2332 aaaabcd 2333 0: b 2334 aaAabcd 2335 0: A 2336 2337/[^a]/i 2338 aaaabcd 2339 0: b 2340 aaAabcd 2341 0: b 2342 2343/[^az]/ 2344 aaaabcd 2345 0: b 2346 aaAabcd 2347 0: A 2348 2349/[^az]/i 2350 aaaabcd 2351 0: b 2352 aaAabcd 2353 0: b 2354 2355/\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377/ 2356 \000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377 2357 0: \x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff 2358 2359/P[^*]TAIRE[^*]{1,6}?LL/ 2360 xxxxxxxxxxxPSTAIREISLLxxxxxxxxx 2361 0: PSTAIREISLL 2362 2363/P[^*]TAIRE[^*]{1,}?LL/ 2364 xxxxxxxxxxxPSTAIREISLLxxxxxxxxx 2365 0: PSTAIREISLL 2366 2367/(\.\d\d[1-9]?)\d+/ 2368 1.230003938 2369 0: .230003938 2370 1: .23 2371 1.875000282 2372 0: .875000282 2373 1: .875 2374 1.235 2375 0: .235 2376 1: .23 2377 2378/(\.\d\d((?=0)|\d(?=\d)))/ 2379 1.230003938 2380 0: .23 2381 1: .23 2382 2: 2383 1.875000282 2384 0: .875 2385 1: .875 2386 2: 5 2387 *** Failers 2388No match 2389 1.235 2390No match 2391 2392/a(?)b/ 2393 ab 2394 0: ab 2395 2396/\b(foo)\s+(\w+)/i 2397 Food is on the foo table 2398 0: foo table 2399 1: foo 2400 2: table 2401 2402/foo(.*)bar/ 2403 The food is under the bar in the barn. 2404 0: food is under the bar in the bar 2405 1: d is under the bar in the 2406 2407/foo(.*?)bar/ 2408 The food is under the bar in the barn. 2409 0: food is under the bar 2410 1: d is under the 2411 2412/(.*)(\d*)/ 2413 I have 2 numbers: 53147 2414 0: I have 2 numbers: 53147 2415 1: I have 2 numbers: 53147 2416 2: 2417 2418/(.*)(\d+)/ 2419 I have 2 numbers: 53147 2420 0: I have 2 numbers: 53147 2421 1: I have 2 numbers: 5314 2422 2: 7 2423 2424/(.*?)(\d*)/ 2425 I have 2 numbers: 53147 2426 0: 2427 1: 2428 2: 2429 2430/(.*?)(\d+)/ 2431 I have 2 numbers: 53147 2432 0: I have 2 2433 1: I have 2434 2: 2 2435 2436/(.*)(\d+)$/ 2437 I have 2 numbers: 53147 2438 0: I have 2 numbers: 53147 2439 1: I have 2 numbers: 5314 2440 2: 7 2441 2442/(.*?)(\d+)$/ 2443 I have 2 numbers: 53147 2444 0: I have 2 numbers: 53147 2445 1: I have 2 numbers: 2446 2: 53147 2447 2448/(.*)\b(\d+)$/ 2449 I have 2 numbers: 53147 2450 0: I have 2 numbers: 53147 2451 1: I have 2 numbers: 2452 2: 53147 2453 2454/(.*\D)(\d+)$/ 2455 I have 2 numbers: 53147 2456 0: I have 2 numbers: 53147 2457 1: I have 2 numbers: 2458 2: 53147 2459 2460/^\D*(?!123)/ 2461 ABC123 2462 0: AB 2463 2464/^(\D*)(?=\d)(?!123)/ 2465 ABC445 2466 0: ABC 2467 1: ABC 2468 *** Failers 2469No match 2470 ABC123 2471No match 2472 2473/^[W-]46]/ 2474 W46]789 2475 0: W46] 2476 -46]789 2477 0: -46] 2478 *** Failers 2479No match 2480 Wall 2481No match 2482 Zebra 2483No match 2484 42 2485No match 2486 [abcd] 2487No match 2488 ]abcd[ 2489No match 2490 2491/^[W-\]46]/ 2492 W46]789 2493 0: W 2494 Wall 2495 0: W 2496 Zebra 2497 0: Z 2498 Xylophone 2499 0: X 2500 42 2501 0: 4 2502 [abcd] 2503 0: [ 2504 ]abcd[ 2505 0: ] 2506 \\backslash 2507 0: \ 2508 *** Failers 2509No match 2510 -46]789 2511No match 2512 well 2513No match 2514 2515/\d\d\/\d\d\/\d\d\d\d/ 2516 01/01/2000 2517 0: 01/01/2000 2518 2519/word (?:[a-zA-Z0-9]+ ){0,10}otherword/ 2520 word cat dog elephant mussel cow horse canary baboon snake shark otherword 2521 0: word cat dog elephant mussel cow horse canary baboon snake shark otherword 2522 word cat dog elephant mussel cow horse canary baboon snake shark 2523No match 2524 2525/word (?:[a-zA-Z0-9]+ ){0,300}otherword/ 2526 word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope 2527No match 2528 2529/^(a){0,0}/ 2530 bcd 2531 0: 2532 abc 2533 0: 2534 aab 2535 0: 2536 2537/^(a){0,1}/ 2538 bcd 2539 0: 2540 abc 2541 0: a 2542 1: a 2543 aab 2544 0: a 2545 1: a 2546 2547/^(a){0,2}/ 2548 bcd 2549 0: 2550 abc 2551 0: a 2552 1: a 2553 aab 2554 0: aa 2555 1: a 2556 2557/^(a){0,3}/ 2558 bcd 2559 0: 2560 abc 2561 0: a 2562 1: a 2563 aab 2564 0: aa 2565 1: a 2566 aaa 2567 0: aaa 2568 1: a 2569 2570/^(a){0,}/ 2571 bcd 2572 0: 2573 abc 2574 0: a 2575 1: a 2576 aab 2577 0: aa 2578 1: a 2579 aaa 2580 0: aaa 2581 1: a 2582 aaaaaaaa 2583 0: aaaaaaaa 2584 1: a 2585 2586/^(a){1,1}/ 2587 bcd 2588No match 2589 abc 2590 0: a 2591 1: a 2592 aab 2593 0: a 2594 1: a 2595 2596/^(a){1,2}/ 2597 bcd 2598No match 2599 abc 2600 0: a 2601 1: a 2602 aab 2603 0: aa 2604 1: a 2605 2606/^(a){1,3}/ 2607 bcd 2608No match 2609 abc 2610 0: a 2611 1: a 2612 aab 2613 0: aa 2614 1: a 2615 aaa 2616 0: aaa 2617 1: a 2618 2619/^(a){1,}/ 2620 bcd 2621No match 2622 abc 2623 0: a 2624 1: a 2625 aab 2626 0: aa 2627 1: a 2628 aaa 2629 0: aaa 2630 1: a 2631 aaaaaaaa 2632 0: aaaaaaaa 2633 1: a 2634 2635/.*\.gif/ 2636 borfle\nbib.gif\nno 2637 0: bib.gif 2638 2639/.{0,}\.gif/ 2640 borfle\nbib.gif\nno 2641 0: bib.gif 2642 2643/.*\.gif/m 2644 borfle\nbib.gif\nno 2645 0: bib.gif 2646 2647/.*\.gif/s 2648 borfle\nbib.gif\nno 2649 0: borfle\x0abib.gif 2650 2651/.*\.gif/ms 2652 borfle\nbib.gif\nno 2653 0: borfle\x0abib.gif 2654 2655/.*$/ 2656 borfle\nbib.gif\nno 2657 0: no 2658 2659/.*$/m 2660 borfle\nbib.gif\nno 2661 0: borfle 2662 2663/.*$/s 2664 borfle\nbib.gif\nno 2665 0: borfle\x0abib.gif\x0ano 2666 2667/.*$/ms 2668 borfle\nbib.gif\nno 2669 0: borfle\x0abib.gif\x0ano 2670 2671/.*$/ 2672 borfle\nbib.gif\nno\n 2673 0: no 2674 2675/.*$/m 2676 borfle\nbib.gif\nno\n 2677 0: borfle 2678 2679/.*$/s 2680 borfle\nbib.gif\nno\n 2681 0: borfle\x0abib.gif\x0ano\x0a 2682 2683/.*$/ms 2684 borfle\nbib.gif\nno\n 2685 0: borfle\x0abib.gif\x0ano\x0a 2686 2687/(.*X|^B)/ 2688 abcde\n1234Xyz 2689 0: 1234X 2690 1: 1234X 2691 BarFoo 2692 0: B 2693 1: B 2694 *** Failers 2695No match 2696 abcde\nBar 2697No match 2698 2699/(.*X|^B)/m 2700 abcde\n1234Xyz 2701 0: 1234X 2702 1: 1234X 2703 BarFoo 2704 0: B 2705 1: B 2706 abcde\nBar 2707 0: B 2708 1: B 2709 2710/(.*X|^B)/s 2711 abcde\n1234Xyz 2712 0: abcde\x0a1234X 2713 1: abcde\x0a1234X 2714 BarFoo 2715 0: B 2716 1: B 2717 *** Failers 2718No match 2719 abcde\nBar 2720No match 2721 2722/(.*X|^B)/ms 2723 abcde\n1234Xyz 2724 0: abcde\x0a1234X 2725 1: abcde\x0a1234X 2726 BarFoo 2727 0: B 2728 1: B 2729 abcde\nBar 2730 0: B 2731 1: B 2732 2733/(?s)(.*X|^B)/ 2734 abcde\n1234Xyz 2735 0: abcde\x0a1234X 2736 1: abcde\x0a1234X 2737 BarFoo 2738 0: B 2739 1: B 2740 *** Failers 2741No match 2742 abcde\nBar 2743No match 2744 2745/(?s:.*X|^B)/ 2746 abcde\n1234Xyz 2747 0: abcde\x0a1234X 2748 BarFoo 2749 0: B 2750 *** Failers 2751No match 2752 abcde\nBar 2753No match 2754 2755/^.*B/ 2756 **** Failers 2757No match 2758 abc\nB 2759No match 2760 2761/(?s)^.*B/ 2762 abc\nB 2763 0: abc\x0aB 2764 2765/(?m)^.*B/ 2766 abc\nB 2767 0: B 2768 2769/(?ms)^.*B/ 2770 abc\nB 2771 0: abc\x0aB 2772 2773/(?ms)^B/ 2774 abc\nB 2775 0: B 2776 2777/(?s)B$/ 2778 B\n 2779 0: B 2780 2781/^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/ 2782 123456654321 2783 0: 123456654321 2784 2785/^\d\d\d\d\d\d\d\d\d\d\d\d/ 2786 123456654321 2787 0: 123456654321 2788 2789/^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/ 2790 123456654321 2791 0: 123456654321 2792 2793/^[abc]{12}/ 2794 abcabcabcabc 2795 0: abcabcabcabc 2796 2797/^[a-c]{12}/ 2798 abcabcabcabc 2799 0: abcabcabcabc 2800 2801/^(a|b|c){12}/ 2802 abcabcabcabc 2803 0: abcabcabcabc 2804 1: c 2805 2806/^[abcdefghijklmnopqrstuvwxy0123456789]/ 2807 n 2808 0: n 2809 *** Failers 2810No match 2811 z 2812No match 2813 2814/abcde{0,0}/ 2815 abcd 2816 0: abcd 2817 *** Failers 2818No match 2819 abce 2820No match 2821 2822/ab[cd]{0,0}e/ 2823 abe 2824 0: abe 2825 *** Failers 2826No match 2827 abcde 2828No match 2829 2830/ab(c){0,0}d/ 2831 abd 2832 0: abd 2833 *** Failers 2834No match 2835 abcd 2836No match 2837 2838/a(b*)/ 2839 a 2840 0: a 2841 1: 2842 ab 2843 0: ab 2844 1: b 2845 abbbb 2846 0: abbbb 2847 1: bbbb 2848 *** Failers 2849 0: a 2850 1: 2851 bbbbb 2852No match 2853 2854/ab\d{0}e/ 2855 abe 2856 0: abe 2857 *** Failers 2858No match 2859 ab1e 2860No match 2861 2862/"([^\\"]+|\\.)*"/ 2863 the \"quick\" brown fox 2864 0: "quick" 2865 1: quick 2866 \"the \\\"quick\\\" brown fox\" 2867 0: "the \"quick\" brown fox" 2868 1: brown fox 2869 2870/.*?/g+ 2871 abc 2872 0: 2873 0+ abc 2874 0: a 2875 0+ bc 2876 0: 2877 0+ bc 2878 0: b 2879 0+ c 2880 0: 2881 0+ c 2882 0: c 2883 0+ 2884 0: 2885 0+ 2886 2887/\b/g+ 2888 abc 2889 0: 2890 0+ abc 2891 0: 2892 0+ 2893 2894/\b/+g 2895 abc 2896 0: 2897 0+ abc 2898 0: 2899 0+ 2900 2901//g 2902 abc 2903 0: 2904 0: 2905 0: 2906 0: 2907 2908/<tr([\w\W\s\d][^<>]{0,})><TD([\w\W\s\d][^<>]{0,})>([\d]{0,}\.)(.*)((<BR>([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/is 2909 <TR BGCOLOR='#DBE9E9'><TD align=left valign=top>43.<a href='joblist.cfm?JobID=94 6735&Keyword='>Word Processor<BR>(N-1286)</a></TD><TD align=left valign=top>Lega lstaff.com</TD><TD align=left valign=top>CA - Statewide</TD></TR> 2910 0: <TR BGCOLOR='#DBE9E9'><TD align=left valign=top>43.<a href='joblist.cfm?JobID=94 6735&Keyword='>Word Processor<BR>(N-1286)</a></TD><TD align=left valign=top>Lega lstaff.com</TD><TD align=left valign=top>CA - Statewide</TD></TR> 2911 1: BGCOLOR='#DBE9E9' 2912 2: align=left valign=top 2913 3: 43. 2914 4: <a href='joblist.cfm?JobID=94 6735&Keyword='>Word Processor<BR>(N-1286) 2915 5: 2916 6: 2917 7: <unset> 2918 8: align=left valign=top 2919 9: Lega lstaff.com 292010: align=left valign=top 292111: CA - Statewide 2922 2923/a[^a]b/ 2924 acb 2925 0: acb 2926 a\nb 2927 0: a\x0ab 2928 2929/a.b/ 2930 acb 2931 0: acb 2932 *** Failers 2933No match 2934 a\nb 2935No match 2936 2937/a[^a]b/s 2938 acb 2939 0: acb 2940 a\nb 2941 0: a\x0ab 2942 2943/a.b/s 2944 acb 2945 0: acb 2946 a\nb 2947 0: a\x0ab 2948 2949/^(b+?|a){1,2}?c/ 2950 bac 2951 0: bac 2952 1: a 2953 bbac 2954 0: bbac 2955 1: a 2956 bbbac 2957 0: bbbac 2958 1: a 2959 bbbbac 2960 0: bbbbac 2961 1: a 2962 bbbbbac 2963 0: bbbbbac 2964 1: a 2965 2966/^(b+|a){1,2}?c/ 2967 bac 2968 0: bac 2969 1: a 2970 bbac 2971 0: bbac 2972 1: a 2973 bbbac 2974 0: bbbac 2975 1: a 2976 bbbbac 2977 0: bbbbac 2978 1: a 2979 bbbbbac 2980 0: bbbbbac 2981 1: a 2982 2983/(?!\A)x/m 2984 x\nb\n 2985No match 2986 a\bx\n 2987 0: x 2988 2989/\x0{ab}/ 2990 \0{ab} 2991 0: \x00{ab} 2992 2993/(A|B)*?CD/ 2994 CD 2995 0: CD 2996 2997/(A|B)*CD/ 2998 CD 2999 0: CD 3000 3001/(AB)*?\1/ 3002 ABABAB 3003 0: ABAB 3004 1: AB 3005 3006/(AB)*\1/ 3007 ABABAB 3008 0: ABABAB 3009 1: AB 3010 3011/(?<!bar)foo/ 3012 foo 3013 0: foo 3014 catfood 3015 0: foo 3016 arfootle 3017 0: foo 3018 rfoosh 3019 0: foo 3020 *** Failers 3021No match 3022 barfoo 3023No match 3024 towbarfoo 3025No match 3026 3027/\w{3}(?<!bar)foo/ 3028 catfood 3029 0: catfoo 3030 *** Failers 3031No match 3032 foo 3033No match 3034 barfoo 3035No match 3036 towbarfoo 3037No match 3038 3039/(?<=(foo)a)bar/ 3040 fooabar 3041 0: bar 3042 1: foo 3043 *** Failers 3044No match 3045 bar 3046No match 3047 foobbar 3048No match 3049 3050/\Aabc\z/m 3051 abc 3052 0: abc 3053 *** Failers 3054No match 3055 abc\n 3056No match 3057 qqq\nabc 3058No match 3059 abc\nzzz 3060No match 3061 qqq\nabc\nzzz 3062No match 3063 3064"(?>.*/)foo" 3065 /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/ 3066No match 3067 3068"(?>.*/)foo" 3069 /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo 3070 0: /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo 3071 3072/(?>(\.\d\d[1-9]?))\d+/ 3073 1.230003938 3074 0: .230003938 3075 1: .23 3076 1.875000282 3077 0: .875000282 3078 1: .875 3079 *** Failers 3080No match 3081 1.235 3082No match 3083 3084/^((?>\w+)|(?>\s+))*$/ 3085 now is the time for all good men to come to the aid of the party 3086 0: now is the time for all good men to come to the aid of the party 3087 1: party 3088 *** Failers 3089No match 3090 this is not a line with only words and spaces! 3091No match 3092 3093/(\d+)(\w)/ 3094 12345a 3095 0: 12345a 3096 1: 12345 3097 2: a 3098 12345+ 3099 0: 12345 3100 1: 1234 3101 2: 5 3102 3103/((?>\d+))(\w)/ 3104 12345a 3105 0: 12345a 3106 1: 12345 3107 2: a 3108 *** Failers 3109No match 3110 12345+ 3111No match 3112 3113/(?>a+)b/ 3114 aaab 3115 0: aaab 3116 3117/((?>a+)b)/ 3118 aaab 3119 0: aaab 3120 1: aaab 3121 3122/(?>(a+))b/ 3123 aaab 3124 0: aaab 3125 1: aaa 3126 3127/(?>b)+/ 3128 aaabbbccc 3129 0: bbb 3130 3131/(?>a+|b+|c+)*c/ 3132 aaabbbbccccd 3133 0: aaabbbbc 3134 3135/((?>[^()]+)|\([^()]*\))+/ 3136 ((abc(ade)ufh()()x 3137 0: abc(ade)ufh()()x 3138 1: x 3139 3140/\(((?>[^()]+)|\([^()]+\))+\)/ 3141 (abc) 3142 0: (abc) 3143 1: abc 3144 (abc(def)xyz) 3145 0: (abc(def)xyz) 3146 1: xyz 3147 *** Failers 3148No match 3149 ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 3150No match 3151 3152/a(?-i)b/i 3153 ab 3154 0: ab 3155 Ab 3156 0: Ab 3157 *** Failers 3158No match 3159 aB 3160No match 3161 AB 3162No match 3163 3164/(a (?x)b c)d e/ 3165 a bcd e 3166 0: a bcd e 3167 1: a bc 3168 *** Failers 3169No match 3170 a b cd e 3171No match 3172 abcd e 3173No match 3174 a bcde 3175No match 3176 3177/(a b(?x)c d (?-x)e f)/ 3178 a bcde f 3179 0: a bcde f 3180 1: a bcde f 3181 *** Failers 3182No match 3183 abcdef 3184No match 3185 3186/(a(?i)b)c/ 3187 abc 3188 0: abc 3189 1: ab 3190 aBc 3191 0: aBc 3192 1: aB 3193 *** Failers 3194No match 3195 abC 3196No match 3197 aBC 3198No match 3199 Abc 3200No match 3201 ABc 3202No match 3203 ABC 3204No match 3205 AbC 3206No match 3207 3208/a(?i:b)c/ 3209 abc 3210 0: abc 3211 aBc 3212 0: aBc 3213 *** Failers 3214No match 3215 ABC 3216No match 3217 abC 3218No match 3219 aBC 3220No match 3221 3222/a(?i:b)*c/ 3223 aBc 3224 0: aBc 3225 aBBc 3226 0: aBBc 3227 *** Failers 3228No match 3229 aBC 3230No match 3231 aBBC 3232No match 3233 3234/a(?=b(?i)c)\w\wd/ 3235 abcd 3236 0: abcd 3237 abCd 3238 0: abCd 3239 *** Failers 3240No match 3241 aBCd 3242No match 3243 abcD 3244No match 3245 3246/(?s-i:more.*than).*million/i 3247 more than million 3248 0: more than million 3249 more than MILLION 3250 0: more than MILLION 3251 more \n than Million 3252 0: more \x0a than Million 3253 *** Failers 3254No match 3255 MORE THAN MILLION 3256No match 3257 more \n than \n million 3258No match 3259 3260/(?:(?s-i)more.*than).*million/i 3261 more than million 3262 0: more than million 3263 more than MILLION 3264 0: more than MILLION 3265 more \n than Million 3266 0: more \x0a than Million 3267 *** Failers 3268No match 3269 MORE THAN MILLION 3270No match 3271 more \n than \n million 3272No match 3273 3274/(?>a(?i)b+)+c/ 3275 abc 3276 0: abc 3277 aBbc 3278 0: aBbc 3279 aBBc 3280 0: aBBc 3281 *** Failers 3282No match 3283 Abc 3284No match 3285 abAb 3286No match 3287 abbC 3288No match 3289 3290/(?=a(?i)b)\w\wc/ 3291 abc 3292 0: abc 3293 aBc 3294 0: aBc 3295 *** Failers 3296No match 3297 Ab 3298No match 3299 abC 3300No match 3301 aBC 3302No match 3303 3304/(?<=a(?i)b)(\w\w)c/ 3305 abxxc 3306 0: xxc 3307 1: xx 3308 aBxxc 3309 0: xxc 3310 1: xx 3311 *** Failers 3312No match 3313 Abxxc 3314No match 3315 ABxxc 3316No match 3317 abxxC 3318No match 3319 3320/(?:(a)|b)(?(1)A|B)/ 3321 aA 3322 0: aA 3323 1: a 3324 bB 3325 0: bB 3326 *** Failers 3327No match 3328 aB 3329No match 3330 bA 3331No match 3332 3333/^(a)?(?(1)a|b)+$/ 3334 aa 3335 0: aa 3336 1: a 3337 b 3338 0: b 3339 bb 3340 0: bb 3341 *** Failers 3342No match 3343 ab 3344No match 3345 3346/^(?(?=abc)\w{3}:|\d\d)$/ 3347 abc: 3348 0: abc: 3349 12 3350 0: 12 3351 *** Failers 3352No match 3353 123 3354No match 3355 xyz 3356No match 3357 3358/^(?(?!abc)\d\d|\w{3}:)$/ 3359 abc: 3360 0: abc: 3361 12 3362 0: 12 3363 *** Failers 3364No match 3365 123 3366No match 3367 xyz 3368No match 3369 3370/(?(?<=foo)bar|cat)/ 3371 foobar 3372 0: bar 3373 cat 3374 0: cat 3375 fcat 3376 0: cat 3377 focat 3378 0: cat 3379 *** Failers 3380No match 3381 foocat 3382No match 3383 3384/(?(?<!foo)cat|bar)/ 3385 foobar 3386 0: bar 3387 cat 3388 0: cat 3389 fcat 3390 0: cat 3391 focat 3392 0: cat 3393 *** Failers 3394No match 3395 foocat 3396No match 3397 3398/( \( )? [^()]+ (?(1) \) |) /x 3399 abcd 3400 0: abcd 3401 (abcd) 3402 0: (abcd) 3403 1: ( 3404 the quick (abcd) fox 3405 0: the quick 3406 (abcd 3407 0: abcd 3408 3409/( \( )? [^()]+ (?(1) \) ) /x 3410 abcd 3411 0: abcd 3412 (abcd) 3413 0: (abcd) 3414 1: ( 3415 the quick (abcd) fox 3416 0: the quick 3417 (abcd 3418 0: abcd 3419 3420/^(?(2)a|(1)(2))+$/ 3421 12 3422 0: 12 3423 1: 1 3424 2: 2 3425 12a 3426 0: 12a 3427 1: 1 3428 2: 2 3429 12aa 3430 0: 12aa 3431 1: 1 3432 2: 2 3433 *** Failers 3434No match 3435 1234 3436No match 3437 3438/((?i)blah)\s+\1/ 3439 blah blah 3440 0: blah blah 3441 1: blah 3442 BLAH BLAH 3443 0: BLAH BLAH 3444 1: BLAH 3445 Blah Blah 3446 0: Blah Blah 3447 1: Blah 3448 blaH blaH 3449 0: blaH blaH 3450 1: blaH 3451 *** Failers 3452No match 3453 blah BLAH 3454No match 3455 Blah blah 3456No match 3457 blaH blah 3458No match 3459 3460/((?i)blah)\s+(?i:\1)/ 3461 blah blah 3462 0: blah blah 3463 1: blah 3464 BLAH BLAH 3465 0: BLAH BLAH 3466 1: BLAH 3467 Blah Blah 3468 0: Blah Blah 3469 1: Blah 3470 blaH blaH 3471 0: blaH blaH 3472 1: blaH 3473 blah BLAH 3474 0: blah BLAH 3475 1: blah 3476 Blah blah 3477 0: Blah blah 3478 1: Blah 3479 blaH blah 3480 0: blaH blah 3481 1: blaH 3482 3483/(?>a*)*/ 3484 a 3485 0: a 3486 aa 3487 0: aa 3488 aaaa 3489 0: aaaa 3490 3491/(abc|)+/ 3492 abc 3493 0: abc 3494 1: 3495 abcabc 3496 0: abcabc 3497 1: 3498 abcabcabc 3499 0: abcabcabc 3500 1: 3501 xyz 3502 0: 3503 1: 3504 3505/([a]*)*/ 3506 a 3507 0: a 3508 1: 3509 aaaaa 3510 0: aaaaa 3511 1: 3512 3513/([ab]*)*/ 3514 a 3515 0: a 3516 1: 3517 b 3518 0: b 3519 1: 3520 ababab 3521 0: ababab 3522 1: 3523 aaaabcde 3524 0: aaaab 3525 1: 3526 bbbb 3527 0: bbbb 3528 1: 3529 3530/([^a]*)*/ 3531 b 3532 0: b 3533 1: 3534 bbbb 3535 0: bbbb 3536 1: 3537 aaa 3538 0: 3539 1: 3540 3541/([^ab]*)*/ 3542 cccc 3543 0: cccc 3544 1: 3545 abab 3546 0: 3547 1: 3548 3549/([a]*?)*/ 3550 a 3551 0: 3552 1: 3553 aaaa 3554 0: 3555 1: 3556 3557/([ab]*?)*/ 3558 a 3559 0: 3560 1: 3561 b 3562 0: 3563 1: 3564 abab 3565 0: 3566 1: 3567 baba 3568 0: 3569 1: 3570 3571/([^a]*?)*/ 3572 b 3573 0: 3574 1: 3575 bbbb 3576 0: 3577 1: 3578 aaa 3579 0: 3580 1: 3581 3582/([^ab]*?)*/ 3583 c 3584 0: 3585 1: 3586 cccc 3587 0: 3588 1: 3589 baba 3590 0: 3591 1: 3592 3593/(?>a*)*/ 3594 a 3595 0: a 3596 aaabcde 3597 0: aaa 3598 3599/((?>a*))*/ 3600 aaaaa 3601 0: aaaaa 3602 1: 3603 aabbaa 3604 0: aa 3605 1: 3606 3607/((?>a*?))*/ 3608 aaaaa 3609 0: 3610 1: 3611 aabbaa 3612 0: 3613 1: 3614 3615/(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x 3616 12-sep-98 3617 0: 12-sep-98 3618 12-09-98 3619 0: 12-09-98 3620 *** Failers 3621No match 3622 sep-12-98 3623No match 3624 3625/(?<=(foo))bar\1/ 3626 foobarfoo 3627 0: barfoo 3628 1: foo 3629 foobarfootling 3630 0: barfoo 3631 1: foo 3632 *** Failers 3633No match 3634 foobar 3635No match 3636 barfoo 3637No match 3638 3639/(?i:saturday|sunday)/ 3640 saturday 3641 0: saturday 3642 sunday 3643 0: sunday 3644 Saturday 3645 0: Saturday 3646 Sunday 3647 0: Sunday 3648 SATURDAY 3649 0: SATURDAY 3650 SUNDAY 3651 0: SUNDAY 3652 SunDay 3653 0: SunDay 3654 3655/(a(?i)bc|BB)x/ 3656 abcx 3657 0: abcx 3658 1: abc 3659 aBCx 3660 0: aBCx 3661 1: aBC 3662 bbx 3663 0: bbx 3664 1: bb 3665 BBx 3666 0: BBx 3667 1: BB 3668 *** Failers 3669No match 3670 abcX 3671No match 3672 aBCX 3673No match 3674 bbX 3675No match 3676 BBX 3677No match 3678 3679/^([ab](?i)[cd]|[ef])/ 3680 ac 3681 0: ac 3682 1: ac 3683 aC 3684 0: aC 3685 1: aC 3686 bD 3687 0: bD 3688 1: bD 3689 elephant 3690 0: e 3691 1: e 3692 Europe 3693 0: E 3694 1: E 3695 frog 3696 0: f 3697 1: f 3698 France 3699 0: F 3700 1: F 3701 *** Failers 3702No match 3703 Africa 3704No match 3705 3706/^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/ 3707 ab 3708 0: ab 3709 1: ab 3710 aBd 3711 0: aBd 3712 1: aBd 3713 xy 3714 0: xy 3715 1: xy 3716 xY 3717 0: xY 3718 1: xY 3719 zebra 3720 0: z 3721 1: z 3722 Zambesi 3723 0: Z 3724 1: Z 3725 *** Failers 3726No match 3727 aCD 3728No match 3729 XY 3730No match 3731 3732/(?<=foo\n)^bar/m 3733 foo\nbar 3734 0: bar 3735 *** Failers 3736No match 3737 bar 3738No match 3739 baz\nbar 3740No match 3741 3742/(?<=(?<!foo)bar)baz/ 3743 barbaz 3744 0: baz 3745 barbarbaz 3746 0: baz 3747 koobarbaz 3748 0: baz 3749 *** Failers 3750No match 3751 baz 3752No match 3753 foobarbaz 3754No match 3755 3756/The cases of aaaa and aaaaaa are missed out below because Perl does things/ 3757/differently. We know that odd, and maybe incorrect, things happen with/ 3758No match 3759/recursive references in Perl, as far as 5.11.3 - see some stuff in test #2./ 3760No match 3761 3762/^(a\1?){4}$/ 3763 a 3764No match 3765 aa 3766No match 3767 aaa 3768No match 3769 aaaaa 3770 0: aaaaa 3771 1: a 3772 aaaaaaa 3773 0: aaaaaaa 3774 1: a 3775 aaaaaaaa 3776No match 3777 aaaaaaaaa 3778No match 3779 aaaaaaaaaa 3780 0: aaaaaaaaaa 3781 1: aaaa 3782 aaaaaaaaaaa 3783No match 3784 aaaaaaaaaaaa 3785No match 3786 aaaaaaaaaaaaa 3787No match 3788 aaaaaaaaaaaaaa 3789No match 3790 aaaaaaaaaaaaaaa 3791No match 3792 aaaaaaaaaaaaaaaa 3793No match 3794 3795/^(a\1?)(a\1?)(a\2?)(a\3?)$/ 3796 a 3797No match 3798 aa 3799No match 3800 aaa 3801No match 3802 aaaa 3803 0: aaaa 3804 1: a 3805 2: a 3806 3: a 3807 4: a 3808 aaaaa 3809 0: aaaaa 3810 1: a 3811 2: aa 3812 3: a 3813 4: a 3814 aaaaaa 3815 0: aaaaaa 3816 1: a 3817 2: aa 3818 3: a 3819 4: aa 3820 aaaaaaa 3821 0: aaaaaaa 3822 1: a 3823 2: aa 3824 3: aaa 3825 4: a 3826 aaaaaaaa 3827No match 3828 aaaaaaaaa 3829No match 3830 aaaaaaaaaa 3831 0: aaaaaaaaaa 3832 1: a 3833 2: aa 3834 3: aaa 3835 4: aaaa 3836 aaaaaaaaaaa 3837No match 3838 aaaaaaaaaaaa 3839No match 3840 aaaaaaaaaaaaa 3841No match 3842 aaaaaaaaaaaaaa 3843No match 3844 aaaaaaaaaaaaaaa 3845No match 3846 aaaaaaaaaaaaaaaa 3847No match 3848 3849/The following tests are taken from the Perl 5.005 test suite; some of them/ 3850/are compatible with 5.004, but I'd rather not have to sort them out./ 3851No match 3852 3853/abc/ 3854 abc 3855 0: abc 3856 xabcy 3857 0: abc 3858 ababc 3859 0: abc 3860 *** Failers 3861No match 3862 xbc 3863No match 3864 axc 3865No match 3866 abx 3867No match 3868 3869/ab*c/ 3870 abc 3871 0: abc 3872 3873/ab*bc/ 3874 abc 3875 0: abc 3876 abbc 3877 0: abbc 3878 abbbbc 3879 0: abbbbc 3880 3881/.{1}/ 3882 abbbbc 3883 0: a 3884 3885/.{3,4}/ 3886 abbbbc 3887 0: abbb 3888 3889/ab{0,}bc/ 3890 abbbbc 3891 0: abbbbc 3892 3893/ab+bc/ 3894 abbc 3895 0: abbc 3896 *** Failers 3897No match 3898 abc 3899No match 3900 abq 3901No match 3902 3903/ab{1,}bc/ 3904 3905/ab+bc/ 3906 abbbbc 3907 0: abbbbc 3908 3909/ab{1,}bc/ 3910 abbbbc 3911 0: abbbbc 3912 3913/ab{1,3}bc/ 3914 abbbbc 3915 0: abbbbc 3916 3917/ab{3,4}bc/ 3918 abbbbc 3919 0: abbbbc 3920 3921/ab{4,5}bc/ 3922 *** Failers 3923No match 3924 abq 3925No match 3926 abbbbc 3927No match 3928 3929/ab?bc/ 3930 abbc 3931 0: abbc 3932 abc 3933 0: abc 3934 3935/ab{0,1}bc/ 3936 abc 3937 0: abc 3938 3939/ab?bc/ 3940 3941/ab?c/ 3942 abc 3943 0: abc 3944 3945/ab{0,1}c/ 3946 abc 3947 0: abc 3948 3949/^abc$/ 3950 abc 3951 0: abc 3952 *** Failers 3953No match 3954 abbbbc 3955No match 3956 abcc 3957No match 3958 3959/^abc/ 3960 abcc 3961 0: abc 3962 3963/^abc$/ 3964 3965/abc$/ 3966 aabc 3967 0: abc 3968 *** Failers 3969No match 3970 aabc 3971 0: abc 3972 aabcd 3973No match 3974 3975/^/ 3976 abc 3977 0: 3978 3979/$/ 3980 abc 3981 0: 3982 3983/a.c/ 3984 abc 3985 0: abc 3986 axc 3987 0: axc 3988 3989/a.*c/ 3990 axyzc 3991 0: axyzc 3992 3993/a[bc]d/ 3994 abd 3995 0: abd 3996 *** Failers 3997No match 3998 axyzd 3999No match 4000 abc 4001No match 4002 4003/a[b-d]e/ 4004 ace 4005 0: ace 4006 4007/a[b-d]/ 4008 aac 4009 0: ac 4010 4011/a[-b]/ 4012 a- 4013 0: a- 4014 4015/a[b-]/ 4016 a- 4017 0: a- 4018 4019/a]/ 4020 a] 4021 0: a] 4022 4023/a[]]b/ 4024 a]b 4025 0: a]b 4026 4027/a[^bc]d/ 4028 aed 4029 0: aed 4030 *** Failers 4031No match 4032 abd 4033No match 4034 abd 4035No match 4036 4037/a[^-b]c/ 4038 adc 4039 0: adc 4040 4041/a[^]b]c/ 4042 adc 4043 0: adc 4044 *** Failers 4045No match 4046 a-c 4047 0: a-c 4048 a]c 4049No match 4050 4051/\ba\b/ 4052 a- 4053 0: a 4054 -a 4055 0: a 4056 -a- 4057 0: a 4058 4059/\by\b/ 4060 *** Failers 4061No match 4062 xy 4063No match 4064 yz 4065No match 4066 xyz 4067No match 4068 4069/\Ba\B/ 4070 *** Failers 4071 0: a 4072 a- 4073No match 4074 -a 4075No match 4076 -a- 4077No match 4078 4079/\By\b/ 4080 xy 4081 0: y 4082 4083/\by\B/ 4084 yz 4085 0: y 4086 4087/\By\B/ 4088 xyz 4089 0: y 4090 4091/\w/ 4092 a 4093 0: a 4094 4095/\W/ 4096 - 4097 0: - 4098 *** Failers 4099 0: * 4100 - 4101 0: - 4102 a 4103No match 4104 4105/a\sb/ 4106 a b 4107 0: a b 4108 4109/a\Sb/ 4110 a-b 4111 0: a-b 4112 *** Failers 4113No match 4114 a-b 4115 0: a-b 4116 a b 4117No match 4118 4119/\d/ 4120 1 4121 0: 1 4122 4123/\D/ 4124 - 4125 0: - 4126 *** Failers 4127 0: * 4128 - 4129 0: - 4130 1 4131No match 4132 4133/[\w]/ 4134 a 4135 0: a 4136 4137/[\W]/ 4138 - 4139 0: - 4140 *** Failers 4141 0: * 4142 - 4143 0: - 4144 a 4145No match 4146 4147/a[\s]b/ 4148 a b 4149 0: a b 4150 4151/a[\S]b/ 4152 a-b 4153 0: a-b 4154 *** Failers 4155No match 4156 a-b 4157 0: a-b 4158 a b 4159No match 4160 4161/[\d]/ 4162 1 4163 0: 1 4164 4165/[\D]/ 4166 - 4167 0: - 4168 *** Failers 4169 0: * 4170 - 4171 0: - 4172 1 4173No match 4174 4175/ab|cd/ 4176 abc 4177 0: ab 4178 abcd 4179 0: ab 4180 4181/()ef/ 4182 def 4183 0: ef 4184 1: 4185 4186/$b/ 4187 4188/a\(b/ 4189 a(b 4190 0: a(b 4191 4192/a\(*b/ 4193 ab 4194 0: ab 4195 a((b 4196 0: a((b 4197 4198/a\\b/ 4199 a\b 4200No match 4201 4202/((a))/ 4203 abc 4204 0: a 4205 1: a 4206 2: a 4207 4208/(a)b(c)/ 4209 abc 4210 0: abc 4211 1: a 4212 2: c 4213 4214/a+b+c/ 4215 aabbabc 4216 0: abc 4217 4218/a{1,}b{1,}c/ 4219 aabbabc 4220 0: abc 4221 4222/a.+?c/ 4223 abcabc 4224 0: abc 4225 4226/(a+|b)*/ 4227 ab 4228 0: ab 4229 1: b 4230 4231/(a+|b){0,}/ 4232 ab 4233 0: ab 4234 1: b 4235 4236/(a+|b)+/ 4237 ab 4238 0: ab 4239 1: b 4240 4241/(a+|b){1,}/ 4242 ab 4243 0: ab 4244 1: b 4245 4246/(a+|b)?/ 4247 ab 4248 0: a 4249 1: a 4250 4251/(a+|b){0,1}/ 4252 ab 4253 0: a 4254 1: a 4255 4256/[^ab]*/ 4257 cde 4258 0: cde 4259 4260/abc/ 4261 *** Failers 4262No match 4263 b 4264No match 4265 4266 4267/a*/ 4268 4269 4270/([abc])*d/ 4271 abbbcd 4272 0: abbbcd 4273 1: c 4274 4275/([abc])*bcd/ 4276 abcd 4277 0: abcd 4278 1: a 4279 4280/a|b|c|d|e/ 4281 e 4282 0: e 4283 4284/(a|b|c|d|e)f/ 4285 ef 4286 0: ef 4287 1: e 4288 4289/abcd*efg/ 4290 abcdefg 4291 0: abcdefg 4292 4293/ab*/ 4294 xabyabbbz 4295 0: ab 4296 xayabbbz 4297 0: a 4298 4299/(ab|cd)e/ 4300 abcde 4301 0: cde 4302 1: cd 4303 4304/[abhgefdc]ij/ 4305 hij 4306 0: hij 4307 4308/^(ab|cd)e/ 4309 4310/(abc|)ef/ 4311 abcdef 4312 0: ef 4313 1: 4314 4315/(a|b)c*d/ 4316 abcd 4317 0: bcd 4318 1: b 4319 4320/(ab|ab*)bc/ 4321 abc 4322 0: abc 4323 1: a 4324 4325/a([bc]*)c*/ 4326 abc 4327 0: abc 4328 1: bc 4329 4330/a([bc]*)(c*d)/ 4331 abcd 4332 0: abcd 4333 1: bc 4334 2: d 4335 4336/a([bc]+)(c*d)/ 4337 abcd 4338 0: abcd 4339 1: bc 4340 2: d 4341 4342/a([bc]*)(c+d)/ 4343 abcd 4344 0: abcd 4345 1: b 4346 2: cd 4347 4348/a[bcd]*dcdcde/ 4349 adcdcde 4350 0: adcdcde 4351 4352/a[bcd]+dcdcde/ 4353 *** Failers 4354No match 4355 abcde 4356No match 4357 adcdcde 4358No match 4359 4360/(ab|a)b*c/ 4361 abc 4362 0: abc 4363 1: ab 4364 4365/((a)(b)c)(d)/ 4366 abcd 4367 0: abcd 4368 1: abc 4369 2: a 4370 3: b 4371 4: d 4372 4373/[a-zA-Z_][a-zA-Z0-9_]*/ 4374 alpha 4375 0: alpha 4376 4377/^a(bc+|b[eh])g|.h$/ 4378 abh 4379 0: bh 4380 4381/(bc+d$|ef*g.|h?i(j|k))/ 4382 effgz 4383 0: effgz 4384 1: effgz 4385 ij 4386 0: ij 4387 1: ij 4388 2: j 4389 reffgz 4390 0: effgz 4391 1: effgz 4392 *** Failers 4393No match 4394 effg 4395No match 4396 bcdd 4397No match 4398 4399/((((((((((a))))))))))/ 4400 a 4401 0: a 4402 1: a 4403 2: a 4404 3: a 4405 4: a 4406 5: a 4407 6: a 4408 7: a 4409 8: a 4410 9: a 441110: a 4412 4413/((((((((((a))))))))))\10/ 4414 aa 4415 0: aa 4416 1: a 4417 2: a 4418 3: a 4419 4: a 4420 5: a 4421 6: a 4422 7: a 4423 8: a 4424 9: a 442510: a 4426 4427/(((((((((a)))))))))/ 4428 a 4429 0: a 4430 1: a 4431 2: a 4432 3: a 4433 4: a 4434 5: a 4435 6: a 4436 7: a 4437 8: a 4438 9: a 4439 4440/multiple words of text/ 4441 *** Failers 4442No match 4443 aa 4444No match 4445 uh-uh 4446No match 4447 4448/multiple words/ 4449 multiple words, yeah 4450 0: multiple words 4451 4452/(.*)c(.*)/ 4453 abcde 4454 0: abcde 4455 1: ab 4456 2: de 4457 4458/\((.*), (.*)\)/ 4459 (a, b) 4460 0: (a, b) 4461 1: a 4462 2: b 4463 4464/[k]/ 4465 4466/abcd/ 4467 abcd 4468 0: abcd 4469 4470/a(bc)d/ 4471 abcd 4472 0: abcd 4473 1: bc 4474 4475/a[-]?c/ 4476 ac 4477 0: ac 4478 4479/(abc)\1/ 4480 abcabc 4481 0: abcabc 4482 1: abc 4483 4484/([a-c]*)\1/ 4485 abcabc 4486 0: abcabc 4487 1: abc 4488 4489/(a)|\1/ 4490 a 4491 0: a 4492 1: a 4493 *** Failers 4494 0: a 4495 1: a 4496 ab 4497 0: a 4498 1: a 4499 x 4500No match 4501 4502/(([a-c])b*?\2)*/ 4503 ababbbcbc 4504 0: ababb 4505 1: bb 4506 2: b 4507 4508/(([a-c])b*?\2){3}/ 4509 ababbbcbc 4510 0: ababbbcbc 4511 1: cbc 4512 2: c 4513 4514/((\3|b)\2(a)x)+/ 4515 aaaxabaxbaaxbbax 4516 0: bbax 4517 1: bbax 4518 2: b 4519 3: a 4520 4521/((\3|b)\2(a)){2,}/ 4522 bbaababbabaaaaabbaaaabba 4523 0: bbaaaabba 4524 1: bba 4525 2: b 4526 3: a 4527 4528/abc/i 4529 ABC 4530 0: ABC 4531 XABCY 4532 0: ABC 4533 ABABC 4534 0: ABC 4535 *** Failers 4536No match 4537 aaxabxbaxbbx 4538No match 4539 XBC 4540No match 4541 AXC 4542No match 4543 ABX 4544No match 4545 4546/ab*c/i 4547 ABC 4548 0: ABC 4549 4550/ab*bc/i 4551 ABC 4552 0: ABC 4553 ABBC 4554 0: ABBC 4555 4556/ab*?bc/i 4557 ABBBBC 4558 0: ABBBBC 4559 4560/ab{0,}?bc/i 4561 ABBBBC 4562 0: ABBBBC 4563 4564/ab+?bc/i 4565 ABBC 4566 0: ABBC 4567 4568/ab+bc/i 4569 *** Failers 4570No match 4571 ABC 4572No match 4573 ABQ 4574No match 4575 4576/ab{1,}bc/i 4577 4578/ab+bc/i 4579 ABBBBC 4580 0: ABBBBC 4581 4582/ab{1,}?bc/i 4583 ABBBBC 4584 0: ABBBBC 4585 4586/ab{1,3}?bc/i 4587 ABBBBC 4588 0: ABBBBC 4589 4590/ab{3,4}?bc/i 4591 ABBBBC 4592 0: ABBBBC 4593 4594/ab{4,5}?bc/i 4595 *** Failers 4596No match 4597 ABQ 4598No match 4599 ABBBBC 4600No match 4601 4602/ab??bc/i 4603 ABBC 4604 0: ABBC 4605 ABC 4606 0: ABC 4607 4608/ab{0,1}?bc/i 4609 ABC 4610 0: ABC 4611 4612/ab??bc/i 4613 4614/ab??c/i 4615 ABC 4616 0: ABC 4617 4618/ab{0,1}?c/i 4619 ABC 4620 0: ABC 4621 4622/^abc$/i 4623 ABC 4624 0: ABC 4625 *** Failers 4626No match 4627 ABBBBC 4628No match 4629 ABCC 4630No match 4631 4632/^abc/i 4633 ABCC 4634 0: ABC 4635 4636/^abc$/i 4637 4638/abc$/i 4639 AABC 4640 0: ABC 4641 4642/^/i 4643 ABC 4644 0: 4645 4646/$/i 4647 ABC 4648 0: 4649 4650/a.c/i 4651 ABC 4652 0: ABC 4653 AXC 4654 0: AXC 4655 4656/a.*?c/i 4657 AXYZC 4658 0: AXYZC 4659 4660/a.*c/i 4661 *** Failers 4662No match 4663 AABC 4664 0: AABC 4665 AXYZD 4666No match 4667 4668/a[bc]d/i 4669 ABD 4670 0: ABD 4671 4672/a[b-d]e/i 4673 ACE 4674 0: ACE 4675 *** Failers 4676No match 4677 ABC 4678No match 4679 ABD 4680No match 4681 4682/a[b-d]/i 4683 AAC 4684 0: AC 4685 4686/a[-b]/i 4687 A- 4688 0: A- 4689 4690/a[b-]/i 4691 A- 4692 0: A- 4693 4694/a]/i 4695 A] 4696 0: A] 4697 4698/a[]]b/i 4699 A]B 4700 0: A]B 4701 4702/a[^bc]d/i 4703 AED 4704 0: AED 4705 4706/a[^-b]c/i 4707 ADC 4708 0: ADC 4709 *** Failers 4710No match 4711 ABD 4712No match 4713 A-C 4714No match 4715 4716/a[^]b]c/i 4717 ADC 4718 0: ADC 4719 4720/ab|cd/i 4721 ABC 4722 0: AB 4723 ABCD 4724 0: AB 4725 4726/()ef/i 4727 DEF 4728 0: EF 4729 1: 4730 4731/$b/i 4732 *** Failers 4733No match 4734 A]C 4735No match 4736 B 4737No match 4738 4739/a\(b/i 4740 A(B 4741 0: A(B 4742 4743/a\(*b/i 4744 AB 4745 0: AB 4746 A((B 4747 0: A((B 4748 4749/a\\b/i 4750 A\B 4751No match 4752 4753/((a))/i 4754 ABC 4755 0: A 4756 1: A 4757 2: A 4758 4759/(a)b(c)/i 4760 ABC 4761 0: ABC 4762 1: A 4763 2: C 4764 4765/a+b+c/i 4766 AABBABC 4767 0: ABC 4768 4769/a{1,}b{1,}c/i 4770 AABBABC 4771 0: ABC 4772 4773/a.+?c/i 4774 ABCABC 4775 0: ABC 4776 4777/a.*?c/i 4778 ABCABC 4779 0: ABC 4780 4781/a.{0,5}?c/i 4782 ABCABC 4783 0: ABC 4784 4785/(a+|b)*/i 4786 AB 4787 0: AB 4788 1: B 4789 4790/(a+|b){0,}/i 4791 AB 4792 0: AB 4793 1: B 4794 4795/(a+|b)+/i 4796 AB 4797 0: AB 4798 1: B 4799 4800/(a+|b){1,}/i 4801 AB 4802 0: AB 4803 1: B 4804 4805/(a+|b)?/i 4806 AB 4807 0: A 4808 1: A 4809 4810/(a+|b){0,1}/i 4811 AB 4812 0: A 4813 1: A 4814 4815/(a+|b){0,1}?/i 4816 AB 4817 0: 4818 4819/[^ab]*/i 4820 CDE 4821 0: CDE 4822 4823/abc/i 4824 4825/a*/i 4826 4827 4828/([abc])*d/i 4829 ABBBCD 4830 0: ABBBCD 4831 1: C 4832 4833/([abc])*bcd/i 4834 ABCD 4835 0: ABCD 4836 1: A 4837 4838/a|b|c|d|e/i 4839 E 4840 0: E 4841 4842/(a|b|c|d|e)f/i 4843 EF 4844 0: EF 4845 1: E 4846 4847/abcd*efg/i 4848 ABCDEFG 4849 0: ABCDEFG 4850 4851/ab*/i 4852 XABYABBBZ 4853 0: AB 4854 XAYABBBZ 4855 0: A 4856 4857/(ab|cd)e/i 4858 ABCDE 4859 0: CDE 4860 1: CD 4861 4862/[abhgefdc]ij/i 4863 HIJ 4864 0: HIJ 4865 4866/^(ab|cd)e/i 4867 ABCDE 4868No match 4869 4870/(abc|)ef/i 4871 ABCDEF 4872 0: EF 4873 1: 4874 4875/(a|b)c*d/i 4876 ABCD 4877 0: BCD 4878 1: B 4879 4880/(ab|ab*)bc/i 4881 ABC 4882 0: ABC 4883 1: A 4884 4885/a([bc]*)c*/i 4886 ABC 4887 0: ABC 4888 1: BC 4889 4890/a([bc]*)(c*d)/i 4891 ABCD 4892 0: ABCD 4893 1: BC 4894 2: D 4895 4896/a([bc]+)(c*d)/i 4897 ABCD 4898 0: ABCD 4899 1: BC 4900 2: D 4901 4902/a([bc]*)(c+d)/i 4903 ABCD 4904 0: ABCD 4905 1: B 4906 2: CD 4907 4908/a[bcd]*dcdcde/i 4909 ADCDCDE 4910 0: ADCDCDE 4911 4912/a[bcd]+dcdcde/i 4913 4914/(ab|a)b*c/i 4915 ABC 4916 0: ABC 4917 1: AB 4918 4919/((a)(b)c)(d)/i 4920 ABCD 4921 0: ABCD 4922 1: ABC 4923 2: A 4924 3: B 4925 4: D 4926 4927/[a-zA-Z_][a-zA-Z0-9_]*/i 4928 ALPHA 4929 0: ALPHA 4930 4931/^a(bc+|b[eh])g|.h$/i 4932 ABH 4933 0: BH 4934 4935/(bc+d$|ef*g.|h?i(j|k))/i 4936 EFFGZ 4937 0: EFFGZ 4938 1: EFFGZ 4939 IJ 4940 0: IJ 4941 1: IJ 4942 2: J 4943 REFFGZ 4944 0: EFFGZ 4945 1: EFFGZ 4946 *** Failers 4947No match 4948 ADCDCDE 4949No match 4950 EFFG 4951No match 4952 BCDD 4953No match 4954 4955/((((((((((a))))))))))/i 4956 A 4957 0: A 4958 1: A 4959 2: A 4960 3: A 4961 4: A 4962 5: A 4963 6: A 4964 7: A 4965 8: A 4966 9: A 496710: A 4968 4969/((((((((((a))))))))))\10/i 4970 AA 4971 0: AA 4972 1: A 4973 2: A 4974 3: A 4975 4: A 4976 5: A 4977 6: A 4978 7: A 4979 8: A 4980 9: A 498110: A 4982 4983/(((((((((a)))))))))/i 4984 A 4985 0: A 4986 1: A 4987 2: A 4988 3: A 4989 4: A 4990 5: A 4991 6: A 4992 7: A 4993 8: A 4994 9: A 4995 4996/(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))/i 4997 A 4998 0: A 4999 1: A 5000 5001/(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/i 5002 C 5003 0: C 5004 1: C 5005 5006/multiple words of text/i 5007 *** Failers 5008No match 5009 AA 5010No match 5011 UH-UH 5012No match 5013 5014/multiple words/i 5015 MULTIPLE WORDS, YEAH 5016 0: MULTIPLE WORDS 5017 5018/(.*)c(.*)/i 5019 ABCDE 5020 0: ABCDE 5021 1: AB 5022 2: DE 5023 5024/\((.*), (.*)\)/i 5025 (A, B) 5026 0: (A, B) 5027 1: A 5028 2: B 5029 5030/[k]/i 5031 5032/abcd/i 5033 ABCD 5034 0: ABCD 5035 5036/a(bc)d/i 5037 ABCD 5038 0: ABCD 5039 1: BC 5040 5041/a[-]?c/i 5042 AC 5043 0: AC 5044 5045/(abc)\1/i 5046 ABCABC 5047 0: ABCABC 5048 1: ABC 5049 5050/([a-c]*)\1/i 5051 ABCABC 5052 0: ABCABC 5053 1: ABC 5054 5055/a(?!b)./ 5056 abad 5057 0: ad 5058 5059/a(?=d)./ 5060 abad 5061 0: ad 5062 5063/a(?=c|d)./ 5064 abad 5065 0: ad 5066 5067/a(?:b|c|d)(.)/ 5068 ace 5069 0: ace 5070 1: e 5071 5072/a(?:b|c|d)*(.)/ 5073 ace 5074 0: ace 5075 1: e 5076 5077/a(?:b|c|d)+?(.)/ 5078 ace 5079 0: ace 5080 1: e 5081 acdbcdbe 5082 0: acd 5083 1: d 5084 5085/a(?:b|c|d)+(.)/ 5086 acdbcdbe 5087 0: acdbcdbe 5088 1: e 5089 5090/a(?:b|c|d){2}(.)/ 5091 acdbcdbe 5092 0: acdb 5093 1: b 5094 5095/a(?:b|c|d){4,5}(.)/ 5096 acdbcdbe 5097 0: acdbcdb 5098 1: b 5099 5100/a(?:b|c|d){4,5}?(.)/ 5101 acdbcdbe 5102 0: acdbcd 5103 1: d 5104 5105/((foo)|(bar))*/ 5106 foobar 5107 0: foobar 5108 1: bar 5109 2: foo 5110 3: bar 5111 5112/a(?:b|c|d){6,7}(.)/ 5113 acdbcdbe 5114 0: acdbcdbe 5115 1: e 5116 5117/a(?:b|c|d){6,7}?(.)/ 5118 acdbcdbe 5119 0: acdbcdbe 5120 1: e 5121 5122/a(?:b|c|d){5,6}(.)/ 5123 acdbcdbe 5124 0: acdbcdbe 5125 1: e 5126 5127/a(?:b|c|d){5,6}?(.)/ 5128 acdbcdbe 5129 0: acdbcdb 5130 1: b 5131 5132/a(?:b|c|d){5,7}(.)/ 5133 acdbcdbe 5134 0: acdbcdbe 5135 1: e 5136 5137/a(?:b|c|d){5,7}?(.)/ 5138 acdbcdbe 5139 0: acdbcdb 5140 1: b 5141 5142/a(?:b|(c|e){1,2}?|d)+?(.)/ 5143 ace 5144 0: ace 5145 1: c 5146 2: e 5147 5148/^(.+)?B/ 5149 AB 5150 0: AB 5151 1: A 5152 5153/^([^a-z])|(\^)$/ 5154 . 5155 0: . 5156 1: . 5157 5158/^[<>]&/ 5159 <&OUT 5160 0: <& 5161 5162/^(a\1?){4}$/ 5163 aaaaaaaaaa 5164 0: aaaaaaaaaa 5165 1: aaaa 5166 *** Failers 5167No match 5168 AB 5169No match 5170 aaaaaaaaa 5171No match 5172 aaaaaaaaaaa 5173No match 5174 5175/^(a(?(1)\1)){4}$/ 5176 aaaaaaaaaa 5177 0: aaaaaaaaaa 5178 1: aaaa 5179 *** Failers 5180No match 5181 aaaaaaaaa 5182No match 5183 aaaaaaaaaaa 5184No match 5185 5186/(?:(f)(o)(o)|(b)(a)(r))*/ 5187 foobar 5188 0: foobar 5189 1: f 5190 2: o 5191 3: o 5192 4: b 5193 5: a 5194 6: r 5195 5196/(?<=a)b/ 5197 ab 5198 0: b 5199 *** Failers 5200No match 5201 cb 5202No match 5203 b 5204No match 5205 5206/(?<!c)b/ 5207 ab 5208 0: b 5209 b 5210 0: b 5211 b 5212 0: b 5213 5214/(?:..)*a/ 5215 aba 5216 0: aba 5217 5218/(?:..)*?a/ 5219 aba 5220 0: a 5221 5222/^(?:b|a(?=(.)))*\1/ 5223 abc 5224 0: ab 5225 1: b 5226 5227/^(){3,5}/ 5228 abc 5229 0: 5230 1: 5231 5232/^(a+)*ax/ 5233 aax 5234 0: aax 5235 1: a 5236 5237/^((a|b)+)*ax/ 5238 aax 5239 0: aax 5240 1: a 5241 2: a 5242 5243/^((a|bc)+)*ax/ 5244 aax 5245 0: aax 5246 1: a 5247 2: a 5248 5249/(a|x)*ab/ 5250 cab 5251 0: ab 5252 5253/(a)*ab/ 5254 cab 5255 0: ab 5256 5257/(?:(?i)a)b/ 5258 ab 5259 0: ab 5260 5261/((?i)a)b/ 5262 ab 5263 0: ab 5264 1: a 5265 5266/(?:(?i)a)b/ 5267 Ab 5268 0: Ab 5269 5270/((?i)a)b/ 5271 Ab 5272 0: Ab 5273 1: A 5274 5275/(?:(?i)a)b/ 5276 *** Failers 5277No match 5278 cb 5279No match 5280 aB 5281No match 5282 5283/((?i)a)b/ 5284 5285/(?i:a)b/ 5286 ab 5287 0: ab 5288 5289/((?i:a))b/ 5290 ab 5291 0: ab 5292 1: a 5293 5294/(?i:a)b/ 5295 Ab 5296 0: Ab 5297 5298/((?i:a))b/ 5299 Ab 5300 0: Ab 5301 1: A 5302 5303/(?i:a)b/ 5304 *** Failers 5305No match 5306 aB 5307No match 5308 aB 5309No match 5310 5311/((?i:a))b/ 5312 5313/(?:(?-i)a)b/i 5314 ab 5315 0: ab 5316 5317/((?-i)a)b/i 5318 ab 5319 0: ab 5320 1: a 5321 5322/(?:(?-i)a)b/i 5323 aB 5324 0: aB 5325 5326/((?-i)a)b/i 5327 aB 5328 0: aB 5329 1: a 5330 5331/(?:(?-i)a)b/i 5332 *** Failers 5333No match 5334 aB 5335 0: aB 5336 Ab 5337No match 5338 5339/((?-i)a)b/i 5340 5341/(?:(?-i)a)b/i 5342 aB 5343 0: aB 5344 5345/((?-i)a)b/i 5346 aB 5347 0: aB 5348 1: a 5349 5350/(?:(?-i)a)b/i 5351 *** Failers 5352No match 5353 Ab 5354No match 5355 AB 5356No match 5357 5358/((?-i)a)b/i 5359 5360/(?-i:a)b/i 5361 ab 5362 0: ab 5363 5364/((?-i:a))b/i 5365 ab 5366 0: ab 5367 1: a 5368 5369/(?-i:a)b/i 5370 aB 5371 0: aB 5372 5373/((?-i:a))b/i 5374 aB 5375 0: aB 5376 1: a 5377 5378/(?-i:a)b/i 5379 *** Failers 5380No match 5381 AB 5382No match 5383 Ab 5384No match 5385 5386/((?-i:a))b/i 5387 5388/(?-i:a)b/i 5389 aB 5390 0: aB 5391 5392/((?-i:a))b/i 5393 aB 5394 0: aB 5395 1: a 5396 5397/(?-i:a)b/i 5398 *** Failers 5399No match 5400 Ab 5401No match 5402 AB 5403No match 5404 5405/((?-i:a))b/i 5406 5407/((?-i:a.))b/i 5408 *** Failers 5409No match 5410 AB 5411No match 5412 a\nB 5413No match 5414 5415/((?s-i:a.))b/i 5416 a\nB 5417 0: a\x0aB 5418 1: a\x0a 5419 5420/(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))/ 5421 cabbbb 5422 0: cabbbb 5423 5424/(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/ 5425 caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 5426 0: caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 5427 5428/(ab)\d\1/i 5429 Ab4ab 5430 0: Ab4ab 5431 1: Ab 5432 ab4Ab 5433 0: ab4Ab 5434 1: ab 5435 5436/foo\w*\d{4}baz/ 5437 foobar1234baz 5438 0: foobar1234baz 5439 5440/x(~~)*(?:(?:F)?)?/ 5441 x~~ 5442 0: x~~ 5443 1: ~~ 5444 5445/^a(?#xxx){3}c/ 5446 aaac 5447 0: aaac 5448 5449/^a (?#xxx) (?#yyy) {3}c/x 5450 aaac 5451 0: aaac 5452 5453/(?<![cd])b/ 5454 *** Failers 5455No match 5456 B\nB 5457No match 5458 dbcb 5459No match 5460 5461/(?<![cd])[ab]/ 5462 dbaacb 5463 0: a 5464 5465/(?<!(c|d))b/ 5466 5467/(?<!(c|d))[ab]/ 5468 dbaacb 5469 0: a 5470 5471/(?<!cd)[ab]/ 5472 cdaccb 5473 0: b 5474 5475/^(?:a?b?)*$/ 5476 \ 5477 0: 5478 a 5479 0: a 5480 ab 5481 0: ab 5482 aaa 5483 0: aaa 5484 *** Failers 5485No match 5486 dbcb 5487No match 5488 a-- 5489No match 5490 aa-- 5491No match 5492 5493/((?s)^a(.))((?m)^b$)/ 5494 a\nb\nc\n 5495 0: a\x0ab 5496 1: a\x0a 5497 2: \x0a 5498 3: b 5499 5500/((?m)^b$)/ 5501 a\nb\nc\n 5502 0: b 5503 1: b 5504 5505/(?m)^b/ 5506 a\nb\n 5507 0: b 5508 5509/(?m)^(b)/ 5510 a\nb\n 5511 0: b 5512 1: b 5513 5514/((?m)^b)/ 5515 a\nb\n 5516 0: b 5517 1: b 5518 5519/\n((?m)^b)/ 5520 a\nb\n 5521 0: \x0ab 5522 1: b 5523 5524/((?s).)c(?!.)/ 5525 a\nb\nc\n 5526 0: \x0ac 5527 1: \x0a 5528 a\nb\nc\n 5529 0: \x0ac 5530 1: \x0a 5531 5532/((?s)b.)c(?!.)/ 5533 a\nb\nc\n 5534 0: b\x0ac 5535 1: b\x0a 5536 a\nb\nc\n 5537 0: b\x0ac 5538 1: b\x0a 5539 5540/^b/ 5541 5542/()^b/ 5543 *** Failers 5544No match 5545 a\nb\nc\n 5546No match 5547 a\nb\nc\n 5548No match 5549 5550/((?m)^b)/ 5551 a\nb\nc\n 5552 0: b 5553 1: b 5554 5555/(x)?(?(1)a|b)/ 5556 *** Failers 5557No match 5558 a 5559No match 5560 a 5561No match 5562 5563/(x)?(?(1)b|a)/ 5564 a 5565 0: a 5566 5567/()?(?(1)b|a)/ 5568 a 5569 0: a 5570 5571/()(?(1)b|a)/ 5572 5573/()?(?(1)a|b)/ 5574 a 5575 0: a 5576 1: 5577 5578/^(\()?blah(?(1)(\)))$/ 5579 (blah) 5580 0: (blah) 5581 1: ( 5582 2: ) 5583 blah 5584 0: blah 5585 *** Failers 5586No match 5587 a 5588No match 5589 blah) 5590No match 5591 (blah 5592No match 5593 5594/^(\(+)?blah(?(1)(\)))$/ 5595 (blah) 5596 0: (blah) 5597 1: ( 5598 2: ) 5599 blah 5600 0: blah 5601 *** Failers 5602No match 5603 blah) 5604No match 5605 (blah 5606No match 5607 5608/(?(?!a)a|b)/ 5609 5610/(?(?!a)b|a)/ 5611 a 5612 0: a 5613 5614/(?(?=a)b|a)/ 5615 *** Failers 5616No match 5617 a 5618No match 5619 a 5620No match 5621 5622/(?(?=a)a|b)/ 5623 a 5624 0: a 5625 5626/(?=(a+?))(\1ab)/ 5627 aaab 5628 0: aab 5629 1: a 5630 2: aab 5631 5632/^(?=(a+?))\1ab/ 5633 5634/(\w+:)+/ 5635 one: 5636 0: one: 5637 1: one: 5638 5639/$(?<=^(a))/ 5640 a 5641 0: 5642 1: a 5643 5644/(?=(a+?))(\1ab)/ 5645 aaab 5646 0: aab 5647 1: a 5648 2: aab 5649 5650/^(?=(a+?))\1ab/ 5651 *** Failers 5652No match 5653 aaab 5654No match 5655 aaab 5656No match 5657 5658/([\w:]+::)?(\w+)$/ 5659 abcd 5660 0: abcd 5661 1: <unset> 5662 2: abcd 5663 xy:z:::abcd 5664 0: xy:z:::abcd 5665 1: xy:z::: 5666 2: abcd 5667 5668/^[^bcd]*(c+)/ 5669 aexycd 5670 0: aexyc 5671 1: c 5672 5673/(a*)b+/ 5674 caab 5675 0: aab 5676 1: aa 5677 5678/([\w:]+::)?(\w+)$/ 5679 abcd 5680 0: abcd 5681 1: <unset> 5682 2: abcd 5683 xy:z:::abcd 5684 0: xy:z:::abcd 5685 1: xy:z::: 5686 2: abcd 5687 *** Failers 5688 0: Failers 5689 1: <unset> 5690 2: Failers 5691 abcd: 5692No match 5693 abcd: 5694No match 5695 5696/^[^bcd]*(c+)/ 5697 aexycd 5698 0: aexyc 5699 1: c 5700 5701/(>a+)ab/ 5702 5703/(?>a+)b/ 5704 aaab 5705 0: aaab 5706 5707/([[:]+)/ 5708 a:[b]: 5709 0: :[ 5710 1: :[ 5711 5712/([[=]+)/ 5713 a=[b]= 5714 0: =[ 5715 1: =[ 5716 5717/([[.]+)/ 5718 a.[b]. 5719 0: .[ 5720 1: .[ 5721 5722/((?>a+)b)/ 5723 aaab 5724 0: aaab 5725 1: aaab 5726 5727/(?>(a+))b/ 5728 aaab 5729 0: aaab 5730 1: aaa 5731 5732/((?>[^()]+)|\([^()]*\))+/ 5733 ((abc(ade)ufh()()x 5734 0: abc(ade)ufh()()x 5735 1: x 5736 5737/a\Z/ 5738 *** Failers 5739No match 5740 aaab 5741No match 5742 a\nb\n 5743No match 5744 5745/b\Z/ 5746 a\nb\n 5747 0: b 5748 5749/b\z/ 5750 5751/b\Z/ 5752 a\nb 5753 0: b 5754 5755/b\z/ 5756 a\nb 5757 0: b 5758 *** Failers 5759No match 5760 5761/^(?>(?(1)\.|())[^\W_](?>[a-z0-9-]*[^\W_])?)+$/ 5762 a 5763 0: a 5764 1: 5765 abc 5766 0: abc 5767 1: 5768 a-b 5769 0: a-b 5770 1: 5771 0-9 5772 0: 0-9 5773 1: 5774 a.b 5775 0: a.b 5776 1: 5777 5.6.7 5778 0: 5.6.7 5779 1: 5780 the.quick.brown.fox 5781 0: the.quick.brown.fox 5782 1: 5783 a100.b200.300c 5784 0: a100.b200.300c 5785 1: 5786 12-ab.1245 5787 0: 12-ab.1245 5788 1: 5789 *** Failers 5790No match 5791 \ 5792No match 5793 .a 5794No match 5795 -a 5796No match 5797 a- 5798No match 5799 a. 5800No match 5801 a_b 5802No match 5803 a.- 5804No match 5805 a.. 5806No match 5807 ab..bc 5808No match 5809 the.quick.brown.fox- 5810No match 5811 the.quick.brown.fox. 5812No match 5813 the.quick.brown.fox_ 5814No match 5815 the.quick.brown.fox+ 5816No match 5817 5818/(?>.*)(?<=(abcd|wxyz))/ 5819 alphabetabcd 5820 0: alphabetabcd 5821 1: abcd 5822 endingwxyz 5823 0: endingwxyz 5824 1: wxyz 5825 *** Failers 5826No match 5827 a rather long string that doesn't end with one of them 5828No match 5829 5830/word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/ 5831 word cat dog elephant mussel cow horse canary baboon snake shark otherword 5832 0: word cat dog elephant mussel cow horse canary baboon snake shark otherword 5833 word cat dog elephant mussel cow horse canary baboon snake shark 5834No match 5835 5836/word (?>[a-zA-Z0-9]+ ){0,30}otherword/ 5837 word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope 5838No match 5839 5840/(?<=\d{3}(?!999))foo/ 5841 999foo 5842 0: foo 5843 123999foo 5844 0: foo 5845 *** Failers 5846No match 5847 123abcfoo 5848No match 5849 5850/(?<=(?!...999)\d{3})foo/ 5851 999foo 5852 0: foo 5853 123999foo 5854 0: foo 5855 *** Failers 5856No match 5857 123abcfoo 5858No match 5859 5860/(?<=\d{3}(?!999)...)foo/ 5861 123abcfoo 5862 0: foo 5863 123456foo 5864 0: foo 5865 *** Failers 5866No match 5867 123999foo 5868No match 5869 5870/(?<=\d{3}...)(?<!999)foo/ 5871 123abcfoo 5872 0: foo 5873 123456foo 5874 0: foo 5875 *** Failers 5876No match 5877 123999foo 5878No match 5879 5880/<a[\s]+href[\s]*=[\s]* # find <a href= 5881 ([\"\'])? # find single or double quote 5882 (?(1) (.*?)\1 | ([^\s]+)) # if quote found, match up to next matching 5883 # quote, otherwise match up to next space 5884/isx 5885 <a href=abcd xyz 5886 0: <a href=abcd 5887 1: <unset> 5888 2: <unset> 5889 3: abcd 5890 <a href=\"abcd xyz pqr\" cats 5891 0: <a href="abcd xyz pqr" 5892 1: " 5893 2: abcd xyz pqr 5894 <a href=\'abcd xyz pqr\' cats 5895 0: <a href='abcd xyz pqr' 5896 1: ' 5897 2: abcd xyz pqr 5898 5899/<a\s+href\s*=\s* # find <a href= 5900 (["'])? # find single or double quote 5901 (?(1) (.*?)\1 | (\S+)) # if quote found, match up to next matching 5902 # quote, otherwise match up to next space 5903/isx 5904 <a href=abcd xyz 5905 0: <a href=abcd 5906 1: <unset> 5907 2: <unset> 5908 3: abcd 5909 <a href=\"abcd xyz pqr\" cats 5910 0: <a href="abcd xyz pqr" 5911 1: " 5912 2: abcd xyz pqr 5913 <a href = \'abcd xyz pqr\' cats 5914 0: <a href = 'abcd xyz pqr' 5915 1: ' 5916 2: abcd xyz pqr 5917 5918/<a\s+href(?>\s*)=(?>\s*) # find <a href= 5919 (["'])? # find single or double quote 5920 (?(1) (.*?)\1 | (\S+)) # if quote found, match up to next matching 5921 # quote, otherwise match up to next space 5922/isx 5923 <a href=abcd xyz 5924 0: <a href=abcd 5925 1: <unset> 5926 2: <unset> 5927 3: abcd 5928 <a href=\"abcd xyz pqr\" cats 5929 0: <a href="abcd xyz pqr" 5930 1: " 5931 2: abcd xyz pqr 5932 <a href = \'abcd xyz pqr\' cats 5933 0: <a href = 'abcd xyz pqr' 5934 1: ' 5935 2: abcd xyz pqr 5936 5937/((Z)+|A)*/ 5938 ZABCDEFG 5939 0: ZA 5940 1: A 5941 2: Z 5942 5943/(Z()|A)*/ 5944 ZABCDEFG 5945 0: ZA 5946 1: A 5947 2: 5948 5949/(Z(())|A)*/ 5950 ZABCDEFG 5951 0: ZA 5952 1: A 5953 2: 5954 3: 5955 5956/((?>Z)+|A)*/ 5957 ZABCDEFG 5958 0: ZA 5959 1: A 5960 5961/((?>)+|A)*/ 5962 ZABCDEFG 5963 0: 5964 1: 5965 5966/a*/g 5967 abbab 5968 0: a 5969 0: 5970 0: 5971 0: a 5972 0: 5973 0: 5974 5975/^[a-\d]/ 5976 abcde 5977 0: a 5978 -things 5979 0: - 5980 0digit 5981 0: 0 5982 *** Failers 5983No match 5984 bcdef 5985No match 5986 5987/^[\d-a]/ 5988 abcde 5989 0: a 5990 -things 5991 0: - 5992 0digit 5993 0: 0 5994 *** Failers 5995No match 5996 bcdef 5997No match 5998 5999/[[:space:]]+/ 6000 > \x09\x0a\x0c\x0d\x0b< 6001 0: \x09\x0a\x0c\x0d\x0b 6002 6003/[[:blank:]]+/ 6004 > \x09\x0a\x0c\x0d\x0b< 6005 0: \x09 6006 6007/[\s]+/ 6008 > \x09\x0a\x0c\x0d\x0b< 6009 0: \x09\x0a\x0c\x0d 6010 6011/\s+/ 6012 > \x09\x0a\x0c\x0d\x0b< 6013 0: \x09\x0a\x0c\x0d 6014 6015/ab/x 6016 ab 6017No match 6018 6019/(?!\A)x/m 6020 a\nxb\n 6021 0: x 6022 6023/(?!^)x/m 6024 a\nxb\n 6025No match 6026 6027/abc\Qabc\Eabc/ 6028 abcabcabc 6029 0: abcabcabc 6030 6031/abc\Q(*+|\Eabc/ 6032 abc(*+|abc 6033 0: abc(*+|abc 6034 6035/ abc\Q abc\Eabc/x 6036 abc abcabc 6037 0: abc abcabc 6038 *** Failers 6039No match 6040 abcabcabc 6041No match 6042 6043/abc#comment 6044 \Q#not comment 6045 literal\E/x 6046 abc#not comment\n literal 6047 0: abc#not comment\x0a literal 6048 6049/abc#comment 6050 \Q#not comment 6051 literal/x 6052 abc#not comment\n literal 6053 0: abc#not comment\x0a literal 6054 6055/abc#comment 6056 \Q#not comment 6057 literal\E #more comment 6058 /x 6059 abc#not comment\n literal 6060 0: abc#not comment\x0a literal 6061 6062/abc#comment 6063 \Q#not comment 6064 literal\E #more comment/x 6065 abc#not comment\n literal 6066 0: abc#not comment\x0a literal 6067 6068/\Qabc\$xyz\E/ 6069 abc\\\$xyz 6070 0: abc\$xyz 6071 6072/\Qabc\E\$\Qxyz\E/ 6073 abc\$xyz 6074 0: abc$xyz 6075 6076/\Gabc/ 6077 abc 6078 0: abc 6079 *** Failers 6080No match 6081 xyzabc 6082No match 6083 6084/\Gabc./g 6085 abc1abc2xyzabc3 6086 0: abc1 6087 0: abc2 6088 6089/abc./g 6090 abc1abc2xyzabc3 6091 0: abc1 6092 0: abc2 6093 0: abc3 6094 6095/a(?x: b c )d/ 6096 XabcdY 6097 0: abcd 6098 *** Failers 6099No match 6100 Xa b c d Y 6101No match 6102 6103/((?x)x y z | a b c)/ 6104 XabcY 6105 0: abc 6106 1: abc 6107 AxyzB 6108 0: xyz 6109 1: xyz 6110 6111/(?i)AB(?-i)C/ 6112 XabCY 6113 0: abC 6114 *** Failers 6115No match 6116 XabcY 6117No match 6118 6119/((?i)AB(?-i)C|D)E/ 6120 abCE 6121 0: abCE 6122 1: abC 6123 DE 6124 0: DE 6125 1: D 6126 *** Failers 6127No match 6128 abcE 6129No match 6130 abCe 6131No match 6132 dE 6133No match 6134 De 6135No match 6136 6137/(.*)\d+\1/ 6138 abc123abc 6139 0: abc123abc 6140 1: abc 6141 abc123bc 6142 0: bc123bc 6143 1: bc 6144 6145/(.*)\d+\1/s 6146 abc123abc 6147 0: abc123abc 6148 1: abc 6149 abc123bc 6150 0: bc123bc 6151 1: bc 6152 6153/((.*))\d+\1/ 6154 abc123abc 6155 0: abc123abc 6156 1: abc 6157 2: abc 6158 abc123bc 6159 0: bc123bc 6160 1: bc 6161 2: bc 6162 6163/-- This tests for an IPv6 address in the form where it can have up to --/ 6164/-- eight components, one and only one of which is empty. This must be --/ 6165No match 6166/-- an internal component. --/ 6167No match 6168 6169/^(?!:) # colon disallowed at start 6170 (?: # start of item 6171 (?: [0-9a-f]{1,4} | # 1-4 hex digits or 6172 (?(1)0 | () ) ) # if null previously matched, fail; else null 6173 : # followed by colon 6174 ){1,7} # end item; 1-7 of them required 6175 [0-9a-f]{1,4} $ # final hex number at end of string 6176 (?(1)|.) # check that there was an empty component 6177 /xi 6178 a123::a123 6179 0: a123::a123 6180 1: 6181 a123:b342::abcd 6182 0: a123:b342::abcd 6183 1: 6184 a123:b342::324e:abcd 6185 0: a123:b342::324e:abcd 6186 1: 6187 a123:ddde:b342::324e:abcd 6188 0: a123:ddde:b342::324e:abcd 6189 1: 6190 a123:ddde:b342::324e:dcba:abcd 6191 0: a123:ddde:b342::324e:dcba:abcd 6192 1: 6193 a123:ddde:9999:b342::324e:dcba:abcd 6194 0: a123:ddde:9999:b342::324e:dcba:abcd 6195 1: 6196 *** Failers 6197No match 6198 1:2:3:4:5:6:7:8 6199No match 6200 a123:bce:ddde:9999:b342::324e:dcba:abcd 6201No match 6202 a123::9999:b342::324e:dcba:abcd 6203No match 6204 abcde:2:3:4:5:6:7:8 6205No match 6206 ::1 6207No match 6208 abcd:fee0:123:: 6209No match 6210 :1 6211No match 6212 1: 6213No match 6214 6215/[z\Qa-d]\E]/ 6216 z 6217 0: z 6218 a 6219 0: a 6220 - 6221 0: - 6222 d 6223 0: d 6224 ] 6225 0: ] 6226 *** Failers 6227 0: a 6228 b 6229No match 6230 6231/[\z\C]/ 6232 z 6233 0: z 6234 C 6235 0: C 6236 6237/\M/ 6238 M 6239 0: M 6240 6241/(a+)*b/ 6242 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 6243No match 6244 6245/(?i)reg(?:ul(?:[a�]|ae)r|ex)/ 6246 REGular 6247 0: REGular 6248 regulaer 6249 0: regulaer 6250 Regex 6251 0: Regex 6252 regul�r 6253 0: regul\xe4r 6254 6255/����[�-��-�]+/ 6256 ����� 6257 0: \xc5\xe6\xe5\xe4\xe0 6258 ����� 6259 0: \xc5\xe6\xe5\xe4\xff 6260 ����� 6261 0: \xc5\xe6\xe5\xe4\xc0 6262 ����� 6263 0: \xc5\xe6\xe5\xe4\xdf 6264 6265/(?<=Z)X./ 6266 \x84XAZXB 6267 0: XB 6268 6269/ab cd (?x) de fg/ 6270 ab cd defg 6271 0: ab cd defg 6272 6273/ab cd(?x) de fg/ 6274 ab cddefg 6275 0: ab cddefg 6276 ** Failers 6277No match 6278 abcddefg 6279No match 6280 6281/(?<![^f]oo)(bar)/ 6282 foobarX 6283 0: bar 6284 1: bar 6285 ** Failers 6286No match 6287 boobarX 6288No match 6289 6290/(?<![^f])X/ 6291 offX 6292 0: X 6293 ** Failers 6294No match 6295 onyX 6296No match 6297 6298/(?<=[^f])X/ 6299 onyX 6300 0: X 6301 ** Failers 6302No match 6303 offX 6304No match 6305 6306/^/mg 6307 a\nb\nc\n 6308 0: 6309 0: 6310 0: 6311 \ 6312 0: 6313 6314/(?<=C\n)^/mg 6315 A\nC\nC\n 6316 0: 6317 6318/(?:(?(1)a|b)(X))+/ 6319 bXaX 6320 0: bXaX 6321 1: X 6322 6323/(?:(?(1)\1a|b)(X|Y))+/ 6324 bXXaYYaY 6325 0: bXXaYYaY 6326 1: Y 6327 bXYaXXaX 6328 0: bX 6329 1: X 6330 6331/()()()()()()()()()(?:(?(10)\10a|b)(X|Y))+/ 6332 bXXaYYaY 6333 0: bX 6334 1: 6335 2: 6336 3: 6337 4: 6338 5: 6339 6: 6340 7: 6341 8: 6342 9: 634310: X 6344 6345/[[,abc,]+]/ 6346 abc] 6347 0: abc] 6348 a,b] 6349 0: a,b] 6350 [a,b,c] 6351 0: [a,b,c] 6352 6353/(?-x: )/x 6354 A\x20B 6355 0: 6356 6357"(?x)(?-x: \s*#\s*)" 6358 A # B 6359 0: # 6360 ** Failers 6361No match 6362 # 6363No match 6364 6365"(?x-is)(?:(?-ixs) \s*#\s*) include" 6366 A #include 6367 0: #include 6368 ** Failers 6369No match 6370 A#include 6371No match 6372 A #Include 6373No match 6374 6375/a*b*\w/ 6376 aaabbbb 6377 0: aaabbbb 6378 aaaa 6379 0: aaaa 6380 a 6381 0: a 6382 6383/a*b?\w/ 6384 aaabbbb 6385 0: aaabb 6386 aaaa 6387 0: aaaa 6388 a 6389 0: a 6390 6391/a*b{0,4}\w/ 6392 aaabbbb 6393 0: aaabbbb 6394 aaaa 6395 0: aaaa 6396 a 6397 0: a 6398 6399/a*b{0,}\w/ 6400 aaabbbb 6401 0: aaabbbb 6402 aaaa 6403 0: aaaa 6404 a 6405 0: a 6406 6407/a*\d*\w/ 6408 0a 6409 0: 0a 6410 a 6411 0: a 6412 6413/a*b *\w/x 6414 a 6415 0: a 6416 6417/a*b#comment 6418 *\w/x 6419 a 6420 0: a 6421 6422/a* b *\w/x 6423 a 6424 0: a 6425 6426/^\w+=.*(\\\n.*)*/ 6427 abc=xyz\\\npqr 6428 0: abc=xyz\ 6429 6430/(?=(\w+))\1:/ 6431 abcd: 6432 0: abcd: 6433 1: abcd 6434 6435/^(?=(\w+))\1:/ 6436 abcd: 6437 0: abcd: 6438 1: abcd 6439 6440/^\Eabc/ 6441 abc 6442 0: abc 6443 6444/^[\Eabc]/ 6445 a 6446 0: a 6447 ** Failers 6448No match 6449 E 6450No match 6451 6452/^[a-\Ec]/ 6453 b 6454 0: b 6455 ** Failers 6456No match 6457 - 6458No match 6459 E 6460No match 6461 6462/^[a\E\E-\Ec]/ 6463 b 6464 0: b 6465 ** Failers 6466No match 6467 - 6468No match 6469 E 6470No match 6471 6472/^[\E\Qa\E-\Qz\E]+/ 6473 b 6474 0: b 6475 ** Failers 6476No match 6477 - 6478No match 6479 6480/^[a\Q]bc\E]/ 6481 a 6482 0: a 6483 ] 6484 0: ] 6485 c 6486 0: c 6487 6488/^[a-\Q\E]/ 6489 a 6490 0: a 6491 - 6492 0: - 6493 6494/^(a()*)*/ 6495 aaaa 6496 0: aaaa 6497 1: a 6498 2: 6499 6500/^(?:a(?:(?:))*)*/ 6501 aaaa 6502 0: aaaa 6503 6504/^(a()+)+/ 6505 aaaa 6506 0: aaaa 6507 1: a 6508 2: 6509 6510/^(?:a(?:(?:))+)+/ 6511 aaaa 6512 0: aaaa 6513 6514/(a){0,3}(?(1)b|(c|))*D/ 6515 abbD 6516 0: abbD 6517 1: a 6518 ccccD 6519 0: ccccD 6520 1: <unset> 6521 2: 6522 D 6523 0: D 6524 1: <unset> 6525 2: 6526 6527/(a|)*\d/ 6528 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 6529No match 6530 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 6531 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 6532 1: 6533 6534/(?>a|)*\d/ 6535 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 6536No match 6537 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 6538 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 6539 6540/(?:a|)*\d/ 6541 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 6542No match 6543 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 6544 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 6545 6546/\Z/g 6547 abc\n 6548 0: 6549 0: 6550 6551/^(?s)(?>.*)(?<!\n)/ 6552 abc 6553 0: abc 6554 abc\n 6555No match 6556 6557/^(?![^\n]*\n\z)/ 6558 abc 6559 0: 6560 abc\n 6561No match 6562 6563/\z(?<!\n)/ 6564 abc 6565 0: 6566 abc\n 6567No match 6568 6569/(.*(.)?)*/ 6570 abcd 6571 0: abcd 6572 1: 6573 6574/( (A | (?(1)0|) )* )/x 6575 abcd 6576 0: 6577 1: 6578 2: 6579 6580/( ( (?(1)0|) )* )/x 6581 abcd 6582 0: 6583 1: 6584 2: 6585 6586/( (?(1)0|)* )/x 6587 abcd 6588 0: 6589 1: 6590 6591/[[:abcd:xyz]]/ 6592 a] 6593 0: a] 6594 :] 6595 0: :] 6596 6597/[abc[:x\]pqr]/ 6598 a 6599 0: a 6600 [ 6601 0: [ 6602 : 6603 0: : 6604 ] 6605 0: ] 6606 p 6607 0: p 6608 6609/.*[op][xyz]/ 6610 fooabcfoo 6611No match 6612 6613/(?(?=.*b)b|^)/ 6614 adc 6615 0: 6616 abc 6617 0: b 6618 6619/(?(?=^.*b)b|^)/ 6620 adc 6621 0: 6622 abc 6623No match 6624 6625/(?(?=.*b)b|^)*/ 6626 adc 6627 0: 6628 abc 6629 0: 6630 6631/(?(?=.*b)b|^)+/ 6632 adc 6633 0: 6634 abc 6635 0: b 6636 6637/(?(?=b).*b|^d)/ 6638 abc 6639 0: b 6640 6641/(?(?=.*b).*b|^d)/ 6642 abc 6643 0: ab 6644 6645/^%((?(?=[a])[^%])|b)*%$/ 6646 %ab% 6647 0: %ab% 6648 1: 6649 6650/(?i)a(?-i)b|c/ 6651 XabX 6652 0: ab 6653 XAbX 6654 0: Ab 6655 CcC 6656 0: c 6657 ** Failers 6658No match 6659 XABX 6660No match 6661 6662/[\x00-\xff\s]+/ 6663 \x0a\x0b\x0c\x0d 6664 0: \x0a\x0b\x0c\x0d 6665 6666/^\c/ 6667 ? 6668 0: ? 6669 6670/(abc)\1/i 6671 abc 6672No match 6673 6674/(abc)\1/ 6675 abc 6676No match 6677 6678/[^a]*/i 6679 12abc 6680 0: 12 6681 12ABC 6682 0: 12 6683 6684/[^a]*+/i 6685 12abc 6686 0: 12 6687 12ABC 6688 0: 12 6689 6690/[^a]*?X/i 6691 ** Failers 6692No match 6693 12abc 6694No match 6695 12ABC 6696No match 6697 6698/[^a]+?X/i 6699 ** Failers 6700No match 6701 12abc 6702No match 6703 12ABC 6704No match 6705 6706/[^a]?X/i 6707 12aXbcX 6708 0: X 6709 12AXBCX 6710 0: X 6711 BCX 6712 0: CX 6713 6714/[^a]??X/i 6715 12aXbcX 6716 0: X 6717 12AXBCX 6718 0: X 6719 BCX 6720 0: CX 6721 6722/[^a]?+X/i 6723 12aXbcX 6724 0: cX 6725 12AXBCX 6726 0: CX 6727 BCX 6728 0: CX 6729 6730/[^a]{2,3}/i 6731 abcdef 6732 0: bcd 6733 ABCDEF 6734 0: BCD 6735 6736/[^a]{2,3}?/i 6737 abcdef 6738 0: bc 6739 ABCDEF 6740 0: BC 6741 6742/[^a]{2,3}+/i 6743 abcdef 6744 0: bcd 6745 ABCDEF 6746 0: BCD 6747 6748/((a|)+)+Z/ 6749 Z 6750 0: Z 6751 1: 6752 2: 6753 6754/(a)b|(a)c/ 6755 ac 6756 0: ac 6757 1: <unset> 6758 2: a 6759 6760/(?>(a))b|(a)c/ 6761 ac 6762 0: ac 6763 1: <unset> 6764 2: a 6765 6766/(?=(a))ab|(a)c/ 6767 ac 6768 0: ac 6769 1: <unset> 6770 2: a 6771 6772/((?>(a))b|(a)c)/ 6773 ac 6774 0: ac 6775 1: ac 6776 2: <unset> 6777 3: a 6778 6779/((?>(a))b|(a)c)++/ 6780 ac 6781 0: ac 6782 1: ac 6783 2: <unset> 6784 3: a 6785 6786/(?:(?>(a))b|(a)c)++/ 6787 ac 6788 0: ac 6789 1: <unset> 6790 2: a 6791 6792/(?=(?>(a))b|(a)c)(..)/ 6793 ac 6794 0: ac 6795 1: <unset> 6796 2: a 6797 3: ac 6798 6799/(?>(?>(a))b|(a)c)/ 6800 ac 6801 0: ac 6802 1: <unset> 6803 2: a 6804 6805/(?:(?>([ab])))+a=/+ 6806 =ba= 6807 0: ba= 6808 0+ 6809 1: b 6810 6811/(?>([ab]))+a=/+ 6812 =ba= 6813 0: ba= 6814 0+ 6815 1: b 6816 6817/((?>(a+)b)+(aabab))/ 6818 aaaabaaabaabab 6819 0: aaaabaaabaabab 6820 1: aaaabaaabaabab 6821 2: aaa 6822 3: aabab 6823 6824/(?>a+|ab)+?c/ 6825 aabc 6826No match 6827 6828/(?>a+|ab)+c/ 6829 aabc 6830No match 6831 6832/(?:a+|ab)+c/ 6833 aabc 6834 0: aabc 6835 6836/(?(?=(a))a)/ 6837 a 6838 0: a 6839 1: a 6840 6841/(?(?=(a))a)(b)/ 6842 ab 6843 0: ab 6844 1: a 6845 2: b 6846 6847/^(?:a|ab)++c/ 6848 aaaabc 6849No match 6850 6851/^(?>a|ab)++c/ 6852 aaaabc 6853No match 6854 6855/^(?:a|ab)+c/ 6856 aaaabc 6857 0: aaaabc 6858 6859/(?=abc){3}abc/+ 6860 abcabcabc 6861 0: abc 6862 0+ abcabc 6863 ** Failers 6864No match 6865 xyz 6866No match 6867 6868/(?=abc)+abc/+ 6869 abcabcabc 6870 0: abc 6871 0+ abcabc 6872 ** Failers 6873No match 6874 xyz 6875No match 6876 6877/(?=abc)++abc/+ 6878 abcabcabc 6879 0: abc 6880 0+ abcabc 6881 ** Failers 6882No match 6883 xyz 6884No match 6885 6886/(?=abc){0}xyz/ 6887 xyz 6888 0: xyz 6889 6890/(?=abc){1}xyz/ 6891 ** Failers 6892No match 6893 xyz 6894No match 6895 6896/(?=(a))?./ 6897 ab 6898 0: a 6899 1: a 6900 bc 6901 0: b 6902 6903/(?=(a))??./ 6904 ab 6905 0: a 6906 bc 6907 0: b 6908 6909/^(?=(a)){0}b(?1)/ 6910 backgammon 6911 0: ba 6912 6913/^(?=(?1))?[az]([abc])d/ 6914 abd 6915 0: abd 6916 1: b 6917 zcdxx 6918 0: zcd 6919 1: c 6920 6921/^(?!a){0}\w+/ 6922 aaaaa 6923 0: aaaaa 6924 6925/(?<=(abc))?xyz/ 6926 abcxyz 6927 0: xyz 6928 1: abc 6929 pqrxyz 6930 0: xyz 6931 6932/^[\g<a>]+/ 6933 ggg<<<aaa>>> 6934 0: ggg<<<aaa>>> 6935 ** Failers 6936No match 6937 \\ga 6938No match 6939 6940/^[\ga]+/ 6941 gggagagaxyz 6942 0: gggagaga 6943 6944/^[:a[:digit:]]+/ 6945 aaaa444:::Z 6946 0: aaaa444::: 6947 6948/^[:a[:digit:]:b]+/ 6949 aaaa444:::bbbZ 6950 0: aaaa444:::bbb 6951 6952/[:a]xxx[b:]/ 6953 :xxx: 6954 0: :xxx: 6955 6956/(?<=a{2})b/i 6957 xaabc 6958 0: b 6959 ** Failers 6960No match 6961 xabc 6962No match 6963 6964/(?<!a{2})b/i 6965 xabc 6966 0: b 6967 ** Failers 6968No match 6969 xaabc 6970No match 6971 6972/(?<=a\h)c/ 6973 xa c 6974 0: c 6975 6976/(?<=[^a]{2})b/ 6977 axxbc 6978 0: b 6979 aAAbc 6980 0: b 6981 ** Failers 6982No match 6983 xaabc 6984No match 6985 6986/(?<=[^a]{2})b/i 6987 axxbc 6988 0: b 6989 ** Failers 6990No match 6991 aAAbc 6992No match 6993 xaabc 6994No match 6995 6996/(?<=a\H)c/ 6997 abc 6998 0: c 6999 7000/(?<=a\V)c/ 7001 abc 7002 0: c 7003 7004/(?<=a\v)c/ 7005 a\nc 7006 0: c 7007 7008/(?(?=c)c|d)++Y/ 7009 XcccddYX 7010 0: cccddY 7011 7012/(?(?=c)c|d)*+Y/ 7013 XcccddYX 7014 0: cccddY 7015 7016/^(a{2,3}){2,}+a/ 7017 aaaaaaa 7018 0: aaaaaaa 7019 1: aaa 7020 ** Failers 7021No match 7022 aaaaaa 7023No match 7024 aaaaaaaaa 7025No match 7026 7027/^(a{2,3})++a/ 7028 ** Failers 7029No match 7030 aaaaaa 7031No match 7032 7033/^(a{2,3})*+a/ 7034 ** Failers 7035No match 7036 aaaaaa 7037No match 7038 7039/ab\Cde/ 7040 abXde 7041 0: abXde 7042 7043/(?<=ab\Cde)X/ 7044 abZdeX 7045 0: X 7046 7047/a[\CD]b/ 7048 aCb 7049 0: aCb 7050 aDb 7051 0: aDb 7052 7053/a[\C-X]b/ 7054 aJb 7055 0: aJb 7056 7057/\H\h\V\v/ 7058 X X\x0a 7059 0: X X\x0a 7060 X\x09X\x0b 7061 0: X\x09X\x0b 7062 ** Failers 7063No match 7064 \xa0 X\x0a 7065No match 7066 7067/\H*\h+\V?\v{3,4}/ 7068 \x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a 7069 0: \x09 \xa0X\x0a\x0b\x0c\x0d 7070 \x09\x20\xa0\x0a\x0b\x0c\x0d\x0a 7071 0: \x09 \xa0\x0a\x0b\x0c\x0d 7072 \x09\x20\xa0\x0a\x0b\x0c 7073 0: \x09 \xa0\x0a\x0b\x0c 7074 ** Failers 7075No match 7076 \x09\x20\xa0\x0a\x0b 7077No match 7078 7079/\H{3,4}/ 7080 XY ABCDE 7081 0: ABCD 7082 XY PQR ST 7083 0: PQR 7084 7085/.\h{3,4}./ 7086 XY AB PQRS 7087 0: B P 7088 7089/\h*X\h?\H+Y\H?Z/ 7090 >XNNNYZ 7091 0: XNNNYZ 7092 > X NYQZ 7093 0: X NYQZ 7094 ** Failers 7095No match 7096 >XYZ 7097No match 7098 > X NY Z 7099No match 7100 7101/\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/ 7102 >XY\x0aZ\x0aA\x0bNN\x0c 7103 0: XY\x0aZ\x0aA\x0bNN\x0c 7104 >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c 7105 0: \x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c 7106 7107/(foo)\Kbar/ 7108 foobar 7109 0: bar 7110 1: foo 7111 7112/(foo)(\Kbar|baz)/ 7113 foobar 7114 0: bar 7115 1: foo 7116 2: bar 7117 foobaz 7118 0: foobaz 7119 1: foo 7120 2: baz 7121 7122/(foo\Kbar)baz/ 7123 foobarbaz 7124 0: barbaz 7125 1: foobar 7126 7127/abc\K|def\K/g+ 7128 Xabcdefghi 7129 0: 7130 0+ defghi 7131 0: 7132 0+ ghi 7133 7134/ab\Kc|de\Kf/g+ 7135 Xabcdefghi 7136 0: c 7137 0+ defghi 7138 0: f 7139 0+ ghi 7140 7141/(?=C)/g+ 7142 ABCDECBA 7143 0: 7144 0+ CDECBA 7145 0: 7146 0+ CBA 7147 7148/^abc\K/+ 7149 abcdef 7150 0: 7151 0+ def 7152 ** Failers 7153No match 7154 defabcxyz 7155No match 7156 7157/^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/ 7158 ababababbbabZXXXX 7159 0: ababababbbabZ 7160 1: ab 7161 2: b 7162 7163/(?<A>tom|bon)-\g{A}/ 7164 tom-tom 7165 0: tom-tom 7166 1: tom 7167 bon-bon 7168 0: bon-bon 7169 1: bon 7170 7171/(^(a|b\g{-1}))/ 7172 bacxxx 7173No match 7174 7175/(?|(abc)|(xyz))\1/ 7176 abcabc 7177 0: abcabc 7178 1: abc 7179 xyzxyz 7180 0: xyzxyz 7181 1: xyz 7182 ** Failers 7183No match 7184 abcxyz 7185No match 7186 xyzabc 7187No match 7188 7189/(?|(abc)|(xyz))(?1)/ 7190 abcabc 7191 0: abcabc 7192 1: abc 7193 xyzabc 7194 0: xyzabc 7195 1: xyz 7196 ** Failers 7197No match 7198 xyzxyz 7199No match 7200 7201/^X(?5)(a)(?|(b)|(q))(c)(d)(Y)/ 7202 XYabcdY 7203 0: XYabcdY 7204 1: a 7205 2: b 7206 3: c 7207 4: d 7208 5: Y 7209 7210/^X(?7)(a)(?|(b|(r)(s))|(q))(c)(d)(Y)/ 7211 XYabcdY 7212 0: XYabcdY 7213 1: a 7214 2: b 7215 3: <unset> 7216 4: <unset> 7217 5: c 7218 6: d 7219 7: Y 7220 7221/^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)/ 7222 XYabcdY 7223 0: XYabcdY 7224 1: a 7225 2: b 7226 3: <unset> 7227 4: <unset> 7228 5: c 7229 6: d 7230 7: Y 7231 7232/(?'abc'\w+):\k<abc>{2}/ 7233 a:aaxyz 7234 0: a:aa 7235 1: a 7236 ab:ababxyz 7237 0: ab:abab 7238 1: ab 7239 ** Failers 7240No match 7241 a:axyz 7242No match 7243 ab:abxyz 7244No match 7245 7246/(?'abc'\w+):\g{abc}{2}/ 7247 a:aaxyz 7248 0: a:aa 7249 1: a 7250 ab:ababxyz 7251 0: ab:abab 7252 1: ab 7253 ** Failers 7254No match 7255 a:axyz 7256No match 7257 ab:abxyz 7258No match 7259 7260/^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)/x 7261 abd 7262 0: abd 7263 1: a 7264 ce 7265 0: ce 7266 7267/^(a.)\g-1Z/ 7268 aXaXZ 7269 0: aXaXZ 7270 1: aX 7271 7272/^(a.)\g{-1}Z/ 7273 aXaXZ 7274 0: aXaXZ 7275 1: aX 7276 7277/^(?(DEFINE) (?<A> a) (?<B> b) ) (?&A) (?&B) /x 7278 abcd 7279 0: ab 7280 7281/(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT)) 7282 (?(DEFINE) 7283 (?<NAME_PAT>[a-z]+) 7284 (?<ADDRESS_PAT>\d+) 7285 )/x 7286 metcalfe 33 7287 0: metcalfe 33 7288 1: metcalfe 7289 2: 33 7290 7291/(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))\b(?&byte)(\.(?&byte)){3}/ 7292 1.2.3.4 7293 0: 1.2.3.4 7294 1: <unset> 7295 2: .4 7296 131.111.10.206 7297 0: 131.111.10.206 7298 1: <unset> 7299 2: .206 7300 10.0.0.0 7301 0: 10.0.0.0 7302 1: <unset> 7303 2: .0 7304 ** Failers 7305No match 7306 10.6 7307No match 7308 455.3.4.5 7309No match 7310 7311/\b(?&byte)(\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))/ 7312 1.2.3.4 7313 0: 1.2.3.4 7314 1: .4 7315 131.111.10.206 7316 0: 131.111.10.206 7317 1: .206 7318 10.0.0.0 7319 0: 10.0.0.0 7320 1: .0 7321 ** Failers 7322No match 7323 10.6 7324No match 7325 455.3.4.5 7326No match 7327 7328/^(\w++|\s++)*$/ 7329 now is the time for all good men to come to the aid of the party 7330 0: now is the time for all good men to come to the aid of the party 7331 1: party 7332 *** Failers 7333No match 7334 this is not a line with only words and spaces! 7335No match 7336 7337/(\d++)(\w)/ 7338 12345a 7339 0: 12345a 7340 1: 12345 7341 2: a 7342 *** Failers 7343No match 7344 12345+ 7345No match 7346 7347/a++b/ 7348 aaab 7349 0: aaab 7350 7351/(a++b)/ 7352 aaab 7353 0: aaab 7354 1: aaab 7355 7356/(a++)b/ 7357 aaab 7358 0: aaab 7359 1: aaa 7360 7361/([^()]++|\([^()]*\))+/ 7362 ((abc(ade)ufh()()x 7363 0: abc(ade)ufh()()x 7364 1: x 7365 7366/\(([^()]++|\([^()]+\))+\)/ 7367 (abc) 7368 0: (abc) 7369 1: abc 7370 (abc(def)xyz) 7371 0: (abc(def)xyz) 7372 1: xyz 7373 *** Failers 7374No match 7375 ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 7376No match 7377 7378/^([^()]|\((?1)*\))*$/ 7379 abc 7380 0: abc 7381 1: c 7382 a(b)c 7383 0: a(b)c 7384 1: c 7385 a(b(c))d 7386 0: a(b(c))d 7387 1: d 7388 *** Failers) 7389No match 7390 a(b(c)d 7391No match 7392 7393/^>abc>([^()]|\((?1)*\))*<xyz<$/ 7394 >abc>123<xyz< 7395 0: >abc>123<xyz< 7396 1: 3 7397 >abc>1(2)3<xyz< 7398 0: >abc>1(2)3<xyz< 7399 1: 3 7400 >abc>(1(2)3)<xyz< 7401 0: >abc>(1(2)3)<xyz< 7402 1: (1(2)3) 7403 7404/^(?:((.)(?1)\2|)|((.)(?3)\4|.))$/i 7405 1221 7406 0: 1221 7407 1: 1221 7408 2: 1 7409 Satanoscillatemymetallicsonatas 7410 0: Satanoscillatemymetallicsonatas 7411 1: <unset> 7412 2: <unset> 7413 3: Satanoscillatemymetallicsonatas 7414 4: S 7415 AmanaplanacanalPanama 7416 0: AmanaplanacanalPanama 7417 1: <unset> 7418 2: <unset> 7419 3: AmanaplanacanalPanama 7420 4: A 7421 AblewasIereIsawElba 7422 0: AblewasIereIsawElba 7423 1: <unset> 7424 2: <unset> 7425 3: AblewasIereIsawElba 7426 4: A 7427 *** Failers 7428No match 7429 Thequickbrownfox 7430No match 7431 7432/^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/ 7433 12 7434 0: 12 7435 1: 12 7436 (((2+2)*-3)-7) 7437 0: (((2+2)*-3)-7) 7438 1: (((2+2)*-3)-7) 7439 2: - 7440 -12 7441 0: -12 7442 1: -12 7443 *** Failers 7444No match 7445 ((2+2)*-3)-7) 7446No match 7447 7448/^(x(y|(?1){2})z)/ 7449 xyz 7450 0: xyz 7451 1: xyz 7452 2: y 7453 xxyzxyzz 7454 0: xxyzxyzz 7455 1: xxyzxyzz 7456 2: xyzxyz 7457 *** Failers 7458No match 7459 xxyzz 7460No match 7461 xxyzxyzxyzz 7462No match 7463 7464/((< (?: (?(R) \d++ | [^<>]*+) | (?2)) * >))/x 7465 <> 7466 0: <> 7467 1: <> 7468 2: <> 7469 <abcd> 7470 0: <abcd> 7471 1: <abcd> 7472 2: <abcd> 7473 <abc <123> hij> 7474 0: <abc <123> hij> 7475 1: <abc <123> hij> 7476 2: <abc <123> hij> 7477 <abc <def> hij> 7478 0: <def> 7479 1: <def> 7480 2: <def> 7481 <abc<>def> 7482 0: <abc<>def> 7483 1: <abc<>def> 7484 2: <abc<>def> 7485 <abc<> 7486 0: <> 7487 1: <> 7488 2: <> 7489 *** Failers 7490No match 7491 <abc 7492No match 7493 7494/^a+(*FAIL)/ 7495 aaaaaa 7496No match 7497 7498/a+b?c+(*FAIL)/ 7499 aaabccc 7500No match 7501 7502/a+b?(*PRUNE)c+(*FAIL)/ 7503 aaabccc 7504No match 7505 7506/a+b?(*COMMIT)c+(*FAIL)/ 7507 aaabccc 7508No match 7509 7510/a+b?(*SKIP)c+(*FAIL)/ 7511 aaabcccaaabccc 7512No match 7513 7514/^(?:aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/ 7515 aaaxxxxxx 7516 0: aaaxxxxxx 7517 aaa++++++ 7518 0: aaa 7519 bbbxxxxx 7520 0: bbbxxxxx 7521 bbb+++++ 7522 0: bbb 7523 cccxxxx 7524 0: cccxxxx 7525 ccc++++ 7526 0: ccc 7527 dddddddd 7528 0: ddd 7529 7530/^(aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/ 7531 aaaxxxxxx 7532 0: aaaxxxxxx 7533 1: aaaxxxxxx 7534 aaa++++++ 7535 0: aaa 7536 1: aaa 7537 bbbxxxxx 7538 0: bbbxxxxx 7539 1: bbbxxxxx 7540 bbb+++++ 7541 0: bbb 7542 1: bbb 7543 cccxxxx 7544 0: cccxxxx 7545 1: cccxxxx 7546 ccc++++ 7547 0: ccc 7548 1: ccc 7549 dddddddd 7550 0: ddd 7551 1: ddd 7552 7553/a+b?(*THEN)c+(*FAIL)/ 7554 aaabccc 7555No match 7556 7557/(A (A|B(*ACCEPT)|C) D)(E)/x 7558 AB 7559 0: AB 7560 1: AB 7561 2: B 7562 ABX 7563 0: AB 7564 1: AB 7565 2: B 7566 AADE 7567 0: AADE 7568 1: AAD 7569 2: A 7570 3: E 7571 ACDE 7572 0: ACDE 7573 1: ACD 7574 2: C 7575 3: E 7576 ** Failers 7577No match 7578 AD 7579No match 7580 7581/^\W*+(?:((.)\W*+(?1)\W*+\2|)|((.)\W*+(?3)\W*+\4|\W*+.\W*+))\W*+$/i 7582 1221 7583 0: 1221 7584 1: 1221 7585 2: 1 7586 Satan, oscillate my metallic sonatas! 7587 0: Satan, oscillate my metallic sonatas! 7588 1: <unset> 7589 2: <unset> 7590 3: Satan, oscillate my metallic sonatas 7591 4: S 7592 A man, a plan, a canal: Panama! 7593 0: A man, a plan, a canal: Panama! 7594 1: <unset> 7595 2: <unset> 7596 3: A man, a plan, a canal: Panama 7597 4: A 7598 Able was I ere I saw Elba. 7599 0: Able was I ere I saw Elba. 7600 1: <unset> 7601 2: <unset> 7602 3: Able was I ere I saw Elba 7603 4: A 7604 *** Failers 7605No match 7606 The quick brown fox 7607No match 7608 7609/^((.)(?1)\2|.)$/ 7610 a 7611 0: a 7612 1: a 7613 aba 7614 0: aba 7615 1: aba 7616 2: a 7617 aabaa 7618 0: aabaa 7619 1: aabaa 7620 2: a 7621 abcdcba 7622 0: abcdcba 7623 1: abcdcba 7624 2: a 7625 pqaabaaqp 7626 0: pqaabaaqp 7627 1: pqaabaaqp 7628 2: p 7629 ablewasiereisawelba 7630 0: ablewasiereisawelba 7631 1: ablewasiereisawelba 7632 2: a 7633 rhubarb 7634No match 7635 the quick brown fox 7636No match 7637 7638/(a)(?<=b(?1))/ 7639 baz 7640 0: a 7641 1: a 7642 ** Failers 7643No match 7644 caz 7645No match 7646 7647/(?<=b(?1))(a)/ 7648 zbaaz 7649 0: a 7650 1: a 7651 ** Failers 7652No match 7653 aaa 7654No match 7655 7656/(?<X>a)(?<=b(?&X))/ 7657 baz 7658 0: a 7659 1: a 7660 7661/^(?|(abc)|(def))\1/ 7662 abcabc 7663 0: abcabc 7664 1: abc 7665 defdef 7666 0: defdef 7667 1: def 7668 ** Failers 7669No match 7670 abcdef 7671No match 7672 defabc 7673No match 7674 7675/^(?|(abc)|(def))(?1)/ 7676 abcabc 7677 0: abcabc 7678 1: abc 7679 defabc 7680 0: defabc 7681 1: def 7682 ** Failers 7683No match 7684 defdef 7685No match 7686 abcdef 7687No match 7688 7689/(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |b(?<quote> (?<apostrophe>')|(?<realquote>")) ) (?('quote')[a-z]+|[0-9]+)/xJ 7690 a\"aaaaa 7691 0: a"aaaaa 7692 1: " 7693 2: <unset> 7694 3: " 7695 b\"aaaaa 7696 0: b"aaaaa 7697 1: <unset> 7698 2: <unset> 7699 3: <unset> 7700 4: " 7701 5: <unset> 7702 6: " 7703 ** Failers 7704No match 7705 b\"11111 7706No match 7707 7708/(?:(?1)|B)(A(*F)|C)/ 7709 ABCD 7710 0: BC 7711 1: C 7712 CCD 7713 0: CC 7714 1: C 7715 ** Failers 7716No match 7717 CAD 7718No match 7719 7720/^(?:(?1)|B)(A(*F)|C)/ 7721 CCD 7722 0: CC 7723 1: C 7724 BCD 7725 0: BC 7726 1: C 7727 ** Failers 7728No match 7729 ABCD 7730No match 7731 CAD 7732No match 7733 BAD 7734No match 7735 7736/(?:(?1)|B)(A(*ACCEPT)XX|C)D/ 7737 AAD 7738 0: AA 7739 1: A 7740 ACD 7741 0: ACD 7742 1: C 7743 BAD 7744 0: BA 7745 1: A 7746 BCD 7747 0: BCD 7748 1: C 7749 BAX 7750 0: BA 7751 1: A 7752 ** Failers 7753No match 7754 ACX 7755No match 7756 ABC 7757No match 7758 7759/(?(DEFINE)(A))B(?1)C/ 7760 BAC 7761 0: BAC 7762 7763/(?(DEFINE)((A)\2))B(?1)C/ 7764 BAAC 7765 0: BAAC 7766 7767/(?<pn> \( ( [^()]++ | (?&pn) )* \) )/x 7768 (ab(cd)ef) 7769 0: (ab(cd)ef) 7770 1: (ab(cd)ef) 7771 2: ef 7772 7773/^(?!a(*SKIP)b)/ 7774 ac 7775 0: 7776 7777/^(?=a(*SKIP)b|ac)/ 7778 ** Failers 7779No match 7780 ac 7781No match 7782 7783/^(?=a(*THEN)b|ac)/ 7784 ac 7785 0: 7786 7787/^(?=a(*PRUNE)b)/ 7788 ab 7789 0: 7790 ** Failers 7791No match 7792 ac 7793No match 7794 7795/^(?=a(*ACCEPT)b)/ 7796 ac 7797 0: 7798 7799/^(?(?!a(*SKIP)b))/ 7800 ac 7801 0: 7802 7803/(?>a\Kb)/ 7804 ab 7805 0: b 7806 7807/((?>a\Kb))/ 7808 ab 7809 0: b 7810 1: ab 7811 7812/(a\Kb)/ 7813 ab 7814 0: b 7815 1: ab 7816 7817/^a\Kcz|ac/ 7818 ac 7819 0: ac 7820 7821/(?>a\Kbz|ab)/ 7822 ab 7823 0: ab 7824 7825/^(?&t)(?(DEFINE)(?<t>a\Kb))$/ 7826 ab 7827 0: b 7828 7829/^([^()]|\((?1)*\))*$/ 7830 a(b)c 7831 0: a(b)c 7832 1: c 7833 a(b(c)d)e 7834 0: a(b(c)d)e 7835 1: e 7836 7837/(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))/ 7838 0 7839 0: 0 7840 1: 0 7841 00 7842 0: 00 7843 1: 00 7844 2: 0 7845 0000 7846 0: 0000 7847 1: 0000 7848 2: 0 7849 7850/(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))/ 7851 0 7852 0: 0 7853 1: 0 7854 2: 0 7855 00 7856 0: 0 7857 1: 0 7858 2: 0 7859 0000 7860 0: 0 7861 1: 0 7862 2: 0 7863 7864/--- This one does fail, as expected, in Perl. It needs the complex item at the 7865 end of the pattern. A single letter instead of (B|D) makes it not fail, 7866 which I think is a Perl bug. --- / 7867 7868/A(*COMMIT)(B|D)/ 7869 ACABX 7870No match 7871 7872/--- Check the use of names for failure ---/ 7873 7874/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K 7875 ** Failers 7876No match 7877 AC 7878No match, mark = A 7879 CB 7880No match, mark = B 7881 7882/--- Force no study, otherwise mark is not seen. The studied version is in 7883 test 2 because it isn't Perl-compatible. ---/ 7884 7885/(*MARK:A)(*SKIP:B)(C|X)/KSS 7886 C 7887 0: C 7888 1: C 7889MK: A 7890 D 7891No match, mark = A 7892 7893/^(A(*THEN:A)B|C(*THEN:B)D)/K 7894 ** Failers 7895No match 7896 CB 7897No match, mark = B 7898 7899/^(?:A(*THEN:A)B|C(*THEN:B)D)/K 7900 CB 7901No match, mark = B 7902 7903/^(?>A(*THEN:A)B|C(*THEN:B)D)/K 7904 CB 7905No match, mark = B 7906 7907/--- This should succeed, as the skip causes bump to offset 1 (the mark). Note 7908that we have to have something complicated such as (B|Z) at the end because, 7909for Perl, a simple character somehow causes an unwanted optimization to mess 7910with the handling of backtracking verbs. ---/ 7911 7912/A(*MARK:A)A+(*SKIP:A)(B|Z) | AC/xK 7913 AAAC 7914 0: AC 7915 7916/--- Test skipping over a non-matching mark. ---/ 7917 7918/A(*MARK:A)A+(*MARK:B)(*SKIP:A)(B|Z) | AC/xK 7919 AAAC 7920 0: AC 7921 7922/--- Check shorthand for MARK ---/ 7923 7924/A(*:A)A+(*SKIP:A)(B|Z) | AC/xK 7925 AAAC 7926 0: AC 7927 7928/--- Don't loop! Force no study, otherwise mark is not seen. ---/ 7929 7930/(*:A)A+(*SKIP:A)(B|Z)/KSS 7931 AAAC 7932No match, mark = A 7933 7934/--- This should succeed, as a non-existent skip name disables the skip ---/ 7935 7936/A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/xK 7937 AAAC 7938 0: AC 7939 7940/A(*MARK:A)A+(*SKIP:B)(B|Z) | AC(*:B)/xK 7941 AAAC 7942 0: AC 7943MK: B 7944 7945/--- COMMIT at the start of a pattern should act like an anchor. Again, 7946however, we need the complication for Perl. ---/ 7947 7948/(*COMMIT)(A|P)(B|P)(C|P)/ 7949 ABCDEFG 7950 0: ABC 7951 1: A 7952 2: B 7953 3: C 7954 ** Failers 7955No match 7956 DEFGABC 7957No match 7958 7959/--- COMMIT inside an atomic group can't stop backtracking over the group. ---/ 7960 7961/(\w+)(?>b(*COMMIT))\w{2}/ 7962 abbb 7963 0: abbb 7964 1: a 7965 7966/(\w+)b(*COMMIT)\w{2}/ 7967 abbb 7968No match 7969 7970/--- Check opening parens in comment when seeking forward reference. ---/ 7971 7972/(?&t)(?#()(?(DEFINE)(?<t>a))/ 7973 bac 7974 0: a 7975 7976/--- COMMIT should override THEN ---/ 7977 7978/(?>(*COMMIT)(?>yes|no)(*THEN)(*F))?/ 7979 yes 7980No match 7981 7982/(?>(*COMMIT)(yes|no)(*THEN)(*F))?/ 7983 yes 7984No match 7985 7986/b?(*SKIP)c/ 7987 bc 7988 0: bc 7989 abc 7990 0: bc 7991 7992/(*SKIP)bc/ 7993 a 7994No match 7995 7996/(*SKIP)b/ 7997 a 7998No match 7999 8000/(?P<abn>(?P=abn)xxx|)+/ 8001 xxx 8002 0: 8003 1: 8004 8005/(?i:([^b]))(?1)/ 8006 aa 8007 0: aa 8008 1: a 8009 aA 8010 0: aA 8011 1: a 8012 ** Failers 8013 0: ** 8014 1: * 8015 ab 8016No match 8017 aB 8018No match 8019 Ba 8020No match 8021 ba 8022No match 8023 8024/^(?&t)*+(?(DEFINE)(?<t>a))\w$/ 8025 aaaaaaX 8026 0: aaaaaaX 8027 ** Failers 8028No match 8029 aaaaaa 8030No match 8031 8032/^(?&t)*(?(DEFINE)(?<t>a))\w$/ 8033 aaaaaaX 8034 0: aaaaaaX 8035 aaaaaa 8036 0: aaaaaa 8037 8038/^(a)*+(\w)/ 8039 aaaaX 8040 0: aaaaX 8041 1: a 8042 2: X 8043 YZ 8044 0: Y 8045 1: <unset> 8046 2: Y 8047 ** Failers 8048No match 8049 aaaa 8050No match 8051 8052/^(?:a)*+(\w)/ 8053 aaaaX 8054 0: aaaaX 8055 1: X 8056 YZ 8057 0: Y 8058 1: Y 8059 ** Failers 8060No match 8061 aaaa 8062No match 8063 8064/^(a)++(\w)/ 8065 aaaaX 8066 0: aaaaX 8067 1: a 8068 2: X 8069 ** Failers 8070No match 8071 aaaa 8072No match 8073 YZ 8074No match 8075 8076/^(?:a)++(\w)/ 8077 aaaaX 8078 0: aaaaX 8079 1: X 8080 ** Failers 8081No match 8082 aaaa 8083No match 8084 YZ 8085No match 8086 8087/^(a)?+(\w)/ 8088 aaaaX 8089 0: aa 8090 1: a 8091 2: a 8092 YZ 8093 0: Y 8094 1: <unset> 8095 2: Y 8096 8097/^(?:a)?+(\w)/ 8098 aaaaX 8099 0: aa 8100 1: a 8101 YZ 8102 0: Y 8103 1: Y 8104 8105/^(a){2,}+(\w)/ 8106 aaaaX 8107 0: aaaaX 8108 1: a 8109 2: X 8110 ** Failers 8111No match 8112 aaa 8113No match 8114 YZ 8115No match 8116 8117/^(?:a){2,}+(\w)/ 8118 aaaaX 8119 0: aaaaX 8120 1: X 8121 ** Failers 8122No match 8123 aaa 8124No match 8125 YZ 8126No match 8127 8128/(a|)*(?1)b/ 8129 b 8130 0: b 8131 1: 8132 ab 8133 0: ab 8134 1: 8135 aab 8136 0: aab 8137 1: 8138 8139/(a)++(?1)b/ 8140 ** Failers 8141No match 8142 ab 8143No match 8144 aab 8145No match 8146 8147/(a)*+(?1)b/ 8148 ** Failers 8149No match 8150 ab 8151No match 8152 aab 8153No match 8154 8155/(?1)(?:(b)){0}/ 8156 b 8157 0: b 8158 8159/(foo ( \( ((?:(?> [^()]+ )|(?2))*) \) ) )/x 8160 foo(bar(baz)+baz(bop)) 8161 0: foo(bar(baz)+baz(bop)) 8162 1: foo(bar(baz)+baz(bop)) 8163 2: (bar(baz)+baz(bop)) 8164 3: bar(baz)+baz(bop) 8165 8166/(A (A|B(*ACCEPT)|C) D)(E)/x 8167 AB 8168 0: AB 8169 1: AB 8170 2: B 8171 8172/\A.*?(?:a|b(*THEN)c)/ 8173 ba 8174 0: ba 8175 8176/\A.*?(?:a|bc)/ 8177 ba 8178 0: ba 8179 8180/\A.*?(a|b(*THEN)c)/ 8181 ba 8182 0: ba 8183 1: a 8184 8185/\A.*?(a|bc)/ 8186 ba 8187 0: ba 8188 1: a 8189 8190/\A.*?(?:a|b(*THEN)c)++/ 8191 ba 8192 0: ba 8193 8194/\A.*?(?:a|bc)++/ 8195 ba 8196 0: ba 8197 8198/\A.*?(a|b(*THEN)c)++/ 8199 ba 8200 0: ba 8201 1: a 8202 8203/\A.*?(a|bc)++/ 8204 ba 8205 0: ba 8206 1: a 8207 8208/\A.*?(?:a|b(*THEN)c|d)/ 8209 ba 8210 0: ba 8211 8212/\A.*?(?:a|bc|d)/ 8213 ba 8214 0: ba 8215 8216/(?:(b))++/ 8217 beetle 8218 0: b 8219 1: b 8220 8221/(?(?=(a(*ACCEPT)z))a)/ 8222 a 8223 0: a 8224 1: a 8225 8226/^(a)(?1)+ab/ 8227 aaaab 8228 0: aaaab 8229 1: a 8230 8231/^(a)(?1)++ab/ 8232 aaaab 8233No match 8234 8235/^(?=a(*:M))aZ/K 8236 aZbc 8237 0: aZ 8238MK: M 8239 8240/^(?!(*:M)b)aZ/K 8241 aZbc 8242 0: aZ 8243 8244/(?(DEFINE)(a))?b(?1)/ 8245 backgammon 8246 0: ba 8247 8248/^\N+/ 8249 abc\ndef 8250 0: abc 8251 8252/^\N{1,}/ 8253 abc\ndef 8254 0: abc 8255 8256/(?(R)a+|(?R)b)/ 8257 aaaabcde 8258 0: aaaab 8259 8260/(?(R)a+|((?R))b)/ 8261 aaaabcde 8262 0: aaaab 8263 1: aaaa 8264 8265/((?(R)a+|(?1)b))/ 8266 aaaabcde 8267 0: aaaab 8268 1: aaaab 8269 8270/((?(R1)a+|(?1)b))/ 8271 aaaabcde 8272 0: aaaab 8273 1: aaaab 8274 8275/a(*:any 8276name)/K 8277 abc 8278 0: a 8279MK: any \x0aname 8280 8281/(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))/ 8282 a 8283 0: a 8284 ba 8285 0: a 8286 bba 8287 0: a 8288 8289/--- Checking revised (*THEN) handling ---/ 8290 8291/--- Capture ---/ 8292 8293/^.*? (a(*THEN)b) c/x 8294 aabc 8295No match 8296 8297/^.*? (a(*THEN)b|(*F)) c/x 8298 aabc 8299 0: aabc 8300 1: ab 8301 8302/^.*? ( (a(*THEN)b) | (*F) ) c/x 8303 aabc 8304 0: aabc 8305 1: ab 8306 2: ab 8307 8308/^.*? ( (a(*THEN)b) ) c/x 8309 aabc 8310No match 8311 8312/--- Non-capture ---/ 8313 8314/^.*? (?:a(*THEN)b) c/x 8315 aabc 8316No match 8317 8318/^.*? (?:a(*THEN)b|(*F)) c/x 8319 aabc 8320 0: aabc 8321 8322/^.*? (?: (?:a(*THEN)b) | (*F) ) c/x 8323 aabc 8324 0: aabc 8325 8326/^.*? (?: (?:a(*THEN)b) ) c/x 8327 aabc 8328No match 8329 8330/--- Atomic ---/ 8331 8332/^.*? (?>a(*THEN)b) c/x 8333 aabc 8334No match 8335 8336/^.*? (?>a(*THEN)b|(*F)) c/x 8337 aabc 8338 0: aabc 8339 8340/^.*? (?> (?>a(*THEN)b) | (*F) ) c/x 8341 aabc 8342 0: aabc 8343 8344/^.*? (?> (?>a(*THEN)b) ) c/x 8345 aabc 8346No match 8347 8348/--- Possessive capture ---/ 8349 8350/^.*? (a(*THEN)b)++ c/x 8351 aabc 8352No match 8353 8354/^.*? (a(*THEN)b|(*F))++ c/x 8355 aabc 8356 0: aabc 8357 1: ab 8358 8359/^.*? ( (a(*THEN)b)++ | (*F) )++ c/x 8360 aabc 8361 0: aabc 8362 1: ab 8363 2: ab 8364 8365/^.*? ( (a(*THEN)b)++ )++ c/x 8366 aabc 8367No match 8368 8369/--- Possessive non-capture ---/ 8370 8371/^.*? (?:a(*THEN)b)++ c/x 8372 aabc 8373No match 8374 8375/^.*? (?:a(*THEN)b|(*F))++ c/x 8376 aabc 8377 0: aabc 8378 8379/^.*? (?: (?:a(*THEN)b)++ | (*F) )++ c/x 8380 aabc 8381 0: aabc 8382 8383/^.*? (?: (?:a(*THEN)b)++ )++ c/x 8384 aabc 8385No match 8386 8387/--- Condition assertion ---/ 8388 8389/^(?(?=a(*THEN)b)ab|ac)/ 8390 ac 8391 0: ac 8392 8393/--- Condition ---/ 8394 8395/^.*?(?(?=a)a|b(*THEN)c)/ 8396 ba 8397No match 8398 8399/^.*?(?:(?(?=a)a|b(*THEN)c)|d)/ 8400 ba 8401 0: ba 8402 8403/^.*?(?(?=a)a(*THEN)b|c)/ 8404 ac 8405No match 8406 8407/--- Assertion ---/ 8408 8409/^.*(?=a(*THEN)b)/ 8410 aabc 8411 0: a 8412 8413/------------------------------/ 8414 8415/(?>a(*:m))/imsxSK 8416 a 8417 0: a 8418MK: m 8419 8420/(?>(a)(*:m))/imsxSK 8421 a 8422 0: a 8423 1: a 8424MK: m 8425 8426/(?<=a(*ACCEPT)b)c/ 8427 xacd 8428 0: c 8429 8430/(?<=(a(*ACCEPT)b))c/ 8431 xacd 8432 0: c 8433 1: a 8434 8435/(?<=(a(*COMMIT)b))c/ 8436 xabcd 8437 0: c 8438 1: ab 8439 ** Failers 8440No match 8441 xacd 8442No match 8443 8444/(?<!a(*FAIL)b)c/ 8445 xcd 8446 0: c 8447 acd 8448 0: c 8449 8450/(?<=a(*:N)b)c/K 8451 xabcd 8452 0: c 8453MK: N 8454 8455/(?<=a(*PRUNE)b)c/ 8456 xabcd 8457 0: c 8458 8459/(?<=a(*SKIP)b)c/ 8460 xabcd 8461 0: c 8462 8463/(?<=a(*THEN)b)c/ 8464 xabcd 8465 0: c 8466 8467/(a)(?2){2}(.)/ 8468 abcd 8469 0: abcd 8470 1: a 8471 2: d 8472 8473/(*MARK:A)(*PRUNE:B)(C|X)/KS 8474 C 8475 0: C 8476 1: C 8477MK: B 8478 D 8479No match, mark = B 8480 8481/(*MARK:A)(*PRUNE:B)(C|X)/KSS 8482 C 8483 0: C 8484 1: C 8485MK: B 8486 D 8487No match, mark = B 8488 8489/(*MARK:A)(*THEN:B)(C|X)/KS 8490 C 8491 0: C 8492 1: C 8493MK: B 8494 D 8495No match, mark = B 8496 8497/(*MARK:A)(*THEN:B)(C|X)/KSY 8498 C 8499 0: C 8500 1: C 8501MK: B 8502 D 8503No match, mark = B 8504 8505/(*MARK:A)(*THEN:B)(C|X)/KSS 8506 C 8507 0: C 8508 1: C 8509MK: B 8510 D 8511No match, mark = B 8512 8513/--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/ 8514 8515/A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK 8516 AAAC 8517No match, mark = A 8518 8519/--- Same --/ 8520 8521/A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK 8522 AAAC 8523No match, mark = B 8524 8525/A(*:A)A+(*SKIP)(B|Z) | AC/xK 8526 AAAC 8527No match, mark = A 8528 8529/--- This should fail, as a null name is the same as no name ---/ 8530 8531/A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK 8532 AAAC 8533No match, mark = A 8534 8535/--- A check on what happens after hitting a mark and them bumping along to 8536something that does not even start. Perl reports tags after the failures here, 8537though it does not when the individual letters are made into something 8538more complicated. ---/ 8539 8540/A(*:A)B|XX(*:B)Y/K 8541 AABC 8542 0: AB 8543MK: A 8544 XXYZ 8545 0: XXY 8546MK: B 8547 ** Failers 8548No match 8549 XAQQ 8550No match, mark = A 8551 XAQQXZZ 8552No match, mark = A 8553 AXQQQ 8554No match, mark = A 8555 AXXQQQ 8556No match, mark = B 8557 8558/^(A(*THEN:A)B|C(*THEN:B)D)/K 8559 AB 8560 0: AB 8561 1: AB 8562MK: A 8563 CD 8564 0: CD 8565 1: CD 8566MK: B 8567 ** Failers 8568No match 8569 AC 8570No match, mark = A 8571 CB 8572No match, mark = B 8573 8574/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K 8575 AB 8576 0: AB 8577 1: AB 8578MK: A 8579 CD 8580 0: CD 8581 1: CD 8582MK: B 8583 ** Failers 8584No match 8585 AC 8586No match, mark = A 8587 CB 8588No match, mark = B 8589 8590/--- An empty name does not pass back an empty string. It is the same as if no 8591name were given. ---/ 8592 8593/^(A(*PRUNE:)B|C(*PRUNE:B)D)/K 8594 AB 8595 0: AB 8596 1: AB 8597 CD 8598 0: CD 8599 1: CD 8600MK: B 8601 8602/--- PRUNE goes to next bumpalong; COMMIT does not. ---/ 8603 8604/A(*PRUNE:A)B/K 8605 ACAB 8606 0: AB 8607MK: A 8608 8609/--- Mark names can be duplicated ---/ 8610 8611/A(*:A)B|X(*:A)Y/K 8612 AABC 8613 0: AB 8614MK: A 8615 XXYZ 8616 0: XY 8617MK: A 8618 8619/b(*:m)f|a(*:n)w/K 8620 aw 8621 0: aw 8622MK: n 8623 ** Failers 8624No match, mark = n 8625 abc 8626No match, mark = m 8627 8628/b(*:m)f|aw/K 8629 abaw 8630 0: aw 8631 ** Failers 8632No match 8633 abc 8634No match, mark = m 8635 abax 8636No match, mark = m 8637 8638/A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK 8639 AAAC 8640 0: AAC 8641 8642/a(*PRUNE:X)bc|qq/KY 8643 ** Failers 8644No match, mark = X 8645 axy 8646No match, mark = X 8647 8648/a(*THEN:X)bc|qq/KY 8649 ** Failers 8650No match, mark = X 8651 axy 8652No match, mark = X 8653 8654/(?=a(*MARK:A)b)..x/K 8655 abxy 8656 0: abx 8657MK: A 8658 ** Failers 8659No match 8660 abpq 8661No match 8662 8663/(?=a(*MARK:A)b)..(*:Y)x/K 8664 abxy 8665 0: abx 8666MK: Y 8667 ** Failers 8668No match 8669 abpq 8670No match 8671 8672/(?=a(*PRUNE:A)b)..x/K 8673 abxy 8674 0: abx 8675MK: A 8676 ** Failers 8677No match 8678 abpq 8679No match 8680 8681/(?=a(*PRUNE:A)b)..(*:Y)x/K 8682 abxy 8683 0: abx 8684MK: Y 8685 ** Failers 8686No match 8687 abpq 8688No match 8689 8690/(?=a(*THEN:A)b)..x/K 8691 abxy 8692 0: abx 8693MK: A 8694 ** Failers 8695No match 8696 abpq 8697No match 8698 8699/(?=a(*THEN:A)b)..(*:Y)x/K 8700 abxy 8701 0: abx 8702MK: Y 8703 ** Failers 8704No match 8705 abpq 8706No match 8707 8708/(another)?(\1?)test/ 8709 hello world test 8710 0: test 8711 1: <unset> 8712 2: 8713 8714/(another)?(\1+)test/ 8715 hello world test 8716No match 8717 8718/(a(*COMMIT)b){0}a(?1)|aac/ 8719 aac 8720 0: aac 8721 8722/(?!a(*COMMIT)b)ac|cd/ 8723 ac 8724 0: ac 8725 8726/((?:a?)*)*c/ 8727 aac 8728 0: aac 8729 1: 8730 8731/((?>a?)*)*c/ 8732 aac 8733 0: aac 8734 1: 8735 8736/(?>.*?a)(?<=ba)/ 8737 aba 8738 0: ba 8739 8740/(?:.*?a)(?<=ba)/ 8741 aba 8742 0: aba 8743 8744/.*?a(*PRUNE)b/ 8745 aab 8746 0: ab 8747 8748/.*?a(*PRUNE)b/s 8749 aab 8750 0: ab 8751 8752/^a(*PRUNE)b/s 8753 aab 8754No match 8755 8756/.*?a(*SKIP)b/ 8757 aab 8758 0: ab 8759 8760/(?>.*?a)b/s 8761 aab 8762 0: ab 8763 8764/(?>.*?a)b/ 8765 aab 8766 0: ab 8767 8768/(?>^a)b/s 8769 aab 8770No match 8771 8772/(?>.*?)(?<=(abcd)|(wxyz))/ 8773 alphabetabcd 8774 0: 8775 1: abcd 8776 endingwxyz 8777 0: 8778 1: <unset> 8779 2: wxyz 8780 8781/(?>.*)(?<=(abcd)|(wxyz))/ 8782 alphabetabcd 8783 0: alphabetabcd 8784 1: abcd 8785 endingwxyz 8786 0: endingwxyz 8787 1: <unset> 8788 2: wxyz 8789 8790"(?>.*)foo" 8791 abcdfooxyz 8792No match 8793 8794"(?>.*?)foo" 8795 abcdfooxyz 8796 0: foo 8797 8798/-- End of testinput1 --/ 8799