1 # This set of tests check the DFA matching functionality of pcre2_dfa_match(), 2 # excluding UTF and Unicode property support. All matches are done using DFA, 3 # forced by setting a default subject modifier at the start. 4 5 #forbid_utf 6 #subject dfa 7 #newline_default lf anycrlf any 8 9 /abc/ 10 abc 11 0: abc 12 13 /ab*c/ 14 abc 15 0: abc 16 abbbbc 17 0: abbbbc 18 ac 19 0: ac 20 21 /ab+c/ 22 abc 23 0: abc 24 abbbbbbc 25 0: abbbbbbc 26 \= Expect no match 27 ac 28 No match 29 ab 30 No match 31 32 /a*/no_auto_possess 33 a 34 0: a 35 1: 36 aaaaaaaaaaaaaaaaa 37 Matched, but offsets vector is too small to show all matches 38 0: aaaaaaaaaaaaaaaaa 39 1: aaaaaaaaaaaaaaaa 40 2: aaaaaaaaaaaaaaa 41 3: aaaaaaaaaaaaaa 42 4: aaaaaaaaaaaaa 43 5: aaaaaaaaaaaa 44 6: aaaaaaaaaaa 45 7: aaaaaaaaaa 46 8: aaaaaaaaa 47 9: aaaaaaaa 48 10: aaaaaaa 49 11: aaaaaa 50 12: aaaaa 51 13: aaaa 52 14: aaa 53 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\=ovector=10 54 Matched, but offsets vector is too small to show all matches 55 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 56 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaa 57 2: aaaaaaaaaaaaaaaaaaaaaaaaaaaa 58 3: aaaaaaaaaaaaaaaaaaaaaaaaaaa 59 4: aaaaaaaaaaaaaaaaaaaaaaaaaa 60 5: aaaaaaaaaaaaaaaaaaaaaaaaa 61 6: aaaaaaaaaaaaaaaaaaaaaaaa 62 7: aaaaaaaaaaaaaaaaaaaaaaa 63 8: aaaaaaaaaaaaaaaaaaaaaa 64 9: aaaaaaaaaaaaaaaaaaaaa 65 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\=dfa_shortest 66 0: 67 68 /(a|abcd|african)/ 69 a 70 0: a 71 abcd 72 0: abcd 73 1: a 74 african 75 0: african 76 1: a 77 78 /^abc/ 79 abcdef 80 0: abc 81 \= Expect no match 82 xyzabc 83 No match 84 xyz\nabc 85 No match 86 87 /^abc/m 88 abcdef 89 0: abc 90 xyz\nabc 91 0: abc 92 \= Expect no match 93 xyzabc 94 No match 95 96 /\Aabc/ 97 abcdef 98 0: abc 99 \= Expect no match 100 xyzabc 101 No match 102 xyz\nabc 103 No match 104 105 /\Aabc/m 106 abcdef 107 0: abc 108 \= Expect no match 109 xyzabc 110 No match 111 xyz\nabc 112 No match 113 114 /\Gabc/ 115 abcdef 116 0: abc 117 xyzabc\=offset=3 118 0: abc 119 \= Expect no match 120 xyzabc 121 No match 122 xyzabc\=offset=2 123 No match 124 125 /x\dy\Dz/ 126 x9yzz 127 0: x9yzz 128 x0y+z 129 0: x0y+z 130 \= Expect no match 131 xyz 132 No match 133 xxy0z 134 No match 135 136 /x\sy\Sz/ 137 x yzz 138 0: x yzz 139 x y+z 140 0: x y+z 141 \= Expect no match 142 xyz 143 No match 144 xxyyz 145 No match 146 147 /x\wy\Wz/ 148 xxy+z 149 0: xxy+z 150 \= Expect no match 151 xxy0z 152 No match 153 x+y+z 154 No match 155 156 /x.y/ 157 x+y 158 0: x+y 159 x-y 160 0: x-y 161 \= Expect no match 162 x\ny 163 No match 164 165 /x.y/s 166 x+y 167 0: x+y 168 x-y 169 0: x-y 170 x\ny 171 0: x\x0ay 172 173 /(a.b(?s)c.d|x.y)p.q/ 174 a+bc+dp+q 175 0: a+bc+dp+q 176 a+bc\ndp+q 177 0: a+bc\x0adp+q 178 x\nyp+q 179 0: x\x0ayp+q 180 \= Expect no match 181 a\nbc\ndp+q 182 No match 183 a+bc\ndp\nq 184 No match 185 x\nyp\nq 186 No match 187 188 /a\d\z/ 189 ba0 190 0: a0 191 \= Expect no match 192 ba0\n 193 No match 194 ba0\ncd 195 No match 196 197 /a\d\z/m 198 ba0 199 0: a0 200 \= Expect no match 201 ba0\n 202 No match 203 ba0\ncd 204 No match 205 206 /a\d\Z/ 207 ba0 208 0: a0 209 ba0\n 210 0: a0 211 \= Expect no match 212 ba0\ncd 213 No match 214 215 /a\d\Z/m 216 ba0 217 0: a0 218 ba0\n 219 0: a0 220 \= Expect no match 221 ba0\ncd 222 No match 223 224 /a\d$/ 225 ba0 226 0: a0 227 ba0\n 228 0: a0 229 \= Expect no match 230 ba0\ncd 231 No match 232 233 /a\d$/m 234 ba0 235 0: a0 236 ba0\n 237 0: a0 238 ba0\ncd 239 0: a0 240 241 /abc/i 242 abc 243 0: abc 244 aBc 245 0: aBc 246 ABC 247 0: ABC 248 249 /[^a]/ 250 abcd 251 0: b 252 253 /ab?\w/ 254 abz 255 0: abz 256 1: ab 257 abbz 258 0: abb 259 1: ab 260 azz 261 0: az 262 263 /x{0,3}yz/ 264 ayzq 265 0: yz 266 axyzq 267 0: xyz 268 axxyz 269 0: xxyz 270 axxxyzq 271 0: xxxyz 272 axxxxyzq 273 0: xxxyz 274 \= Expect no match 275 ax 276 No match 277 axx 278 No match 279 280 /x{3}yz/ 281 axxxyzq 282 0: xxxyz 283 axxxxyzq 284 0: xxxyz 285 \= Expect no match 286 ax 287 No match 288 axx 289 No match 290 ayzq 291 No match 292 axyzq 293 No match 294 axxyz 295 No match 296 297 /x{2,3}yz/ 298 axxyz 299 0: xxyz 300 axxxyzq 301 0: xxxyz 302 axxxxyzq 303 0: xxxyz 304 \= Expect no match 305 ax 306 No match 307 axx 308 No match 309 ayzq 310 No match 311 axyzq 312 No match 313 314 /[^a]+/no_auto_possess 315 bac 316 0: b 317 bcdefax 318 0: bcdef 319 1: bcde 320 2: bcd 321 3: bc 322 4: b 323 \= Expect no match 324 aaaaa 325 No match 326 327 /[^a]*/no_auto_possess 328 bac 329 0: b 330 1: 331 bcdefax 332 0: bcdef 333 1: bcde 334 2: bcd 335 3: bc 336 4: b 337 5: 338 aaaaa 339 0: 340 341 /[^a]{3,5}/no_auto_possess 342 xyz 343 0: xyz 344 awxyza 345 0: wxyz 346 1: wxy 347 abcdefa 348 0: bcdef 349 1: bcde 350 2: bcd 351 abcdefghijk 352 0: bcdef 353 1: bcde 354 2: bcd 355 \= Expect no match 356 axya 357 No match 358 axa 359 No match 360 aaaaa 361 No match 362 363 /\d*/ 364 1234b567 365 0: 1234 366 xyz 367 0: 368 369 /\D*/ 370 a1234b567 371 0: a 372 xyz 373 0: xyz 374 375 /\d+/ 376 ab1234c56 377 0: 1234 378 \= Expect no match 379 xyz 380 No match 381 382 /\D+/ 383 ab123c56 384 0: ab 385 \= Expect no match 386 789 387 No match 388 389 /\d?A/ 390 045ABC 391 0: 5A 392 ABC 393 0: A 394 \= Expect no match 395 XYZ 396 No match 397 398 /\D?A/ 399 ABC 400 0: A 401 BAC 402 0: BA 403 9ABC 404 0: A 405 406 /a+/ 407 aaaa 408 0: aaaa 409 410 /^.*xyz/ 411 xyz 412 0: xyz 413 ggggggggxyz 414 0: ggggggggxyz 415 416 /^.+xyz/ 417 abcdxyz 418 0: abcdxyz 419 axyz 420 0: axyz 421 \= Expect no match 422 xyz 423 No match 424 425 /^.?xyz/ 426 xyz 427 0: xyz 428 cxyz 429 0: cxyz 430 431 /^\d{2,3}X/ 432 12X 433 0: 12X 434 123X 435 0: 123X 436 \= Expect no match 437 X 438 No match 439 1X 440 No match 441 1234X 442 No match 443 444 /^[abcd]\d/ 445 a45 446 0: a4 447 b93 448 0: b9 449 c99z 450 0: c9 451 d04 452 0: d0 453 \= Expect no match 454 e45 455 No match 456 abcd 457 No match 458 abcd1234 459 No match 460 1234 461 No match 462 463 /^[abcd]*\d/ 464 a45 465 0: a4 466 b93 467 0: b9 468 c99z 469 0: c9 470 d04 471 0: d0 472 abcd1234 473 0: abcd1 474 1234 475 0: 1 476 \= Expect no match 477 e45 478 No match 479 abcd 480 No match 481 482 /^[abcd]+\d/ 483 a45 484 0: a4 485 b93 486 0: b9 487 c99z 488 0: c9 489 d04 490 0: d0 491 abcd1234 492 0: abcd1 493 \= Expect no match 494 1234 495 No match 496 e45 497 No match 498 abcd 499 No match 500 501 /^a+X/ 502 aX 503 0: aX 504 aaX 505 0: aaX 506 507 /^[abcd]?\d/ 508 a45 509 0: a4 510 b93 511 0: b9 512 c99z 513 0: c9 514 d04 515 0: d0 516 1234 517 0: 1 518 \= Expect no match 519 abcd1234 520 No match 521 e45 522 No match 523 524 /^[abcd]{2,3}\d/ 525 ab45 526 0: ab4 527 bcd93 528 0: bcd9 529 \= Expect no match 530 1234 531 No match 532 a36 533 No match 534 abcd1234 535 No match 536 ee45 537 No match 538 539 /^(abc)*\d/ 540 abc45 541 0: abc4 542 abcabcabc45 543 0: abcabcabc4 544 42xyz 545 0: 4 546 547 /^(abc)+\d/ 548 abc45 549 0: abc4 550 abcabcabc45 551 0: abcabcabc4 552 \= Expect no match 553 42xyz 554 No match 555 556 /^(abc)?\d/ 557 abc45 558 0: abc4 559 42xyz 560 0: 4 561 \= Expect no match 562 abcabcabc45 563 No match 564 565 /^(abc){2,3}\d/ 566 abcabc45 567 0: abcabc4 568 abcabcabc45 569 0: abcabcabc4 570 \= Expect no match 571 abcabcabcabc45 572 No match 573 abc45 574 No match 575 42xyz 576 No match 577 578 /1(abc|xyz)2(?1)3/ 579 1abc2abc3456 580 0: 1abc2abc3 581 1abc2xyz3456 582 0: 1abc2xyz3 583 584 /^(a*\w|ab)=(a*\w|ab)/ 585 ab=ab 586 0: ab=ab 587 1: ab=a 588 589 /^(a*\w|ab)=(?1)/ 590 ab=ab 591 0: ab=ab 592 1: ab=a 593 594 /^([^()]|\((?1)*\))*$/ 595 abc 596 0: abc 597 a(b)c 598 0: a(b)c 599 a(b(c))d 600 0: a(b(c))d 601 \= Expect no match) 602 a(b(c)d 603 No match 604 605 /^>abc>([^()]|\((?1)*\))*<xyz<$/ 606 >abc>123<xyz< 607 0: >abc>123<xyz< 608 >abc>1(2)3<xyz< 609 0: >abc>1(2)3<xyz< 610 >abc>(1(2)3)<xyz< 611 0: >abc>(1(2)3)<xyz< 612 613 /^(?>a*)\d/ 614 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9876 615 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9 616 \= Expect no match 617 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 618 No match 619 620 /< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/x 621 <> 622 0: <> 623 <abcd> 624 0: <abcd> 625 <abc <123> hij> 626 0: <abc <123> hij> 627 <abc <def> hij> 628 0: <def> 629 <abc<>def> 630 0: <abc<>def> 631 <abc<> 632 0: <> 633 \= Expect no match 634 <abc 635 No match 636 637 /^(?(?=abc)\w{3}:|\d\d)$/ 638 abc: 639 0: abc: 640 12 641 0: 12 642 \= Expect no match 643 123 644 No match 645 xyz 646 No match 647 648 /^(?(?!abc)\d\d|\w{3}:)$/ 649 abc: 650 0: abc: 651 12 652 0: 12 653 \= Expect no match 654 123 655 No match 656 xyz 657 No match 658 659 /^(?=abc)\w{5}:$/ 660 abcde: 661 0: abcde: 662 \= Expect no match 663 abc.. 664 No match 665 123 666 No match 667 vwxyz 668 No match 669 670 /^(?!abc)\d\d$/ 671 12 672 0: 12 673 \= Expect no match 674 abcde: 675 No match 676 abc.. 677 No match 678 123 679 No match 680 vwxyz 681 No match 682 683 /(?<=abc|xy)123/ 684 abc12345 685 0: 123 686 wxy123z 687 0: 123 688 \= Expect no match 689 123abc 690 No match 691 692 /(?<!abc|xy)123/ 693 123abc 694 0: 123 695 mno123456 696 0: 123 697 \= Expect no match 698 abc12345 699 No match 700 wxy123z 701 No match 702 703 /abc(?C1)xyz/ 704 abcxyz 705 --->abcxyz 706 1 ^ ^ x 707 0: abcxyz 708 123abcxyz999 709 --->123abcxyz999 710 1 ^ ^ x 711 0: abcxyz 712 713 /(ab|cd){3,4}/auto_callout 714 ababab 715 --->ababab 716 +0 ^ (ab|cd){3,4} 717 +1 ^ a 718 +4 ^ c 719 +2 ^^ b 720 +3 ^ ^ | 721 +1 ^ ^ a 722 +4 ^ ^ c 723 +2 ^ ^ b 724 +3 ^ ^ | 725 +1 ^ ^ a 726 +4 ^ ^ c 727 +2 ^ ^ b 728 +3 ^ ^ | 729 +12 ^ ^ 730 +1 ^ ^ a 731 +4 ^ ^ c 732 0: ababab 733 abcdabcd 734 --->abcdabcd 735 +0 ^ (ab|cd){3,4} 736 +1 ^ a 737 +4 ^ c 738 +2 ^^ b 739 +3 ^ ^ | 740 +1 ^ ^ a 741 +4 ^ ^ c 742 +5 ^ ^ d 743 +6 ^ ^ ) 744 +1 ^ ^ a 745 +4 ^ ^ c 746 +2 ^ ^ b 747 +3 ^ ^ | 748 +12 ^ ^ 749 +1 ^ ^ a 750 +4 ^ ^ c 751 +5 ^ ^ d 752 +6 ^ ^ ) 753 +12 ^ ^ 754 0: abcdabcd 755 1: abcdab 756 abcdcdcdcdcd 757 --->abcdcdcdcdcd 758 +0 ^ (ab|cd){3,4} 759 +1 ^ a 760 +4 ^ c 761 +2 ^^ b 762 +3 ^ ^ | 763 +1 ^ ^ a 764 +4 ^ ^ c 765 +5 ^ ^ d 766 +6 ^ ^ ) 767 +1 ^ ^ a 768 +4 ^ ^ c 769 +5 ^ ^ d 770 +6 ^ ^ ) 771 +12 ^ ^ 772 +1 ^ ^ a 773 +4 ^ ^ c 774 +5 ^ ^ d 775 +6 ^ ^ ) 776 +12 ^ ^ 777 0: abcdcdcd 778 1: abcdcd 779 780 /^abc/ 781 abcdef 782 0: abc 783 \= Expect no match 784 abcdef\=notbol 785 No match 786 787 /^(a*|xyz)/ 788 bcd 789 0: 790 aaabcd 791 0: aaa 792 xyz 793 0: xyz 794 1: 795 xyz\=notempty 796 0: xyz 797 \= Expect no match 798 bcd\=notempty 799 No match 800 801 /xyz$/ 802 xyz 803 0: xyz 804 xyz\n 805 0: xyz 806 \= Expect no match 807 xyz\=noteol 808 No match 809 xyz\n\=noteol 810 No match 811 812 /xyz$/m 813 xyz 814 0: xyz 815 xyz\n 816 0: xyz 817 abcxyz\npqr 818 0: xyz 819 abcxyz\npqr\=noteol 820 0: xyz 821 xyz\n\=noteol 822 0: xyz 823 \= Expect no match 824 xyz\=noteol 825 No match 826 827 /\Gabc/ 828 abcdef 829 0: abc 830 defabcxyz\=offset=3 831 0: abc 832 \= Expect no match 833 defabcxyz 834 No match 835 836 /^abcdef/ 837 ab\=ps 838 Partial match: ab 839 abcde\=ps 840 Partial match: abcde 841 abcdef\=ps 842 0: abcdef 843 \= Expect no match 844 abx\=ps 845 No match 846 847 /^a{2,4}\d+z/ 848 a\=ps 849 Partial match: a 850 aa\=ps 851 Partial match: aa 852 aa2\=ps 853 Partial match: aa2 854 aaa\=ps 855 Partial match: aaa 856 aaa23\=ps 857 Partial match: aaa23 858 aaaa12345\=ps 859 Partial match: aaaa12345 860 aa0z\=ps 861 0: aa0z 862 aaaa4444444444444z\=ps 863 0: aaaa4444444444444z 864 \= Expect no match 865 az\=ps 866 No match 867 aaaaa\=ps 868 No match 869 a56\=ps 870 No match 871 872 /^abcdef/ 873 abc\=ps 874 Partial match: abc 875 def\=dfa_restart 876 0: def 877 878 /(?<=foo)bar/ 879 foob\=ps,offset=2 880 Partial match: foob 881 <<< 882 foobar...\=ps,dfa_restart,offset=4 883 0: ar 884 foobar\=offset=2 885 0: bar 886 \= Expect no match 887 xyzfo\=ps 888 No match 889 obar\=dfa_restart 890 No match 891 892 /(ab*(cd|ef))+X/ 893 lkjhlkjhlkjhlkjhabbbbbbcdaefabbbbbbbefa\=ps,notbol,noteol 894 Partial match: abbbbbbcdaefabbbbbbbefa 895 cdabbbbbbbb\=ps,notbol,dfa_restart,noteol 896 Partial match: cdabbbbbbbb 897 efabbbbbbbbbbbbbbbb\=ps,notbol,dfa_restart,noteol 898 Partial match: efabbbbbbbbbbbbbbbb 899 bbbbbbbbbbbbcdXyasdfadf\=ps,notbol,dfa_restart,noteol 900 0: bbbbbbbbbbbbcdX 901 \= Expect no match 902 adfadadaklhlkalkajhlkjahdfasdfasdfladsfjkj\=ps,noteol 903 No match 904 905 /the quick brown fox/ 906 the quick brown fox 907 0: the quick brown fox 908 What do you know about the quick brown fox? 909 0: the quick brown fox 910 \= Expect no match 911 The quick brown FOX 912 No match 913 What do you know about THE QUICK BROWN FOX? 914 No match 915 916 /The quick brown fox/i 917 the quick brown fox 918 0: the quick brown fox 919 The quick brown FOX 920 0: The quick brown FOX 921 What do you know about the quick brown fox? 922 0: the quick brown fox 923 What do you know about THE QUICK BROWN FOX? 924 0: THE QUICK BROWN FOX 925 926 /abcd\t\n\r\f\a\e\071\x3b\$\\\?caxyz/ 927 abcd\t\n\r\f\a\e9;\$\\?caxyz 928 0: abcd\x09\x0a\x0d\x0c\x07\x1b9;$\?caxyz 929 930 /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/ 931 abxyzpqrrrabbxyyyypqAzz 932 0: abxyzpqrrrabbxyyyypqAzz 933 abxyzpqrrrabbxyyyypqAzz 934 0: abxyzpqrrrabbxyyyypqAzz 935 aabxyzpqrrrabbxyyyypqAzz 936 0: aabxyzpqrrrabbxyyyypqAzz 937 aaabxyzpqrrrabbxyyyypqAzz 938 0: aaabxyzpqrrrabbxyyyypqAzz 939 aaaabxyzpqrrrabbxyyyypqAzz 940 0: aaaabxyzpqrrrabbxyyyypqAzz 941 abcxyzpqrrrabbxyyyypqAzz 942 0: abcxyzpqrrrabbxyyyypqAzz 943 aabcxyzpqrrrabbxyyyypqAzz 944 0: aabcxyzpqrrrabbxyyyypqAzz 945 aaabcxyzpqrrrabbxyyyypAzz 946 0: aaabcxyzpqrrrabbxyyyypAzz 947 aaabcxyzpqrrrabbxyyyypqAzz 948 0: aaabcxyzpqrrrabbxyyyypqAzz 949 aaabcxyzpqrrrabbxyyyypqqAzz 950 0: aaabcxyzpqrrrabbxyyyypqqAzz 951 aaabcxyzpqrrrabbxyyyypqqqAzz 952 0: aaabcxyzpqrrrabbxyyyypqqqAzz 953 aaabcxyzpqrrrabbxyyyypqqqqAzz 954 0: aaabcxyzpqrrrabbxyyyypqqqqAzz 955 aaabcxyzpqrrrabbxyyyypqqqqqAzz 956 0: aaabcxyzpqrrrabbxyyyypqqqqqAzz 957 aaabcxyzpqrrrabbxyyyypqqqqqqAzz 958 0: aaabcxyzpqrrrabbxyyyypqqqqqqAzz 959 aaaabcxyzpqrrrabbxyyyypqAzz 960 0: aaaabcxyzpqrrrabbxyyyypqAzz 961 abxyzzpqrrrabbxyyyypqAzz 962 0: abxyzzpqrrrabbxyyyypqAzz 963 aabxyzzzpqrrrabbxyyyypqAzz 964 0: aabxyzzzpqrrrabbxyyyypqAzz 965 aaabxyzzzzpqrrrabbxyyyypqAzz 966 0: aaabxyzzzzpqrrrabbxyyyypqAzz 967 aaaabxyzzzzpqrrrabbxyyyypqAzz 968 0: aaaabxyzzzzpqrrrabbxyyyypqAzz 969 abcxyzzpqrrrabbxyyyypqAzz 970 0: abcxyzzpqrrrabbxyyyypqAzz 971 aabcxyzzzpqrrrabbxyyyypqAzz 972 0: aabcxyzzzpqrrrabbxyyyypqAzz 973 aaabcxyzzzzpqrrrabbxyyyypqAzz 974 0: aaabcxyzzzzpqrrrabbxyyyypqAzz 975 aaaabcxyzzzzpqrrrabbxyyyypqAzz 976 0: aaaabcxyzzzzpqrrrabbxyyyypqAzz 977 aaaabcxyzzzzpqrrrabbbxyyyypqAzz 978 0: aaaabcxyzzzzpqrrrabbbxyyyypqAzz 979 aaaabcxyzzzzpqrrrabbbxyyyyypqAzz 980 0: aaaabcxyzzzzpqrrrabbbxyyyyypqAzz 981 aaabcxyzpqrrrabbxyyyypABzz 982 0: aaabcxyzpqrrrabbxyyyypABzz 983 aaabcxyzpqrrrabbxyyyypABBzz 984 0: aaabcxyzpqrrrabbxyyyypABBzz 985 >>>aaabxyzpqrrrabbxyyyypqAzz 986 0: aaabxyzpqrrrabbxyyyypqAzz 987 >aaaabxyzpqrrrabbxyyyypqAzz 988 0: aaaabxyzpqrrrabbxyyyypqAzz 989 >>>>abcxyzpqrrrabbxyyyypqAzz 990 0: abcxyzpqrrrabbxyyyypqAzz 991 \= Expect no match 992 abxyzpqrrabbxyyyypqAzz 993 No match 994 abxyzpqrrrrabbxyyyypqAzz 995 No match 996 abxyzpqrrrabxyyyypqAzz 997 No match 998 aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz 999 No match 1000 aaaabcxyzzzzpqrrrabbbxyyypqAzz 1001 No match 1002 aaabcxyzpqrrrabbxyyyypqqqqqqqAzz 1003 No match 1004 1005 /^(abc){1,2}zz/ 1006 abczz 1007 0: abczz 1008 abcabczz 1009 0: abcabczz 1010 \= Expect no match 1011 zz 1012 No match 1013 abcabcabczz 1014 No match 1015 >>abczz 1016 No match 1017 1018 /^(b+?|a){1,2}?c/ 1019 bc 1020 0: bc 1021 bbc 1022 0: bbc 1023 bbbc 1024 0: bbbc 1025 bac 1026 0: bac 1027 bbac 1028 0: bbac 1029 aac 1030 0: aac 1031 abbbbbbbbbbbc 1032 0: abbbbbbbbbbbc 1033 bbbbbbbbbbbac 1034 0: bbbbbbbbbbbac 1035 \= Expect no match 1036 aaac 1037 No match 1038 abbbbbbbbbbbac 1039 No match 1040 1041 /^(b+|a){1,2}c/ 1042 bc 1043 0: bc 1044 bbc 1045 0: bbc 1046 bbbc 1047 0: bbbc 1048 bac 1049 0: bac 1050 bbac 1051 0: bbac 1052 aac 1053 0: aac 1054 abbbbbbbbbbbc 1055 0: abbbbbbbbbbbc 1056 bbbbbbbbbbbac 1057 0: bbbbbbbbbbbac 1058 \= Expect no match 1059 aaac 1060 No match 1061 abbbbbbbbbbbac 1062 No match 1063 1064 /^(b+|a){1,2}?bc/ 1065 bbc 1066 0: bbc 1067 1068 /^(b*|ba){1,2}?bc/ 1069 babc 1070 0: babc 1071 bbabc 1072 0: bbabc 1073 bababc 1074 0: bababc 1075 \= Expect no match 1076 bababbc 1077 No match 1078 babababc 1079 No match 1080 1081 /^(ba|b*){1,2}?bc/ 1082 babc 1083 0: babc 1084 bbabc 1085 0: bbabc 1086 bababc 1087 0: bababc 1088 \= Expect no match 1089 bababbc 1090 No match 1091 babababc 1092 No match 1093 1094 /^\ca\cA\c[\c{\c:/ 1095 \x01\x01\e;z 1096 0: \x01\x01\x1b;z 1097 1098 /^[ab\]cde]/ 1099 athing 1100 0: a 1101 bthing 1102 0: b 1103 ]thing 1104 0: ] 1105 cthing 1106 0: c 1107 dthing 1108 0: d 1109 ething 1110 0: e 1111 \= Expect no match 1112 fthing 1113 No match 1114 [thing 1115 No match 1116 \\thing 1117 No match 1118 1119 /^[]cde]/ 1120 ]thing 1121 0: ] 1122 cthing 1123 0: c 1124 dthing 1125 0: d 1126 ething 1127 0: e 1128 \= Expect no match 1129 athing 1130 No match 1131 fthing 1132 No match 1133 1134 /^[^ab\]cde]/ 1135 fthing 1136 0: f 1137 [thing 1138 0: [ 1139 \\thing 1140 0: \ 1141 \= Expect no match 1142 athing 1143 No match 1144 bthing 1145 No match 1146 ]thing 1147 No match 1148 cthing 1149 No match 1150 dthing 1151 No match 1152 ething 1153 No match 1154 1155 /^[^]cde]/ 1156 athing 1157 0: a 1158 fthing 1159 0: f 1160 \= Expect no match 1161 ]thing 1162 No match 1163 cthing 1164 No match 1165 dthing 1166 No match 1167 ething 1168 No match 1169 1170 /^\/ 1171 1172 0: \x81 1173 1174 /^/ 1175 1176 0: \xff 1177 1178 /^[0-9]+$/ 1179 0 1180 0: 0 1181 1 1182 0: 1 1183 2 1184 0: 2 1185 3 1186 0: 3 1187 4 1188 0: 4 1189 5 1190 0: 5 1191 6 1192 0: 6 1193 7 1194 0: 7 1195 8 1196 0: 8 1197 9 1198 0: 9 1199 10 1200 0: 10 1201 100 1202 0: 100 1203 \= Expect no match 1204 abc 1205 No match 1206 1207 /^.*nter/ 1208 enter 1209 0: enter 1210 inter 1211 0: inter 1212 uponter 1213 0: uponter 1214 1215 /^xxx[0-9]+$/ 1216 xxx0 1217 0: xxx0 1218 xxx1234 1219 0: xxx1234 1220 \= Expect no match 1221 xxx 1222 No match 1223 1224 /^.+[0-9][0-9][0-9]$/ 1225 x123 1226 0: x123 1227 xx123 1228 0: xx123 1229 123456 1230 0: 123456 1231 x1234 1232 0: x1234 1233 \= Expect no match 1234 123 1235 No match 1236 1237 /^.+?[0-9][0-9][0-9]$/ 1238 x123 1239 0: x123 1240 xx123 1241 0: xx123 1242 123456 1243 0: 123456 1244 x1234 1245 0: x1234 1246 \= Expect no match 1247 123 1248 No match 1249 1250 /^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/ 1251 abc!pqr=apquxz.ixr.zzz.ac.uk 1252 0: abc!pqr=apquxz.ixr.zzz.ac.uk 1253 \= Expect no match 1254 !pqr=apquxz.ixr.zzz.ac.uk 1255 No match 1256 abc!=apquxz.ixr.zzz.ac.uk 1257 No match 1258 abc!pqr=apquxz:ixr.zzz.ac.uk 1259 No match 1260 abc!pqr=apquxz.ixr.zzz.ac.ukk 1261 No match 1262 1263 /:/ 1264 Well, we need a colon: somewhere 1265 0: : 1266 \= Expect no match 1267 No match without a colon 1268 No match 1269 1270 /([\da-f:]+)$/i 1271 0abc 1272 0: 0abc 1273 abc 1274 0: abc 1275 fed 1276 0: fed 1277 E 1278 0: E 1279 :: 1280 0: :: 1281 5f03:12C0::932e 1282 0: 5f03:12C0::932e 1283 fed def 1284 0: def 1285 Any old stuff 1286 0: ff 1287 \= Expect no match 1288 0zzz 1289 No match 1290 gzzz 1291 No match 1292 fed\x20 1293 No match 1294 Any old rubbish 1295 No match 1296 1297 /^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/ 1298 .1.2.3 1299 0: .1.2.3 1300 A.12.123.0 1301 0: A.12.123.0 1302 \= Expect no match 1303 .1.2.3333 1304 No match 1305 1.2.3 1306 No match 1307 1234.2.3 1308 No match 1309 1310 /^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/ 1311 1 IN SOA non-sp1 non-sp2( 1312 0: 1 IN SOA non-sp1 non-sp2( 1313 1 IN SOA non-sp1 non-sp2 ( 1314 0: 1 IN SOA non-sp1 non-sp2 ( 1315 \= Expect no match 1316 1IN SOA non-sp1 non-sp2( 1317 No match 1318 1319 /^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/ 1320 a. 1321 0: a. 1322 Z. 1323 0: Z. 1324 2. 1325 0: 2. 1326 ab-c.pq-r. 1327 0: ab-c.pq-r. 1328 sxk.zzz.ac.uk. 1329 0: sxk.zzz.ac.uk. 1330 x-.y-. 1331 0: x-.y-. 1332 \= Expect no match 1333 -abc.peq. 1334 No match 1335 1336 /^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/ 1337 *.a 1338 0: *.a 1339 *.b0-a 1340 0: *.b0-a 1341 *.c3-b.c 1342 0: *.c3-b.c 1343 *.c-a.b-c 1344 0: *.c-a.b-c 1345 \= Expect no match 1346 *.0 1347 No match 1348 *.a- 1349 No match 1350 *.a-b.c- 1351 No match 1352 *.c-a.0-c 1353 No match 1354 1355 /^(?=ab(de))(abd)(e)/ 1356 abde 1357 0: abde 1358 1359 /^(?!(ab)de|x)(abd)(f)/ 1360 abdf 1361 0: abdf 1362 1363 /^(?=(ab(cd)))(ab)/ 1364 abcd 1365 0: ab 1366 1367 /^[\da-f](\.[\da-f])*$/i 1368 a.b.c.d 1369 0: a.b.c.d 1370 A.B.C.D 1371 0: A.B.C.D 1372 a.b.c.1.2.3.C 1373 0: a.b.c.1.2.3.C 1374 1375 /^\".*\"\s*(;.*)?$/ 1376 \"1234\" 1377 0: "1234" 1378 \"abcd\" ; 1379 0: "abcd" ; 1380 \"\" ; rhubarb 1381 0: "" ; rhubarb 1382 \= Expect no match 1383 \"1234\" : things 1384 No match 1385 1386 /^$/ 1387 \ 1388 0: 1389 1390 / ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x 1391 ab c 1392 0: ab c 1393 \= Expect no match 1394 abc 1395 No match 1396 ab cde 1397 No match 1398 1399 /(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/ 1400 ab c 1401 0: ab c 1402 \= Expect no match 1403 abc 1404 No match 1405 ab cde 1406 No match 1407 1408 /^ a\ b[c ]d $/x 1409 a bcd 1410 0: a bcd 1411 a b d 1412 0: a b d 1413 \= Expect no match 1414 abcd 1415 No match 1416 ab d 1417 No match 1418 1419 /^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/ 1420 abcdefhijklm 1421 0: abcdefhijklm 1422 1423 /^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/ 1424 abcdefhijklm 1425 0: abcdefhijklm 1426 1427 /^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/ 1428 a+ Z0+\x08\n\x1d\x12 1429 0: a+ Z0+\x08\x0a\x1d\x12 1430 1431 /^[.^$|()*+?{,}]+/ 1432 .^\$(*+)|{?,?} 1433 0: .^$(*+)|{?,?} 1434 1435 /^a*\w/ 1436 z 1437 0: z 1438 az 1439 0: az 1440 1: a 1441 aaaz 1442 0: aaaz 1443 1: aaa 1444 2: aa 1445 3: a 1446 a 1447 0: a 1448 aa 1449 0: aa 1450 1: a 1451 aaaa 1452 0: aaaa 1453 1: aaa 1454 2: aa 1455 3: a 1456 a+ 1457 0: a 1458 aa+ 1459 0: aa 1460 1: a 1461 1462 /^a*?\w/ 1463 z 1464 0: z 1465 az 1466 0: az 1467 1: a 1468 aaaz 1469 0: aaaz 1470 1: aaa 1471 2: aa 1472 3: a 1473 a 1474 0: a 1475 aa 1476 0: aa 1477 1: a 1478 aaaa 1479 0: aaaa 1480 1: aaa 1481 2: aa 1482 3: a 1483 a+ 1484 0: a 1485 aa+ 1486 0: aa 1487 1: a 1488 1489 /^a+\w/ 1490 az 1491 0: az 1492 aaaz 1493 0: aaaz 1494 1: aaa 1495 2: aa 1496 aa 1497 0: aa 1498 aaaa 1499 0: aaaa 1500 1: aaa 1501 2: aa 1502 aa+ 1503 0: aa 1504 1505 /^a+?\w/ 1506 az 1507 0: az 1508 aaaz 1509 0: aaaz 1510 1: aaa 1511 2: aa 1512 aa 1513 0: aa 1514 aaaa 1515 0: aaaa 1516 1: aaa 1517 2: aa 1518 aa+ 1519 0: aa 1520 1521 /^\d{8}\w{2,}/ 1522 1234567890 1523 0: 1234567890 1524 12345678ab 1525 0: 12345678ab 1526 12345678__ 1527 0: 12345678__ 1528 \= Expect no match 1529 1234567 1530 No match 1531 1532 /^[aeiou\d]{4,5}$/ 1533 uoie 1534 0: uoie 1535 1234 1536 0: 1234 1537 12345 1538 0: 12345 1539 aaaaa 1540 0: aaaaa 1541 \= Expect no match 1542 123456 1543 No match 1544 1545 /^[aeiou\d]{4,5}?/ 1546 uoie 1547 0: uoie 1548 1234 1549 0: 1234 1550 12345 1551 0: 12345 1552 1: 1234 1553 aaaaa 1554 0: aaaaa 1555 1: aaaa 1556 123456 1557 0: 12345 1558 1: 1234 1559 1560 /^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]/ 1561 From abcd Mon Sep 01 12:33:02 1997 1562 0: From abcd Mon Sep 01 12:33 1563 1564 /^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/ 1565 From abcd Mon Sep 01 12:33:02 1997 1566 0: From abcd Mon Sep 01 12:33 1567 From abcd Mon Sep 1 12:33:02 1997 1568 0: From abcd Mon Sep 1 12:33 1569 \= Expect no match 1570 From abcd Sep 01 12:33:02 1997 1571 No match 1572 1573 /^12.34/s 1574 12\n34 1575 0: 12\x0a34 1576 12\r34 1577 0: 12\x0d34 1578 1579 /\w+(?=\t)/ 1580 the quick brown\t fox 1581 0: brown 1582 1583 /foo(?!bar)(.*)/ 1584 foobar is foolish see? 1585 0: foolish see? 1586 1587 /(?:(?!foo)...|^.{0,2})bar(.*)/ 1588 foobar crowbar etc 1589 0: rowbar etc 1590 barrel 1591 0: barrel 1592 2barrel 1593 0: 2barrel 1594 A barrel 1595 0: A barrel 1596 1597 /^(\D*)(?=\d)(?!123)/ 1598 abc456 1599 0: abc 1600 \= Expect no match 1601 abc123 1602 No match 1603 1604 /^1234(?# test newlines 1605 inside)/ 1606 1234 1607 0: 1234 1608 1609 /^1234 #comment in extended re 1610 /x 1611 1234 1612 0: 1234 1613 1614 /#rhubarb 1615 abcd/x 1616 abcd 1617 0: abcd 1618 1619 /^abcd#rhubarb/x 1620 abcd 1621 0: abcd 1622 1623 /(?!^)abc/ 1624 the abc 1625 0: abc 1626 \= Expect no match 1627 abc 1628 No match 1629 1630 /(?=^)abc/ 1631 abc 1632 0: abc 1633 \= Expect no match 1634 the abc 1635 No match 1636 1637 /^[ab]{1,3}(ab*|b)/no_auto_possess 1638 aabbbbb 1639 0: aabbbbb 1640 1: aabbbb 1641 2: aabbb 1642 3: aabb 1643 4: aab 1644 5: aa 1645 1646 /^[ab]{1,3}?(ab*|b)/no_auto_possess 1647 aabbbbb 1648 0: aabbbbb 1649 1: aabbbb 1650 2: aabbb 1651 3: aabb 1652 4: aab 1653 5: aa 1654 1655 /^[ab]{1,3}?(ab*?|b)/no_auto_possess 1656 aabbbbb 1657 0: aabbbbb 1658 1: aabbbb 1659 2: aabbb 1660 3: aabb 1661 4: aab 1662 5: aa 1663 1664 /^[ab]{1,3}(ab*?|b)/no_auto_possess 1665 aabbbbb 1666 0: aabbbbb 1667 1: aabbbb 1668 2: aabbb 1669 3: aabb 1670 4: aab 1671 5: aa 1672 1673 / (?: [\040\t] | \( 1674 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1675 \) )* # optional leading comment 1676 (?: (?: 1677 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1678 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1679 | 1680 " (?: # opening quote... 1681 [^\\\x80-\xff\n\015"] # Anything except backslash and quote 1682 | # or 1683 \\ [^\x80-\xff] # Escaped something (something != CR) 1684 )* " # closing quote 1685 ) # initial word 1686 (?: (?: [\040\t] | \( 1687 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1688 \) )* \. (?: [\040\t] | \( 1689 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1690 \) )* (?: 1691 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1692 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1693 | 1694 " (?: # opening quote... 1695 [^\\\x80-\xff\n\015"] # Anything except backslash and quote 1696 | # or 1697 \\ [^\x80-\xff] # Escaped something (something != CR) 1698 )* " # closing quote 1699 ) )* # further okay, if led by a period 1700 (?: [\040\t] | \( 1701 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1702 \) )* @ (?: [\040\t] | \( 1703 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1704 \) )* (?: 1705 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1706 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1707 | \[ # [ 1708 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 1709 \] # ] 1710 ) # initial subdomain 1711 (?: # 1712 (?: [\040\t] | \( 1713 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1714 \) )* \. # if led by a period... 1715 (?: [\040\t] | \( 1716 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1717 \) )* (?: 1718 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1719 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1720 | \[ # [ 1721 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 1722 \] # ] 1723 ) # ...further okay 1724 )* 1725 # address 1726 | # or 1727 (?: 1728 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1729 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1730 | 1731 " (?: # opening quote... 1732 [^\\\x80-\xff\n\015"] # Anything except backslash and quote 1733 | # or 1734 \\ [^\x80-\xff] # Escaped something (something != CR) 1735 )* " # closing quote 1736 ) # one word, optionally followed by.... 1737 (?: 1738 [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or... 1739 \( 1740 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1741 \) | # comments, or... 1742 1743 " (?: # opening quote... 1744 [^\\\x80-\xff\n\015"] # Anything except backslash and quote 1745 | # or 1746 \\ [^\x80-\xff] # Escaped something (something != CR) 1747 )* " # closing quote 1748 # quoted strings 1749 )* 1750 < (?: [\040\t] | \( 1751 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1752 \) )* # leading < 1753 (?: @ (?: [\040\t] | \( 1754 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1755 \) )* (?: 1756 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1757 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1758 | \[ # [ 1759 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 1760 \] # ] 1761 ) # initial subdomain 1762 (?: # 1763 (?: [\040\t] | \( 1764 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1765 \) )* \. # if led by a period... 1766 (?: [\040\t] | \( 1767 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1768 \) )* (?: 1769 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1770 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1771 | \[ # [ 1772 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 1773 \] # ] 1774 ) # ...further okay 1775 )* 1776 1777 (?: (?: [\040\t] | \( 1778 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1779 \) )* , (?: [\040\t] | \( 1780 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1781 \) )* @ (?: [\040\t] | \( 1782 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1783 \) )* (?: 1784 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1785 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1786 | \[ # [ 1787 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 1788 \] # ] 1789 ) # initial subdomain 1790 (?: # 1791 (?: [\040\t] | \( 1792 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1793 \) )* \. # if led by a period... 1794 (?: [\040\t] | \( 1795 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1796 \) )* (?: 1797 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1798 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1799 | \[ # [ 1800 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 1801 \] # ] 1802 ) # ...further okay 1803 )* 1804 )* # further okay, if led by comma 1805 : # closing colon 1806 (?: [\040\t] | \( 1807 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1808 \) )* )? # optional route 1809 (?: 1810 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1811 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1812 | 1813 " (?: # opening quote... 1814 [^\\\x80-\xff\n\015"] # Anything except backslash and quote 1815 | # or 1816 \\ [^\x80-\xff] # Escaped something (something != CR) 1817 )* " # closing quote 1818 ) # initial word 1819 (?: (?: [\040\t] | \( 1820 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1821 \) )* \. (?: [\040\t] | \( 1822 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1823 \) )* (?: 1824 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1825 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1826 | 1827 " (?: # opening quote... 1828 [^\\\x80-\xff\n\015"] # Anything except backslash and quote 1829 | # or 1830 \\ [^\x80-\xff] # Escaped something (something != CR) 1831 )* " # closing quote 1832 ) )* # further okay, if led by a period 1833 (?: [\040\t] | \( 1834 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1835 \) )* @ (?: [\040\t] | \( 1836 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1837 \) )* (?: 1838 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1839 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1840 | \[ # [ 1841 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 1842 \] # ] 1843 ) # initial subdomain 1844 (?: # 1845 (?: [\040\t] | \( 1846 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1847 \) )* \. # if led by a period... 1848 (?: [\040\t] | \( 1849 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1850 \) )* (?: 1851 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1852 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1853 | \[ # [ 1854 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 1855 \] # ] 1856 ) # ...further okay 1857 )* 1858 # address spec 1859 (?: [\040\t] | \( 1860 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1861 \) )* > # trailing > 1862 # name and address 1863 ) (?: [\040\t] | \( 1864 (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* 1865 \) )* # optional trailing comment 1866 /x 1867 Alan Other <user\@dom.ain> 1868 0: Alan Other <user (a] dom.ain> 1869 <user\@dom.ain> 1870 0: user (a] dom.ain 1871 1: user@dom 1872 user\@dom.ain 1873 0: user (a] dom.ain 1874 1: user@dom 1875 \"A. Other\" <user.1234\@dom.ain> (a comment) 1876 0: "A. Other" <user.1234 (a] dom.ain> (a comment) 1877 1: "A. Other" <user.1234 (a] dom.ain> 1878 2: "A. Other" <user.1234 (a] dom.ain> 1879 A. Other <user.1234\@dom.ain> (a comment) 1880 0: Other <user.1234 (a] dom.ain> (a comment) 1881 1: Other <user.1234 (a] dom.ain> 1882 2: Other <user.1234 (a] dom.ain> 1883 \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay 1884 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay 1885 1: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re 1886 A missing angle <user\@some.where 1887 0: user (a] some.where 1888 1: user@some 1889 \= Expect no match 1890 The quick brown fox 1891 No match 1892 1893 /[\040\t]* # Nab whitespace. 1894 (?: 1895 \( # ( 1896 [^\\\x80-\xff\n\015()] * # normal* 1897 (?: # ( 1898 (?: \\ [^\x80-\xff] | 1899 \( # ( 1900 [^\\\x80-\xff\n\015()] * # normal* 1901 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1902 \) # ) 1903 ) # special 1904 [^\\\x80-\xff\n\015()] * # normal* 1905 )* # )* 1906 \) # ) 1907 [\040\t]* )* # If comment found, allow more spaces. 1908 # optional leading comment 1909 (?: 1910 (?: 1911 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1912 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1913 # Atom 1914 | # or 1915 " # " 1916 [^\\\x80-\xff\n\015"] * # normal 1917 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* 1918 " # " 1919 # Quoted string 1920 ) 1921 [\040\t]* # Nab whitespace. 1922 (?: 1923 \( # ( 1924 [^\\\x80-\xff\n\015()] * # normal* 1925 (?: # ( 1926 (?: \\ [^\x80-\xff] | 1927 \( # ( 1928 [^\\\x80-\xff\n\015()] * # normal* 1929 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1930 \) # ) 1931 ) # special 1932 [^\\\x80-\xff\n\015()] * # normal* 1933 )* # )* 1934 \) # ) 1935 [\040\t]* )* # If comment found, allow more spaces. 1936 (?: 1937 \. 1938 [\040\t]* # Nab whitespace. 1939 (?: 1940 \( # ( 1941 [^\\\x80-\xff\n\015()] * # normal* 1942 (?: # ( 1943 (?: \\ [^\x80-\xff] | 1944 \( # ( 1945 [^\\\x80-\xff\n\015()] * # normal* 1946 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1947 \) # ) 1948 ) # special 1949 [^\\\x80-\xff\n\015()] * # normal* 1950 )* # )* 1951 \) # ) 1952 [\040\t]* )* # If comment found, allow more spaces. 1953 (?: 1954 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1955 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 1956 # Atom 1957 | # or 1958 " # " 1959 [^\\\x80-\xff\n\015"] * # normal 1960 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* 1961 " # " 1962 # Quoted string 1963 ) 1964 [\040\t]* # Nab whitespace. 1965 (?: 1966 \( # ( 1967 [^\\\x80-\xff\n\015()] * # normal* 1968 (?: # ( 1969 (?: \\ [^\x80-\xff] | 1970 \( # ( 1971 [^\\\x80-\xff\n\015()] * # normal* 1972 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1973 \) # ) 1974 ) # special 1975 [^\\\x80-\xff\n\015()] * # normal* 1976 )* # )* 1977 \) # ) 1978 [\040\t]* )* # If comment found, allow more spaces. 1979 # additional words 1980 )* 1981 @ 1982 [\040\t]* # Nab whitespace. 1983 (?: 1984 \( # ( 1985 [^\\\x80-\xff\n\015()] * # normal* 1986 (?: # ( 1987 (?: \\ [^\x80-\xff] | 1988 \( # ( 1989 [^\\\x80-\xff\n\015()] * # normal* 1990 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 1991 \) # ) 1992 ) # special 1993 [^\\\x80-\xff\n\015()] * # normal* 1994 )* # )* 1995 \) # ) 1996 [\040\t]* )* # If comment found, allow more spaces. 1997 (?: 1998 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 1999 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 2000 | 2001 \[ # [ 2002 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 2003 \] # ] 2004 ) 2005 [\040\t]* # Nab whitespace. 2006 (?: 2007 \( # ( 2008 [^\\\x80-\xff\n\015()] * # normal* 2009 (?: # ( 2010 (?: \\ [^\x80-\xff] | 2011 \( # ( 2012 [^\\\x80-\xff\n\015()] * # normal* 2013 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 2014 \) # ) 2015 ) # special 2016 [^\\\x80-\xff\n\015()] * # normal* 2017 )* # )* 2018 \) # ) 2019 [\040\t]* )* # If comment found, allow more spaces. 2020 # optional trailing comments 2021 (?: 2022 \. 2023 [\040\t]* # Nab whitespace. 2024 (?: 2025 \( # ( 2026 [^\\\x80-\xff\n\015()] * # normal* 2027 (?: # ( 2028 (?: \\ [^\x80-\xff] | 2029 \( # ( 2030 [^\\\x80-\xff\n\015()] * # normal* 2031 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 2032 \) # ) 2033 ) # special 2034 [^\\\x80-\xff\n\015()] * # normal* 2035 )* # )* 2036 \) # ) 2037 [\040\t]* )* # If comment found, allow more spaces. 2038 (?: 2039 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 2040 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 2041 | 2042 \[ # [ 2043 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 2044 \] # ] 2045 ) 2046 [\040\t]* # Nab whitespace. 2047 (?: 2048 \( # ( 2049 [^\\\x80-\xff\n\015()] * # normal* 2050 (?: # ( 2051 (?: \\ [^\x80-\xff] | 2052 \( # ( 2053 [^\\\x80-\xff\n\015()] * # normal* 2054 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 2055 \) # ) 2056 ) # special 2057 [^\\\x80-\xff\n\015()] * # normal* 2058 )* # )* 2059 \) # ) 2060 [\040\t]* )* # If comment found, allow more spaces. 2061 # optional trailing comments 2062 )* 2063 # address 2064 | # or 2065 (?: 2066 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 2067 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 2068 # Atom 2069 | # or 2070 " # " 2071 [^\\\x80-\xff\n\015"] * # normal 2072 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* 2073 " # " 2074 # Quoted string 2075 ) 2076 # leading word 2077 [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces 2078 (?: 2079 (?: 2080 \( # ( 2081 [^\\\x80-\xff\n\015()] * # normal* 2082 (?: # ( 2083 (?: \\ [^\x80-\xff] | 2084 \( # ( 2085 [^\\\x80-\xff\n\015()] * # normal* 2086 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 2087 \) # ) 2088 ) # special 2089 [^\\\x80-\xff\n\015()] * # normal* 2090 )* # )* 2091 \) # ) 2092 | 2093 " # " 2094 [^\\\x80-\xff\n\015"] * # normal 2095 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* 2096 " # " 2097 ) # "special" comment or quoted string 2098 [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal" 2099 )* 2100 < 2101 [\040\t]* # Nab whitespace. 2102 (?: 2103 \( # ( 2104 [^\\\x80-\xff\n\015()] * # normal* 2105 (?: # ( 2106 (?: \\ [^\x80-\xff] | 2107 \( # ( 2108 [^\\\x80-\xff\n\015()] * # normal* 2109 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 2110 \) # ) 2111 ) # special 2112 [^\\\x80-\xff\n\015()] * # normal* 2113 )* # )* 2114 \) # ) 2115 [\040\t]* )* # If comment found, allow more spaces. 2116 # < 2117 (?: 2118 @ 2119 [\040\t]* # Nab whitespace. 2120 (?: 2121 \( # ( 2122 [^\\\x80-\xff\n\015()] * # normal* 2123 (?: # ( 2124 (?: \\ [^\x80-\xff] | 2125 \( # ( 2126 [^\\\x80-\xff\n\015()] * # normal* 2127 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 2128 \) # ) 2129 ) # special 2130 [^\\\x80-\xff\n\015()] * # normal* 2131 )* # )* 2132 \) # ) 2133 [\040\t]* )* # If comment found, allow more spaces. 2134 (?: 2135 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 2136 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 2137 | 2138 \[ # [ 2139 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 2140 \] # ] 2141 ) 2142 [\040\t]* # Nab whitespace. 2143 (?: 2144 \( # ( 2145 [^\\\x80-\xff\n\015()] * # normal* 2146 (?: # ( 2147 (?: \\ [^\x80-\xff] | 2148 \( # ( 2149 [^\\\x80-\xff\n\015()] * # normal* 2150 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 2151 \) # ) 2152 ) # special 2153 [^\\\x80-\xff\n\015()] * # normal* 2154 )* # )* 2155 \) # ) 2156 [\040\t]* )* # If comment found, allow more spaces. 2157 # optional trailing comments 2158 (?: 2159 \. 2160 [\040\t]* # Nab whitespace. 2161 (?: 2162 \( # ( 2163 [^\\\x80-\xff\n\015()] * # normal* 2164 (?: # ( 2165 (?: \\ [^\x80-\xff] | 2166 \( # ( 2167 [^\\\x80-\xff\n\015()] * # normal* 2168 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 2169 \) # ) 2170 ) # special 2171 [^\\\x80-\xff\n\015()] * # normal* 2172 )* # )* 2173 \) # ) 2174 [\040\t]* )* # If comment found, allow more spaces. 2175 (?: 2176 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 2177 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 2178 | 2179 \[ # [ 2180 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 2181 \] # ] 2182 ) 2183 [\040\t]* # Nab whitespace. 2184 (?: 2185 \( # ( 2186 [^\\\x80-\xff\n\015()] * # normal* 2187 (?: # ( 2188 (?: \\ [^\x80-\xff] | 2189 \( # ( 2190 [^\\\x80-\xff\n\015()] * # normal* 2191 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 2192 \) # ) 2193 ) # special 2194 [^\\\x80-\xff\n\015()] * # normal* 2195 )* # )* 2196 \) # ) 2197 [\040\t]* )* # If comment found, allow more spaces. 2198 # optional trailing comments 2199 )* 2200 (?: , 2201 [\040\t]* # Nab whitespace. 2202 (?: 2203 \( # ( 2204 [^\\\x80-\xff\n\015()] * # normal* 2205 (?: # ( 2206 (?: \\ [^\x80-\xff] | 2207 \( # ( 2208 [^\\\x80-\xff\n\015()] * # normal* 2209 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 2210 \) # ) 2211 ) # special 2212 [^\\\x80-\xff\n\015()] * # normal* 2213 )* # )* 2214 \) # ) 2215 [\040\t]* )* # If comment found, allow more spaces. 2216 @ 2217 [\040\t]* # Nab whitespace. 2218 (?: 2219 \( # ( 2220 [^\\\x80-\xff\n\015()] * # normal* 2221 (?: # ( 2222 (?: \\ [^\x80-\xff] | 2223 \( # ( 2224 [^\\\x80-\xff\n\015()] * # normal* 2225 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 2226 \) # ) 2227 ) # special 2228 [^\\\x80-\xff\n\015()] * # normal* 2229 )* # )* 2230 \) # ) 2231 [\040\t]* )* # If comment found, allow more spaces. 2232 (?: 2233 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 2234 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 2235 | 2236 \[ # [ 2237 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 2238 \] # ] 2239 ) 2240 [\040\t]* # Nab whitespace. 2241 (?: 2242 \( # ( 2243 [^\\\x80-\xff\n\015()] * # normal* 2244 (?: # ( 2245 (?: \\ [^\x80-\xff] | 2246 \( # ( 2247 [^\\\x80-\xff\n\015()] * # normal* 2248 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 2249 \) # ) 2250 ) # special 2251 [^\\\x80-\xff\n\015()] * # normal* 2252 )* # )* 2253 \) # ) 2254 [\040\t]* )* # If comment found, allow more spaces. 2255 # optional trailing comments 2256 (?: 2257 \. 2258 [\040\t]* # Nab whitespace. 2259 (?: 2260 \( # ( 2261 [^\\\x80-\xff\n\015()] * # normal* 2262 (?: # ( 2263 (?: \\ [^\x80-\xff] | 2264 \( # ( 2265 [^\\\x80-\xff\n\015()] * # normal* 2266 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 2267 \) # ) 2268 ) # special 2269 [^\\\x80-\xff\n\015()] * # normal* 2270 )* # )* 2271 \) # ) 2272 [\040\t]* )* # If comment found, allow more spaces. 2273 (?: 2274 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 2275 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 2276 | 2277 \[ # [ 2278 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 2279 \] # ] 2280 ) 2281 [\040\t]* # Nab whitespace. 2282 (?: 2283 \( # ( 2284 [^\\\x80-\xff\n\015()] * # normal* 2285 (?: # ( 2286 (?: \\ [^\x80-\xff] | 2287 \( # ( 2288 [^\\\x80-\xff\n\015()] * # normal* 2289 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 2290 \) # ) 2291 ) # special 2292 [^\\\x80-\xff\n\015()] * # normal* 2293 )* # )* 2294 \) # ) 2295 [\040\t]* )* # If comment found, allow more spaces. 2296 # optional trailing comments 2297 )* 2298 )* # additional domains 2299 : 2300 [\040\t]* # Nab whitespace. 2301 (?: 2302 \( # ( 2303 [^\\\x80-\xff\n\015()] * # normal* 2304 (?: # ( 2305 (?: \\ [^\x80-\xff] | 2306 \( # ( 2307 [^\\\x80-\xff\n\015()] * # normal* 2308 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 2309 \) # ) 2310 ) # special 2311 [^\\\x80-\xff\n\015()] * # normal* 2312 )* # )* 2313 \) # ) 2314 [\040\t]* )* # If comment found, allow more spaces. 2315 # optional trailing comments 2316 )? # optional route 2317 (?: 2318 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 2319 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 2320 # Atom 2321 | # or 2322 " # " 2323 [^\\\x80-\xff\n\015"] * # normal 2324 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* 2325 " # " 2326 # Quoted string 2327 ) 2328 [\040\t]* # Nab whitespace. 2329 (?: 2330 \( # ( 2331 [^\\\x80-\xff\n\015()] * # normal* 2332 (?: # ( 2333 (?: \\ [^\x80-\xff] | 2334 \( # ( 2335 [^\\\x80-\xff\n\015()] * # normal* 2336 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 2337 \) # ) 2338 ) # special 2339 [^\\\x80-\xff\n\015()] * # normal* 2340 )* # )* 2341 \) # ) 2342 [\040\t]* )* # If comment found, allow more spaces. 2343 (?: 2344 \. 2345 [\040\t]* # Nab whitespace. 2346 (?: 2347 \( # ( 2348 [^\\\x80-\xff\n\015()] * # normal* 2349 (?: # ( 2350 (?: \\ [^\x80-\xff] | 2351 \( # ( 2352 [^\\\x80-\xff\n\015()] * # normal* 2353 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 2354 \) # ) 2355 ) # special 2356 [^\\\x80-\xff\n\015()] * # normal* 2357 )* # )* 2358 \) # ) 2359 [\040\t]* )* # If comment found, allow more spaces. 2360 (?: 2361 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 2362 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 2363 # Atom 2364 | # or 2365 " # " 2366 [^\\\x80-\xff\n\015"] * # normal 2367 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* 2368 " # " 2369 # Quoted string 2370 ) 2371 [\040\t]* # Nab whitespace. 2372 (?: 2373 \( # ( 2374 [^\\\x80-\xff\n\015()] * # normal* 2375 (?: # ( 2376 (?: \\ [^\x80-\xff] | 2377 \( # ( 2378 [^\\\x80-\xff\n\015()] * # normal* 2379 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 2380 \) # ) 2381 ) # special 2382 [^\\\x80-\xff\n\015()] * # normal* 2383 )* # )* 2384 \) # ) 2385 [\040\t]* )* # If comment found, allow more spaces. 2386 # additional words 2387 )* 2388 @ 2389 [\040\t]* # Nab whitespace. 2390 (?: 2391 \( # ( 2392 [^\\\x80-\xff\n\015()] * # normal* 2393 (?: # ( 2394 (?: \\ [^\x80-\xff] | 2395 \( # ( 2396 [^\\\x80-\xff\n\015()] * # normal* 2397 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 2398 \) # ) 2399 ) # special 2400 [^\\\x80-\xff\n\015()] * # normal* 2401 )* # )* 2402 \) # ) 2403 [\040\t]* )* # If comment found, allow more spaces. 2404 (?: 2405 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 2406 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 2407 | 2408 \[ # [ 2409 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 2410 \] # ] 2411 ) 2412 [\040\t]* # Nab whitespace. 2413 (?: 2414 \( # ( 2415 [^\\\x80-\xff\n\015()] * # normal* 2416 (?: # ( 2417 (?: \\ [^\x80-\xff] | 2418 \( # ( 2419 [^\\\x80-\xff\n\015()] * # normal* 2420 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 2421 \) # ) 2422 ) # special 2423 [^\\\x80-\xff\n\015()] * # normal* 2424 )* # )* 2425 \) # ) 2426 [\040\t]* )* # If comment found, allow more spaces. 2427 # optional trailing comments 2428 (?: 2429 \. 2430 [\040\t]* # Nab whitespace. 2431 (?: 2432 \( # ( 2433 [^\\\x80-\xff\n\015()] * # normal* 2434 (?: # ( 2435 (?: \\ [^\x80-\xff] | 2436 \( # ( 2437 [^\\\x80-\xff\n\015()] * # normal* 2438 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 2439 \) # ) 2440 ) # special 2441 [^\\\x80-\xff\n\015()] * # normal* 2442 )* # )* 2443 \) # ) 2444 [\040\t]* )* # If comment found, allow more spaces. 2445 (?: 2446 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... 2447 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom 2448 | 2449 \[ # [ 2450 (?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff 2451 \] # ] 2452 ) 2453 [\040\t]* # Nab whitespace. 2454 (?: 2455 \( # ( 2456 [^\\\x80-\xff\n\015()] * # normal* 2457 (?: # ( 2458 (?: \\ [^\x80-\xff] | 2459 \( # ( 2460 [^\\\x80-\xff\n\015()] * # normal* 2461 (?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* 2462 \) # ) 2463 ) # special 2464 [^\\\x80-\xff\n\015()] * # normal* 2465 )* # )* 2466 \) # ) 2467 [\040\t]* )* # If comment found, allow more spaces. 2468 # optional trailing comments 2469 )* 2470 # address spec 2471 > # > 2472 # name and address 2473 ) 2474 /x 2475 Alan Other <user\@dom.ain> 2476 0: Alan Other <user (a] dom.ain> 2477 <user\@dom.ain> 2478 0: user (a] dom.ain 2479 1: user@dom 2480 user\@dom.ain 2481 0: user (a] dom.ain 2482 1: user@dom 2483 \"A. Other\" <user.1234\@dom.ain> (a comment) 2484 0: "A. Other" <user.1234 (a] dom.ain> 2485 A. Other <user.1234\@dom.ain> (a comment) 2486 0: Other <user.1234 (a] dom.ain> 2487 \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay 2488 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay 2489 1: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re 2490 A missing angle <user\@some.where 2491 0: user (a] some.where 2492 1: user@some 2493 \= Expect no match 2494 The quick brown fox 2495 No match 2496 2497 /abc\0def\00pqr\000xyz\0000AB/ 2498 abc\0def\00pqr\000xyz\0000AB 2499 0: abc\x00def\x00pqr\x00xyz\x000AB 2500 abc456 abc\0def\00pqr\000xyz\0000ABCDE 2501 0: abc\x00def\x00pqr\x00xyz\x000AB 2502 2503 /abc\x0def\x00pqr\x000xyz\x0000AB/ 2504 abc\x0def\x00pqr\x000xyz\x0000AB 2505 0: abc\x0def\x00pqr\x000xyz\x0000AB 2506 abc456 abc\x0def\x00pqr\x000xyz\x0000ABCDE 2507 0: abc\x0def\x00pqr\x000xyz\x0000AB 2508 2509 /^[\000-\037]/ 2510 \0A 2511 0: \x00 2512 \01B 2513 0: \x01 2514 \037C 2515 0: \x1f 2516 2517 /\0*/ 2518 \0\0\0\0 2519 0: \x00\x00\x00\x00 2520 2521 /A\x0{2,3}Z/ 2522 The A\x0\x0Z 2523 0: A\x00\x00Z 2524 An A\0\x0\0Z 2525 0: A\x00\x00\x00Z 2526 \= Expect no match 2527 A\0Z 2528 No match 2529 A\0\x0\0\x0Z 2530 No match 2531 2532 /^\s/ 2533 \040abc 2534 0: 2535 \x0cabc 2536 0: \x0c 2537 \nabc 2538 0: \x0a 2539 \rabc 2540 0: \x0d 2541 \tabc 2542 0: \x09 2543 \= Expect no match 2544 abc 2545 No match 2546 2547 /^a b 2548 c/x 2550 abc 2551 0: abc 2552 2553 /ab{1,3}bc/ 2554 abbbbc 2555 0: abbbbc 2556 abbbc 2557 0: abbbc 2558 abbc 2559 0: abbc 2560 \= Expect no match 2561 abc 2562 No match 2563 abbbbbc 2564 No match 2565 2566 /([^.]*)\.([^:]*):[T ]+(.*)/ 2567 track1.title:TBlah blah blah 2568 0: track1.title:TBlah blah blah 2569 2570 /([^.]*)\.([^:]*):[T ]+(.*)/i 2571 track1.title:TBlah blah blah 2572 0: track1.title:TBlah blah blah 2573 2574 /([^.]*)\.([^:]*):[t ]+(.*)/i 2575 track1.title:TBlah blah blah 2576 0: track1.title:TBlah blah blah 2577 2578 /^[W-c]+$/ 2579 WXY_^abc 2580 0: WXY_^abc 2581 \= Expect no match 2582 wxy 2583 No match 2584 2585 /^[W-c]+$/i 2586 WXY_^abc 2587 0: WXY_^abc 2588 wxy_^ABC 2589 0: wxy_^ABC 2590 2591 /^[\x3f-\x5F]+$/i 2592 WXY_^abc 2593 0: WXY_^abc 2594 wxy_^ABC 2595 0: wxy_^ABC 2596 2597 /^abc$/m 2598 abc 2599 0: abc 2600 qqq\nabc 2601 0: abc 2602 abc\nzzz 2603 0: abc 2604 qqq\nabc\nzzz 2605 0: abc 2606 2607 /^abc$/ 2608 abc 2609 0: abc 2610 \= Expect no match 2611 qqq\nabc 2612 No match 2613 abc\nzzz 2614 No match 2615 qqq\nabc\nzzz 2616 No match 2617 2618 /\Aabc\Z/m 2619 abc 2620 0: abc 2621 abc\n 2622 0: abc 2623 \= Expect no match 2624 qqq\nabc 2625 No match 2626 abc\nzzz 2627 No match 2628 qqq\nabc\nzzz 2629 No match 2630 2631 /\A(.)*\Z/s 2632 abc\ndef 2633 0: abc\x0adef 2634 2635 /\A(.)*\Z/m 2636 \= Expect no match 2637 abc\ndef 2638 No match 2639 2640 /(?:b)|(?::+)/ 2641 b::c 2642 0: b 2643 c::b 2644 0: :: 2645 2646 /[-az]+/ 2647 az- 2648 0: az- 2649 \= Expect no match 2650 b 2651 No match 2652 2653 /[az-]+/ 2654 za- 2655 0: za- 2656 \= Expect no match 2657 b 2658 No match 2659 2660 /[a\-z]+/ 2661 a-z 2662 0: a-z 2663 \= Expect no match 2664 b 2665 No match 2666 2667 /[a-z]+/ 2668 abcdxyz 2669 0: abcdxyz 2670 2671 /[\d-]+/ 2672 12-34 2673 0: 12-34 2674 \= Expect no match 2675 aaa 2676 No match 2677 2678 /[\d-z]+/ 2679 12-34z 2680 0: 12-34z 2681 \= Expect no match 2682 aaa 2683 No match 2684 2685 /\x5c/ 2686 \\ 2687 0: \ 2688 2689 /\x20Z/ 2690 the Zoo 2691 0: Z 2692 \= Expect no match 2693 Zulu 2694 No match 2695 2696 /ab{3cd/ 2697 ab{3cd 2698 0: ab{3cd 2699 2700 /ab{3,cd/ 2701 ab{3,cd 2702 0: ab{3,cd 2703 2704 /ab{3,4a}cd/ 2705 ab{3,4a}cd 2706 0: ab{3,4a}cd 2707 2708 /{4,5a}bc/ 2709 {4,5a}bc 2710 0: {4,5a}bc 2711 2712 /^a.b/newline=lf 2713 a\rb 2714 0: a\x0db 2715 \= Expect no match 2716 a\nb 2717 No match 2718 2719 /abc$/ 2720 abc 2721 0: abc 2722 abc\n 2723 0: abc 2724 \= Expect no match 2725 abc\ndef 2726 No match 2727 2728 /(abc)\123/ 2729 abc\x53 2730 0: abcS 2731 2732 /(abc)\223/ 2733 abc\x93 2734 0: abc\x93 2735 2736 /(abc)\323/ 2737 abc\xd3 2738 0: abc\xd3 2739 2740 /(abc)\100/ 2741 abc\x40 2742 0: abc@ 2743 abc\100 2744 0: abc@ 2745 2746 /(abc)\1000/ 2747 abc\x400 2748 0: abc@0 2749 abc\x40\x30 2750 0: abc@0 2751 abc\1000 2752 0: abc@0 2753 abc\100\x30 2754 0: abc@0 2755 abc\100\060 2756 0: abc@0 2757 abc\100\60 2758 0: abc@0 2759 2760 /(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\123/ 2761 abcdefghijk\12S 2762 0: abcdefghijk\x0aS 2763 2764 /a{0}bc/ 2765 bc 2766 0: bc 2767 2768 /(a|(bc)){0,0}?xyz/ 2769 xyz 2770 0: xyz 2771 2772 /abc[\10]de/ 2773 abc\010de 2774 0: abc\x08de 2775 2776 /abc[\1]de/ 2777 abc\1de 2778 0: abc\x01de 2779 2780 /(abc)[\1]de/ 2781 abc\1de 2782 0: abc\x01de 2783 2784 /(?s)a.b/ 2785 a\nb 2786 0: a\x0ab 2787 2788 /^([^a])([^\b])([^c]*)([^d]{3,4})/ 2789 baNOTccccd 2790 0: baNOTcccc 2791 1: baNOTccc 2792 2: baNOTcc 2793 3: baNOTc 2794 baNOTcccd 2795 0: baNOTccc 2796 1: baNOTcc 2797 2: baNOTc 2798 baNOTccd 2799 0: baNOTcc 2800 1: baNOTc 2801 bacccd 2802 0: baccc 2803 \= Expect no match 2804 anything 2805 No match 2806 b\bc 2807 No match 2808 baccd 2809 No match 2810 2811 /[^a]/ 2812 Abc 2813 0: A 2814 2815 /[^a]/i 2816 Abc 2817 0: b 2818 2819 /[^a]+/ 2820 AAAaAbc 2821 0: AAA 2822 2823 /[^a]+/i 2824 AAAaAbc 2825 0: bc 2826 2827 /[^a]+/ 2828 bbb\nccc 2829 0: bbb\x0accc 2830 2831 /[^k]$/ 2832 abc 2833 0: c 2834 \= Expect no match 2835 abk 2836 No match 2837 2838 /[^k]{2,3}$/ 2839 abc 2840 0: abc 2841 kbc 2842 0: bc 2843 kabc 2844 0: abc 2845 \= Expect no match 2846 abk 2847 No match 2848 akb 2849 No match 2850 akk 2851 No match 2852 2853 /^\d{8,}\@.+[^k]$/ 2854 12345678\@a.b.c.d 2855 0: 12345678 (a] a.b.c.d 2856 123456789\@x.y.z 2857 0: 123456789 (a] x.y.z 2858 \= Expect no match 2859 12345678\@x.y.uk 2860 No match 2861 1234567\@a.b.c.d 2862 No match 2863 2864 /[^a]/ 2865 aaaabcd 2866 0: b 2867 aaAabcd 2868 0: A 2869 2870 /[^a]/i 2871 aaaabcd 2872 0: b 2873 aaAabcd 2874 0: b 2875 2876 /[^az]/ 2877 aaaabcd 2878 0: b 2879 aaAabcd 2880 0: A 2881 2882 /[^az]/i 2883 aaaabcd 2884 0: b 2885 aaAabcd 2886 0: b 2887 2888 /\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/ 2889 \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 2890 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 2891 2892 /P[^*]TAIRE[^*]{1,6}?LL/ 2893 xxxxxxxxxxxPSTAIREISLLxxxxxxxxx 2894 0: PSTAIREISLL 2895 2896 /P[^*]TAIRE[^*]{1,}?LL/ 2897 xxxxxxxxxxxPSTAIREISLLxxxxxxxxx 2898 0: PSTAIREISLL 2899 2900 /(\.\d\d[1-9]?)\d+/ 2901 1.230003938 2902 0: .230003938 2903 1.875000282 2904 0: .875000282 2905 1.235 2906 0: .235 2907 2908 /(\.\d\d((?=0)|\d(?=\d)))/ 2909 1.230003938 2910 0: .230 2911 1: .23 2912 1.875000282 2913 0: .875 2914 \= Expect no match 2915 1.235 2916 No match 2917 2918 /a(?)b/ 2919 ab 2920 0: ab 2921 2922 /\b(foo)\s+(\w+)/i 2923 Food is on the foo table 2924 0: foo table 2925 2926 /foo(.*)bar/ 2927 The food is under the bar in the barn. 2928 0: food is under the bar in the bar 2929 1: food is under the bar 2930 2931 /foo(.*?)bar/ 2932 The food is under the bar in the barn. 2933 0: food is under the bar in the bar 2934 1: food is under the bar 2935 2936 /(.*)(\d*)/no_auto_possess 2937 I have 2 numbers: 53147 2938 Matched, but offsets vector is too small to show all matches 2939 0: I have 2 numbers: 53147 2940 1: I have 2 numbers: 5314 2941 2: I have 2 numbers: 531 2942 3: I have 2 numbers: 53 2943 4: I have 2 numbers: 5 2944 5: I have 2 numbers: 2945 6: I have 2 numbers: 2946 7: I have 2 numbers 2947 8: I have 2 number 2948 9: I have 2 numbe 2949 10: I have 2 numb 2950 11: I have 2 num 2951 12: I have 2 nu 2952 13: I have 2 n 2953 14: I have 2 2954 2955 /(.*)(\d+)/ 2956 I have 2 numbers: 53147 2957 0: I have 2 numbers: 53147 2958 1: I have 2 2959 2960 /(.*?)(\d*)/no_auto_possess 2961 I have 2 numbers: 53147 2962 Matched, but offsets vector is too small to show all matches 2963 0: I have 2 numbers: 53147 2964 1: I have 2 numbers: 5314 2965 2: I have 2 numbers: 531 2966 3: I have 2 numbers: 53 2967 4: I have 2 numbers: 5 2968 5: I have 2 numbers: 2969 6: I have 2 numbers: 2970 7: I have 2 numbers 2971 8: I have 2 number 2972 9: I have 2 numbe 2973 10: I have 2 numb 2974 11: I have 2 num 2975 12: I have 2 nu 2976 13: I have 2 n 2977 14: I have 2 2978 2979 /(.*?)(\d+)/ 2980 I have 2 numbers: 53147 2981 0: I have 2 numbers: 53147 2982 1: I have 2 2983 2984 /(.*)(\d+)$/ 2985 I have 2 numbers: 53147 2986 0: I have 2 numbers: 53147 2987 2988 /(.*?)(\d+)$/ 2989 I have 2 numbers: 53147 2990 0: I have 2 numbers: 53147 2991 2992 /(.*)\b(\d+)$/ 2993 I have 2 numbers: 53147 2994 0: I have 2 numbers: 53147 2995 2996 /(.*\D)(\d+)$/ 2997 I have 2 numbers: 53147 2998 0: I have 2 numbers: 53147 2999 3000 /^\D*(?!123)/ 3001 ABC123 3002 0: AB 3003 1: A 3004 2: 3005 3006 /^(\D*)(?=\d)(?!123)/ 3007 ABC445 3008 0: ABC 3009 \= Expect no match 3010 ABC123 3011 No match 3012 3013 /^[W-]46]/ 3014 W46]789 3015 0: W46] 3016 -46]789 3017 0: -46] 3018 \= Expect no match 3019 Wall 3020 No match 3021 Zebra 3022 No match 3023 42 3024 No match 3025 [abcd] 3026 No match 3027 ]abcd[ 3028 No match 3029 3030 /^[W-\]46]/ 3031 W46]789 3032 0: W 3033 Wall 3034 0: W 3035 Zebra 3036 0: Z 3037 Xylophone 3038 0: X 3039 42 3040 0: 4 3041 [abcd] 3042 0: [ 3043 ]abcd[ 3044 0: ] 3045 \\backslash 3046 0: \ 3047 \= Expect no match 3048 -46]789 3049 No match 3050 well 3051 No match 3052 3053 /\d\d\/\d\d\/\d\d\d\d/ 3054 01/01/2000 3055 0: 01/01/2000 3056 3057 /word (?:[a-zA-Z0-9]+ ){0,10}otherword/ 3058 word cat dog elephant mussel cow horse canary baboon snake shark otherword 3059 0: word cat dog elephant mussel cow horse canary baboon snake shark otherword 3060 \= Expect no match 3061 word cat dog elephant mussel cow horse canary baboon snake shark 3062 No match 3063 3064 /word (?:[a-zA-Z0-9]+ ){0,300}otherword/ 3065 \= Expect no match 3066 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 3067 No match 3068 3069 /^(a){0,0}/ 3070 bcd 3071 0: 3072 abc 3073 0: 3074 aab 3075 0: 3076 3077 /^(a){0,1}/ 3078 bcd 3079 0: 3080 abc 3081 0: a 3082 1: 3083 aab 3084 0: a 3085 1: 3086 3087 /^(a){0,2}/ 3088 bcd 3089 0: 3090 abc 3091 0: a 3092 1: 3093 aab 3094 0: aa 3095 1: a 3096 2: 3097 3098 /^(a){0,3}/ 3099 bcd 3100 0: 3101 abc 3102 0: a 3103 1: 3104 aab 3105 0: aa 3106 1: a 3107 2: 3108 aaa 3109 0: aaa 3110 1: aa 3111 2: a 3112 3: 3113 3114 /^(a){0,}/ 3115 bcd 3116 0: 3117 abc 3118 0: a 3119 1: 3120 aab 3121 0: aa 3122 1: a 3123 2: 3124 aaa 3125 0: aaa 3126 1: aa 3127 2: a 3128 3: 3129 aaaaaaaa 3130 0: aaaaaaaa 3131 1: aaaaaaa 3132 2: aaaaaa 3133 3: aaaaa 3134 4: aaaa 3135 5: aaa 3136 6: aa 3137 7: a 3138 8: 3139 3140 /^(a){1,1}/ 3141 abc 3142 0: a 3143 aab 3144 0: a 3145 \= Expect no match 3146 bcd 3147 No match 3148 3149 /^(a){1,2}/ 3150 abc 3151 0: a 3152 aab 3153 0: aa 3154 1: a 3155 \= Expect no match 3156 bcd 3157 No match 3158 3159 /^(a){1,3}/ 3160 abc 3161 0: a 3162 aab 3163 0: aa 3164 1: a 3165 aaa 3166 0: aaa 3167 1: aa 3168 2: a 3169 \= Expect no match 3170 bcd 3171 No match 3172 3173 /^(a){1,}/ 3174 abc 3175 0: a 3176 aab 3177 0: aa 3178 1: a 3179 aaa 3180 0: aaa 3181 1: aa 3182 2: a 3183 aaaaaaaa 3184 0: aaaaaaaa 3185 1: aaaaaaa 3186 2: aaaaaa 3187 3: aaaaa 3188 4: aaaa 3189 5: aaa 3190 6: aa 3191 7: a 3192 \= Expect no match 3193 bcd 3194 No match 3195 3196 /.*\.gif/ 3197 borfle\nbib.gif\nno 3198 0: bib.gif 3199 3200 /.{0,}\.gif/ 3201 borfle\nbib.gif\nno 3202 0: bib.gif 3203 3204 /.*\.gif/m 3205 borfle\nbib.gif\nno 3206 0: bib.gif 3207 3208 /.*\.gif/s 3209 borfle\nbib.gif\nno 3210 0: borfle\x0abib.gif 3211 3212 /.*\.gif/ms 3213 borfle\nbib.gif\nno 3214 0: borfle\x0abib.gif 3215 3216 /.*$/ 3217 borfle\nbib.gif\nno 3218 0: no 3219 3220 /.*$/m 3221 borfle\nbib.gif\nno 3222 0: borfle 3223 3224 /.*$/s 3225 borfle\nbib.gif\nno 3226 0: borfle\x0abib.gif\x0ano 3227 3228 /.*$/ms 3229 borfle\nbib.gif\nno 3230 0: borfle\x0abib.gif\x0ano 3231 1: borfle\x0abib.gif 3232 2: borfle 3233 3234 /.*$/ 3235 borfle\nbib.gif\nno\n 3236 0: no 3237 3238 /.*$/m 3239 borfle\nbib.gif\nno\n 3240 0: borfle 3241 3242 /.*$/s 3243 borfle\nbib.gif\nno\n 3244 0: borfle\x0abib.gif\x0ano\x0a 3245 1: borfle\x0abib.gif\x0ano 3246 3247 /.*$/ms 3248 borfle\nbib.gif\nno\n 3249 0: borfle\x0abib.gif\x0ano\x0a 3250 1: borfle\x0abib.gif\x0ano 3251 2: borfle\x0abib.gif 3252 3: borfle 3253 3254 /(.*X|^B)/ 3255 abcde\n1234Xyz 3256 0: 1234X 3257 BarFoo 3258 0: B 3259 \= Expect no match 3260 abcde\nBar 3261 No match 3262 3263 /(.*X|^B)/m 3264 abcde\n1234Xyz 3265 0: 1234X 3266 BarFoo 3267 0: B 3268 abcde\nBar 3269 0: B 3270 3271 /(.*X|^B)/s 3272 abcde\n1234Xyz 3273 0: abcde\x0a1234X 3274 BarFoo 3275 0: B 3276 \= Expect no match 3277 abcde\nBar 3278 No match 3279 3280 /(.*X|^B)/ms 3281 abcde\n1234Xyz 3282 0: abcde\x0a1234X 3283 BarFoo 3284 0: B 3285 abcde\nBar 3286 0: B 3287 3288 /(?s)(.*X|^B)/ 3289 abcde\n1234Xyz 3290 0: abcde\x0a1234X 3291 BarFoo 3292 0: B 3293 \= Expect no match 3294 abcde\nBar 3295 No match 3296 3297 /(?s:.*X|^B)/ 3298 abcde\n1234Xyz 3299 0: abcde\x0a1234X 3300 BarFoo 3301 0: B 3302 \= Expect no match 3303 abcde\nBar 3304 No match 3305 3306 /^.*B/ 3307 \= Expect no match 3308 abc\nB 3309 No match 3310 3311 /(?s)^.*B/ 3312 abc\nB 3313 0: abc\x0aB 3314 3315 /(?m)^.*B/ 3316 abc\nB 3317 0: B 3318 3319 /(?ms)^.*B/ 3320 abc\nB 3321 0: abc\x0aB 3322 3323 /(?ms)^B/ 3324 abc\nB 3325 0: B 3326 3327 /(?s)B$/ 3328 B\n 3329 0: B 3330 3331 /^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/ 3332 123456654321 3333 0: 123456654321 3334 3335 /^\d\d\d\d\d\d\d\d\d\d\d\d/ 3336 123456654321 3337 0: 123456654321 3338 3339 /^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/ 3340 123456654321 3341 0: 123456654321 3342 3343 /^[abc]{12}/ 3344 abcabcabcabc 3345 0: abcabcabcabc 3346 3347 /^[a-c]{12}/ 3348 abcabcabcabc 3349 0: abcabcabcabc 3350 3351 /^(a|b|c){12}/ 3352 abcabcabcabc 3353 0: abcabcabcabc 3354 3355 /^[abcdefghijklmnopqrstuvwxy0123456789]/ 3356 n 3357 0: n 3358 \= Expect no match 3359 z 3360 No match 3361 3362 /abcde{0,0}/ 3363 abcd 3364 0: abcd 3365 \= Expect no match 3366 abce 3367 No match 3368 3369 /ab[cd]{0,0}e/ 3370 abe 3371 0: abe 3372 \= Expect no match 3373 abcde 3374 No match 3375 3376 /ab(c){0,0}d/ 3377 abd 3378 0: abd 3379 \= Expect no match 3380 abcd 3381 No match 3382 3383 /a(b*)/ 3384 a 3385 0: a 3386 ab 3387 0: ab 3388 abbbb 3389 0: abbbb 3390 \= Expect no match 3391 bbbbb 3392 No match 3393 3394 /ab\d{0}e/ 3395 abe 3396 0: abe 3397 \= Expect no match 3398 ab1e 3399 No match 3400 3401 /"([^\\"]+|\\.)*"/ 3402 the \"quick\" brown fox 3403 0: "quick" 3404 \"the \\\"quick\\\" brown fox\" 3405 0: "the \"quick\" brown fox" 3406 3407 /.*?/g,aftertext 3408 abc 3409 0: abc 3410 0+ 3411 1: ab 3412 2: a 3413 3: 3414 0: 3415 0+ 3416 3417 /\b/g,aftertext 3418 abc 3419 0: 3420 0+ abc 3421 0: 3422 0+ 3423 3424 /\b/g,aftertext 3425 abc 3426 0: 3427 0+ abc 3428 0: 3429 0+ 3430 3431 //g 3432 abc 3433 0: 3434 0: 3435 0: 3436 0: 3437 3438 /<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 3439 <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> 3440 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> 3441 3442 /a[^a]b/ 3443 acb 3444 0: acb 3445 a\nb 3446 0: a\x0ab 3447 3448 /a.b/ 3449 acb 3450 0: acb 3451 \= Expect no match 3452 a\nb 3453 No match 3454 3455 /a[^a]b/s 3456 acb 3457 0: acb 3458 a\nb 3459 0: a\x0ab 3460 3461 /a.b/s 3462 acb 3463 0: acb 3464 a\nb 3465 0: a\x0ab 3466 3467 /^(b+?|a){1,2}?c/ 3468 bac 3469 0: bac 3470 bbac 3471 0: bbac 3472 bbbac 3473 0: bbbac 3474 bbbbac 3475 0: bbbbac 3476 bbbbbac 3477 0: bbbbbac 3478 3479 /^(b+|a){1,2}?c/ 3480 bac 3481 0: bac 3482 bbac 3483 0: bbac 3484 bbbac 3485 0: bbbac 3486 bbbbac 3487 0: bbbbac 3488 bbbbbac 3489 0: bbbbbac 3490 3491 /(?!\A)x/m 3492 a\bx\n 3493 0: x 3494 \= Expect no match 3495 x\nb\n 3496 No match 3497 3498 /\x0{ab}/ 3499 \0{ab} 3500 0: \x00{ab} 3501 3502 /(A|B)*?CD/ 3503 CD 3504 0: CD 3505 3506 /(A|B)*CD/ 3507 CD 3508 0: CD 3509 3510 /(?<!bar)foo/ 3511 foo 3512 0: foo 3513 catfood 3514 0: foo 3515 arfootle 3516 0: foo 3517 rfoosh 3518 0: foo 3519 \= Expect no match 3520 barfoo 3521 No match 3522 towbarfoo 3523 No match 3524 3525 /\w{3}(?<!bar)foo/ 3526 catfood 3527 0: catfoo 3528 \= Expect no match 3529 foo 3530 No match 3531 barfoo 3532 No match 3533 towbarfoo 3534 No match 3535 3536 /(?<=(foo)a)bar/ 3537 fooabar 3538 0: bar 3539 \= Expect no match 3540 bar 3541 No match 3542 foobbar 3543 No match 3544 3545 /\Aabc\z/m 3546 abc 3547 0: abc 3548 \= Expect no match 3549 abc\n 3550 No match 3551 qqq\nabc 3552 No match 3553 abc\nzzz 3554 No match 3555 qqq\nabc\nzzz 3556 No match 3557 3558 "(?>.*/)foo" 3559 \= Expect no match 3560 /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/ 3561 No match 3562 3563 "(?>.*/)foo" 3564 /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo 3565 0: /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo 3566 3567 /(?>(\.\d\d[1-9]?))\d+/ 3568 1.230003938 3569 0: .230003938 3570 1.875000282 3571 0: .875000282 3572 \= Expect no match 3573 1.235 3574 No match 3575 3576 /^((?>\w+)|(?>\s+))*$/ 3577 now is the time for all good men to come to the aid of the party 3578 0: now is the time for all good men to come to the aid of the party 3579 \= Expect no match 3580 this is not a line with only words and spaces! 3581 No match 3582 3583 /(\d+)(\w)/ 3584 12345a 3585 0: 12345a 3586 1: 12345 3587 2: 1234 3588 3: 123 3589 4: 12 3590 12345+ 3591 0: 12345 3592 1: 1234 3593 2: 123 3594 3: 12 3595 3596 /((?>\d+))(\w)/ 3597 12345a 3598 0: 12345a 3599 \= Expect no match 3600 12345+ 3601 No match 3602 3603 /(?>a+)b/ 3604 aaab 3605 0: aaab 3606 3607 /((?>a+)b)/ 3608 aaab 3609 0: aaab 3610 3611 /(?>(a+))b/ 3612 aaab 3613 0: aaab 3614 3615 /(?>b)+/ 3616 aaabbbccc 3617 0: bbb 3618 1: bb 3619 2: b 3620 3621 /(?>a+|b+|c+)*c/ 3622 aaabbbbccccd 3623 0: aaabbbbcccc 3624 1: aaabbbbc 3625 3626 /(a+|b+|c+)*c/ 3627 aaabbbbccccd 3628 0: aaabbbbcccc 3629 1: aaabbbbccc 3630 2: aaabbbbcc 3631 3: aaabbbbc 3632 3633 /((?>[^()]+)|\([^()]*\))+/ 3634 ((abc(ade)ufh()()x 3635 0: abc(ade)ufh()()x 3636 1: abc(ade)ufh()() 3637 2: abc(ade)ufh() 3638 3: abc(ade)ufh 3639 4: abc(ade) 3640 5: abc 3641 3642 /\(((?>[^()]+)|\([^()]+\))+\)/ 3643 (abc) 3644 0: (abc) 3645 (abc(def)xyz) 3646 0: (abc(def)xyz) 3647 \= Expect no match 3648 ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 3649 No match 3650 3651 /a(?-i)b/i 3652 ab 3653 0: ab 3654 Ab 3655 0: Ab 3656 \= Expect no match 3657 aB 3658 No match 3659 AB 3660 No match 3661 3662 /(a (?x)b c)d e/ 3663 a bcd e 3664 0: a bcd e 3665 \= Expect no match 3666 a b cd e 3667 No match 3668 abcd e 3669 No match 3670 a bcde 3671 No match 3672 3673 /(a b(?x)c d (?-x)e f)/ 3674 a bcde f 3675 0: a bcde f 3676 \= Expect no match 3677 abcdef 3678 No match 3679 3680 /(a(?i)b)c/ 3681 abc 3682 0: abc 3683 aBc 3684 0: aBc 3685 \= Expect no match 3686 abC 3687 No match 3688 aBC 3689 No match 3690 Abc 3691 No match 3692 ABc 3693 No match 3694 ABC 3695 No match 3696 AbC 3697 No match 3698 3699 /a(?i:b)c/ 3700 abc 3701 0: abc 3702 aBc 3703 0: aBc 3704 \= Expect no match 3705 ABC 3706 No match 3707 abC 3708 No match 3709 aBC 3710 No match 3711 3712 /a(?i:b)*c/ 3713 aBc 3714 0: aBc 3715 aBBc 3716 0: aBBc 3717 \= Expect no match 3718 aBC 3719 No match 3720 aBBC 3721 No match 3722 3723 /a(?=b(?i)c)\w\wd/ 3724 abcd 3725 0: abcd 3726 abCd 3727 0: abCd 3728 \= Expect no match 3729 aBCd 3730 No match 3731 abcD 3732 No match 3733 3734 /(?s-i:more.*than).*million/i 3735 more than million 3736 0: more than million 3737 more than MILLION 3738 0: more than MILLION 3739 more \n than Million 3740 0: more \x0a than Million 3741 \= Expect no match 3742 MORE THAN MILLION 3743 No match 3744 more \n than \n million 3745 No match 3746 3747 /(?:(?s-i)more.*than).*million/i 3748 more than million 3749 0: more than million 3750 more than MILLION 3751 0: more than MILLION 3752 more \n than Million 3753 0: more \x0a than Million 3754 \= Expect no match 3755 MORE THAN MILLION 3756 No match 3757 more \n than \n million 3758 No match 3759 3760 /(?>a(?i)b+)+c/ 3761 abc 3762 0: abc 3763 aBbc 3764 0: aBbc 3765 aBBc 3766 0: aBBc 3767 \= Expect no match 3768 Abc 3769 No match 3770 abAb 3771 No match 3772 abbC 3773 No match 3774 3775 /(?=a(?i)b)\w\wc/ 3776 abc 3777 0: abc 3778 aBc 3779 0: aBc 3780 \= Expect no match 3781 Ab 3782 No match 3783 abC 3784 No match 3785 aBC 3786 No match 3787 3788 /(?<=a(?i)b)(\w\w)c/ 3789 abxxc 3790 0: xxc 3791 aBxxc 3792 0: xxc 3793 \= Expect no match 3794 Abxxc 3795 No match 3796 ABxxc 3797 No match 3798 abxxC 3799 No match 3800 3801 /^(?(?=abc)\w{3}:|\d\d)$/ 3802 abc: 3803 0: abc: 3804 12 3805 0: 12 3806 \= Expect no match 3807 123 3808 No match 3809 xyz 3810 No match 3811 3812 /^(?(?!abc)\d\d|\w{3}:)$/ 3813 abc: 3814 0: abc: 3815 12 3816 0: 12 3817 \= Expect no match 3818 123 3819 No match 3820 xyz 3821 No match 3822 3823 /(?(?<=foo)bar|cat)/ 3824 foobar 3825 0: bar 3826 cat 3827 0: cat 3828 fcat 3829 0: cat 3830 focat 3831 0: cat 3832 \= Expect no match 3833 foocat 3834 No match 3835 3836 /(?(?<!foo)cat|bar)/ 3837 foobar 3838 0: bar 3839 cat 3840 0: cat 3841 fcat 3842 0: cat 3843 focat 3844 0: cat 3845 \= Expect no match 3846 foocat 3847 No match 3848 3849 /(?>a*)*/ 3850 a 3851 0: a 3852 1: 3853 aa 3854 0: aa 3855 1: 3856 aaaa 3857 0: aaaa 3858 1: 3859 3860 /(abc|)+/ 3861 abc 3862 0: abc 3863 1: 3864 abcabc 3865 0: abcabc 3866 1: abc 3867 2: 3868 abcabcabc 3869 0: abcabcabc 3870 1: abcabc 3871 2: abc 3872 3: 3873 xyz 3874 0: 3875 3876 /([a]*)*/ 3877 a 3878 0: a 3879 1: 3880 aaaaa 3881 0: aaaaa 3882 1: aaaa 3883 2: aaa 3884 3: aa 3885 4: a 3886 5: 3887 3888 /([ab]*)*/ 3889 a 3890 0: a 3891 1: 3892 b 3893 0: b 3894 1: 3895 ababab 3896 0: ababab 3897 1: ababa 3898 2: abab 3899 3: aba 3900 4: ab 3901 5: a 3902 6: 3903 aaaabcde 3904 0: aaaab 3905 1: aaaa 3906 2: aaa 3907 3: aa 3908 4: a 3909 5: 3910 bbbb 3911 0: bbbb 3912 1: bbb 3913 2: bb 3914 3: b 3915 4: 3916 3917 /([^a]*)*/ 3918 b 3919 0: b 3920 1: 3921 bbbb 3922 0: bbbb 3923 1: bbb 3924 2: bb 3925 3: b 3926 4: 3927 aaa 3928 0: 3929 3930 /([^ab]*)*/ 3931 cccc 3932 0: cccc 3933 1: ccc 3934 2: cc 3935 3: c 3936 4: 3937 abab 3938 0: 3939 3940 /([a]*?)*/ 3941 a 3942 0: a 3943 1: 3944 aaaa 3945 0: aaaa 3946 1: aaa 3947 2: aa 3948 3: a 3949 4: 3950 3951 /([ab]*?)*/ 3952 a 3953 0: a 3954 1: 3955 b 3956 0: b 3957 1: 3958 abab 3959 0: abab 3960 1: aba 3961 2: ab 3962 3: a 3963 4: 3964 baba 3965 0: baba 3966 1: bab 3967 2: ba 3968 3: b 3969 4: 3970 3971 /([^a]*?)*/ 3972 b 3973 0: b 3974 1: 3975 bbbb 3976 0: bbbb 3977 1: bbb 3978 2: bb 3979 3: b 3980 4: 3981 aaa 3982 0: 3983 3984 /([^ab]*?)*/ 3985 c 3986 0: c 3987 1: 3988 cccc 3989 0: cccc 3990 1: ccc 3991 2: cc 3992 3: c 3993 4: 3994 baba 3995 0: 3996 3997 /(?>a*)*/ 3998 a 3999 0: a 4000 1: 4001 aaabcde 4002 0: aaa 4003 1: 4004 4005 /((?>a*))*/ 4006 aaaaa 4007 0: aaaaa 4008 1: 4009 aabbaa 4010 0: aa 4011 1: 4012 4013 /((?>a*?))*/ 4014 aaaaa 4015 0: aaaaa 4016 1: 4017 aabbaa 4018 0: aa 4019 1: 4020 4021 /(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x 4022 12-sep-98 4023 0: 12-sep-98 4024 12-09-98 4025 0: 12-09-98 4026 \= Expect no match 4027 sep-12-98 4028 No match 4029 4030 /(?i:saturday|sunday)/ 4031 saturday 4032 0: saturday 4033 sunday 4034 0: sunday 4035 Saturday 4036 0: Saturday 4037 Sunday 4038 0: Sunday 4039 SATURDAY 4040 0: SATURDAY 4041 SUNDAY 4042 0: SUNDAY 4043 SunDay 4044 0: SunDay 4045 4046 /(a(?i)bc|BB)x/ 4047 abcx 4048 0: abcx 4049 aBCx 4050 0: aBCx 4051 bbx 4052 0: bbx 4053 BBx 4054 0: BBx 4055 \= Expect no match 4056 abcX 4057 No match 4058 aBCX 4059 No match 4060 bbX 4061 No match 4062 BBX 4063 No match 4064 4065 /^([ab](?i)[cd]|[ef])/ 4066 ac 4067 0: ac 4068 aC 4069 0: aC 4070 bD 4071 0: bD 4072 elephant 4073 0: e 4074 Europe 4075 0: E 4076 frog 4077 0: f 4078 France 4079 0: F 4080 \= Expect no match 4081 Africa 4082 No match 4083 4084 /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/ 4085 ab 4086 0: ab 4087 aBd 4088 0: aBd 4089 xy 4090 0: xy 4091 xY 4092 0: xY 4093 zebra 4094 0: z 4095 Zambesi 4096 0: Z 4097 \= Expect no match 4098 aCD 4099 No match 4100 XY 4101 No match 4102 4103 /(?<=foo\n)^bar/m 4104 foo\nbar 4105 0: bar 4106 \= Expect no match 4107 bar 4108 No match 4109 baz\nbar 4110 No match 4111 4112 /(?<=(?<!foo)bar)baz/ 4113 barbaz 4114 0: baz 4115 barbarbaz 4116 0: baz 4117 koobarbaz 4118 0: baz 4119 \= Expect no match 4120 baz 4121 No match 4122 foobarbaz 4123 No match 4124 4125 # The following tests are taken from the Perl 5.005 test suite; some of them 4126 # are compatible with 5.004, but I'd rather not have to sort them out. 4127 4128 /abc/ 4129 abc 4130 0: abc 4131 xabcy 4132 0: abc 4133 ababc 4134 0: abc 4135 \= Expect no match 4136 xbc 4137 No match 4138 axc 4139 No match 4140 abx 4141 No match 4142 4143 /ab*c/ 4144 abc 4145 0: abc 4146 4147 /ab*bc/ 4148 abc 4149 0: abc 4150 abbc 4151 0: abbc 4152 abbbbc 4153 0: abbbbc 4154 4155 /.{1}/ 4156 abbbbc 4157 0: a 4158 4159 /.{3,4}/ 4160 abbbbc 4161 0: abbb 4162 4163 /ab{0,}bc/ 4164 abbbbc 4165 0: abbbbc 4166 4167 /ab+bc/ 4168 abbc 4169 0: abbc 4170 \= Expect no match 4171 abc 4172 No match 4173 abq 4174 No match 4175 4176 /ab+bc/ 4177 abbbbc 4178 0: abbbbc 4179 4180 /ab{1,}bc/ 4181 abbbbc 4182 0: abbbbc 4183 4184 /ab{1,3}bc/ 4185 abbbbc 4186 0: abbbbc 4187 4188 /ab{3,4}bc/ 4189 abbbbc 4190 0: abbbbc 4191 4192 /ab{4,5}bc/ 4193 \= Expect no match 4194 abq 4195 No match 4196 abbbbc 4197 No match 4198 4199 /ab?bc/ 4200 abbc 4201 0: abbc 4202 abc 4203 0: abc 4204 4205 /ab{0,1}bc/ 4206 abc 4207 0: abc 4208 4209 /ab?bc/ 4210 4211 /ab?c/ 4212 abc 4213 0: abc 4214 4215 /ab{0,1}c/ 4216 abc 4217 0: abc 4218 4219 /^abc$/ 4220 abc 4221 0: abc 4222 \= Expect no match 4223 abbbbc 4224 No match 4225 abcc 4226 No match 4227 4228 /^abc/ 4229 abcc 4230 0: abc 4231 4232 /^abc$/ 4233 4234 /abc$/ 4235 aabc 4236 0: abc 4237 aabc 4238 0: abc 4239 \= Expect no match 4240 aabcd 4241 No match 4242 4243 /^/ 4244 abc 4245 0: 4246 4247 /$/ 4248 abc 4249 0: 4250 4251 /a.c/ 4252 abc 4253 0: abc 4254 axc 4255 0: axc 4256 4257 /a.*c/ 4258 axyzc 4259 0: axyzc 4260 4261 /a[bc]d/ 4262 abd 4263 0: abd 4264 \= Expect no match 4265 axyzd 4266 No match 4267 abc 4268 No match 4269 4270 /a[b-d]e/ 4271 ace 4272 0: ace 4273 4274 /a[b-d]/ 4275 aac 4276 0: ac 4277 4278 /a[-b]/ 4279 a- 4280 0: a- 4281 4282 /a[b-]/ 4283 a- 4284 0: a- 4285 4286 /a]/ 4287 a] 4288 0: a] 4289 4290 /a[]]b/ 4291 a]b 4292 0: a]b 4293 4294 /a[^bc]d/ 4295 aed 4296 0: aed 4297 \= Expect no match 4298 abd 4299 No match 4300 abd 4301 No match 4302 4303 /a[^-b]c/ 4304 adc 4305 0: adc 4306 4307 /a[^]b]c/ 4308 adc 4309 0: adc 4310 a-c 4311 0: a-c 4312 \= Expect no match 4313 a]c 4314 No match 4315 4316 /\ba\b/ 4317 a- 4318 0: a 4319 -a 4320 0: a 4321 -a- 4322 0: a 4323 4324 /\by\b/ 4325 \= Expect no match 4326 xy 4327 No match 4328 yz 4329 No match 4330 xyz 4331 No match 4332 4333 /\Ba\B/ 4334 \= Expect no match 4335 a- 4336 No match 4337 -a 4338 No match 4339 -a- 4340 No match 4341 4342 /\By\b/ 4343 xy 4344 0: y 4345 4346 /\by\B/ 4347 yz 4348 0: y 4349 4350 /\By\B/ 4351 xyz 4352 0: y 4353 4354 /\w/ 4355 a 4356 0: a 4357 4358 /\W/ 4359 - 4360 0: - 4361 \= Expect no match 4362 a 4363 No match 4364 4365 /a\sb/ 4366 a b 4367 0: a b 4368 4369 /a\Sb/ 4370 a-b 4371 0: a-b 4372 \= Expect no match 4373 a b 4374 No match 4375 4376 /\d/ 4377 1 4378 0: 1 4379 4380 /\D/ 4381 - 4382 0: - 4383 \= Expect no match 4384 1 4385 No match 4386 4387 /[\w]/ 4388 a 4389 0: a 4390 4391 /[\W]/ 4392 - 4393 0: - 4394 \= Expect no match 4395 a 4396 No match 4397 4398 /a[\s]b/ 4399 a b 4400 0: a b 4401 4402 /a[\S]b/ 4403 a-b 4404 0: a-b 4405 \= Expect no match 4406 a b 4407 No match 4408 4409 /[\d]/ 4410 1 4411 0: 1 4412 4413 /[\D]/ 4414 - 4415 0: - 4416 \= Expect no match 4417 1 4418 No match 4419 4420 /ab|cd/ 4421 abc 4422 0: ab 4423 abcd 4424 0: ab 4425 4426 /()ef/ 4427 def 4428 0: ef 4429 4430 /$b/ 4431 4432 /a\(b/ 4433 a(b 4434 0: a(b 4435 4436 /a\(*b/ 4437 ab 4438 0: ab 4439 a((b 4440 0: a((b 4441 4442 /a\\b/ 4443 a\\b 4444 0: a\b 4445 \= Expect no match 4446 a\b 4447 No match 4448 4449 /((a))/ 4450 abc 4451 0: a 4452 4453 /(a)b(c)/ 4454 abc 4455 0: abc 4456 4457 /a+b+c/ 4458 aabbabc 4459 0: abc 4460 4461 /a{1,}b{1,}c/ 4462 aabbabc 4463 0: abc 4464 4465 /a.+?c/ 4466 abcabc 4467 0: abcabc 4468 1: abc 4469 4470 /(a+|b)*/ 4471 ab 4472 0: ab 4473 1: a 4474 2: 4475 4476 /(a+|b){0,}/ 4477 ab 4478 0: ab 4479 1: a 4480 2: 4481 4482 /(a+|b)+/ 4483 ab 4484 0: ab 4485 1: a 4486 4487 /(a+|b){1,}/ 4488 ab 4489 0: ab 4490 1: a 4491 4492 /(a+|b)?/ 4493 ab 4494 0: a 4495 1: 4496 4497 /(a+|b){0,1}/ 4498 ab 4499 0: a 4500 1: 4501 4502 /[^ab]*/ 4503 cde 4504 0: cde 4505 4506 /abc/ 4507 \= Expect no match 4508 b 4509 No match 4510 4511 /a*/ 4512 4513 /([abc])*d/ 4514 abbbcd 4515 0: abbbcd 4516 4517 /([abc])*bcd/ 4518 abcd 4519 0: abcd 4520 4521 /a|b|c|d|e/ 4522 e 4523 0: e 4524 4525 /(a|b|c|d|e)f/ 4526 ef 4527 0: ef 4528 4529 /abcd*efg/ 4530 abcdefg 4531 0: abcdefg 4532 4533 /ab*/ 4534 xabyabbbz 4535 0: ab 4536 xayabbbz 4537 0: a 4538 4539 /(ab|cd)e/ 4540 abcde 4541 0: cde 4542 4543 /[abhgefdc]ij/ 4544 hij 4545 0: hij 4546 4547 /^(ab|cd)e/ 4548 4549 /(abc|)ef/ 4550 abcdef 4551 0: ef 4552 4553 /(a|b)c*d/ 4554 abcd 4555 0: bcd 4556 4557 /(ab|ab*)bc/ 4558 abc 4559 0: abc 4560 4561 /a([bc]*)c*/ 4562 abc 4563 0: abc 4564 1: a 4565 4566 /a([bc]*)(c*d)/ 4567 abcd 4568 0: abcd 4569 4570 /a([bc]+)(c*d)/ 4571 abcd 4572 0: abcd 4573 4574 /a([bc]*)(c+d)/ 4575 abcd 4576 0: abcd 4577 4578 /a[bcd]*dcdcde/ 4579 adcdcde 4580 0: adcdcde 4581 4582 /a[bcd]+dcdcde/ 4583 \= Expect no match 4584 abcde 4585 No match 4586 adcdcde 4587 No match 4588 4589 /(ab|a)b*c/ 4590 abc 4591 0: abc 4592 4593 /((a)(b)c)(d)/ 4594 abcd 4595 0: abcd 4596 4597 /[a-zA-Z_][a-zA-Z0-9_]*/ 4598 alpha 4599 0: alpha 4600 4601 /^a(bc+|b[eh])g|.h$/ 4602 abh 4603 0: bh 4604 4605 /(bc+d$|ef*g.|h?i(j|k))/ 4606 effgz 4607 0: effgz 4608 ij 4609 0: ij 4610 reffgz 4611 0: effgz 4612 \= Expect no match 4613 effg 4614 No match 4615 bcdd 4616 No match 4617 4618 /((((((((((a))))))))))/ 4619 a 4620 0: a 4621 4622 /(((((((((a)))))))))/ 4623 a 4624 0: a 4625 4626 /multiple words of text/ 4627 \= Expect no match 4628 aa 4629 No match 4630 uh-uh 4631 No match 4632 4633 /multiple words/ 4634 multiple words, yeah 4635 0: multiple words 4636 4637 /(.*)c(.*)/ 4638 abcde 4639 0: abcde 4640 4641 /\((.*), (.*)\)/ 4642 (a, b) 4643 0: (a, b) 4644 4645 /[k]/ 4646 4647 /abcd/ 4648 abcd 4649 0: abcd 4650 4651 /a(bc)d/ 4652 abcd 4653 0: abcd 4654 4655 /a[-]?c/ 4656 ac 4657 0: ac 4658 4659 /abc/i 4660 ABC 4661 0: ABC 4662 XABCY 4663 0: ABC 4664 ABABC 4665 0: ABC 4666 \= Expect no match 4667 aaxabxbaxbbx 4668 No match 4669 XBC 4670 No match 4671 AXC 4672 No match 4673 ABX 4674 No match 4675 4676 /ab*c/i 4677 ABC 4678 0: ABC 4679 4680 /ab*bc/i 4681 ABC 4682 0: ABC 4683 ABBC 4684 0: ABBC 4685 4686 /ab*?bc/i 4687 ABBBBC 4688 0: ABBBBC 4689 4690 /ab{0,}?bc/i 4691 ABBBBC 4692 0: ABBBBC 4693 4694 /ab+?bc/i 4695 ABBC 4696 0: ABBC 4697 4698 /ab+bc/i 4699 \= Expect no match 4700 ABC 4701 No match 4702 ABQ 4703 No match 4704 4705 /ab{1,}bc/i 4706 4707 /ab+bc/i 4708 ABBBBC 4709 0: ABBBBC 4710 4711 /ab{1,}?bc/i 4712 ABBBBC 4713 0: ABBBBC 4714 4715 /ab{1,3}?bc/i 4716 ABBBBC 4717 0: ABBBBC 4718 4719 /ab{3,4}?bc/i 4720 ABBBBC 4721 0: ABBBBC 4722 4723 /ab{4,5}?bc/i 4724 \= Expect no match 4725 ABQ 4726 No match 4727 ABBBBC 4728 No match 4729 4730 /ab??bc/i 4731 ABBC 4732 0: ABBC 4733 ABC 4734 0: ABC 4735 4736 /ab{0,1}?bc/i 4737 ABC 4738 0: ABC 4739 4740 /ab??bc/i 4741 4742 /ab??c/i 4743 ABC 4744 0: ABC 4745 4746 /ab{0,1}?c/i 4747 ABC 4748 0: ABC 4749 4750 /^abc$/i 4751 ABC 4752 0: ABC 4753 \= Expect no match 4754 ABBBBC 4755 No match 4756 ABCC 4757 No match 4758 4759 /^abc/i 4760 ABCC 4761 0: ABC 4762 4763 /^abc$/i 4764 4765 /abc$/i 4766 AABC 4767 0: ABC 4768 4769 /^/i 4770 ABC 4771 0: 4772 4773 /$/i 4774 ABC 4775 0: 4776 4777 /a.c/i 4778 ABC 4779 0: ABC 4780 AXC 4781 0: AXC 4782 4783 /a.*?c/i 4784 AXYZC 4785 0: AXYZC 4786 4787 /a.*c/i 4788 AABC 4789 0: AABC 4790 \= Expect no match 4791 AXYZD 4792 No match 4793 4794 /a[bc]d/i 4795 ABD 4796 0: ABD 4797 4798 /a[b-d]e/i 4799 ACE 4800 0: ACE 4801 \= Expect no match 4802 ABC 4803 No match 4804 ABD 4805 No match 4806 4807 /a[b-d]/i 4808 AAC 4809 0: AC 4810 4811 /a[-b]/i 4812 A- 4813 0: A- 4814 4815 /a[b-]/i 4816 A- 4817 0: A- 4818 4819 /a]/i 4820 A] 4821 0: A] 4822 4823 /a[]]b/i 4824 A]B 4825 0: A]B 4826 4827 /a[^bc]d/i 4828 AED 4829 0: AED 4830 4831 /a[^-b]c/i 4832 ADC 4833 0: ADC 4834 \= Expect no match 4835 ABD 4836 No match 4837 A-C 4838 No match 4839 4840 /a[^]b]c/i 4841 ADC 4842 0: ADC 4843 4844 /ab|cd/i 4845 ABC 4846 0: AB 4847 ABCD 4848 0: AB 4849 4850 /()ef/i 4851 DEF 4852 0: EF 4853 4854 /$b/i 4855 \= Expect no match 4856 A]C 4857 No match 4858 B 4859 No match 4860 4861 /a\(b/i 4862 A(B 4863 0: A(B 4864 4865 /a\(*b/i 4866 AB 4867 0: AB 4868 A((B 4869 0: A((B 4870 4871 /a\\b/i 4872 \= Expect no match 4873 A\=notbol 4874 No match 4875 4876 /((a))/i 4877 ABC 4878 0: A 4879 4880 /(a)b(c)/i 4881 ABC 4882 0: ABC 4883 4884 /a+b+c/i 4885 AABBABC 4886 0: ABC 4887 4888 /a{1,}b{1,}c/i 4889 AABBABC 4890 0: ABC 4891 4892 /a.+?c/i 4893 ABCABC 4894 0: ABCABC 4895 1: ABC 4896 4897 /a.*?c/i 4898 ABCABC 4899 0: ABCABC 4900 1: ABC 4901 4902 /a.{0,5}?c/i 4903 ABCABC 4904 0: ABCABC 4905 1: ABC 4906 4907 /(a+|b)*/i 4908 AB 4909 0: AB 4910 1: A 4911 2: 4912 4913 /(a+|b){0,}/i 4914 AB 4915 0: AB 4916 1: A 4917 2: 4918 4919 /(a+|b)+/i 4920 AB 4921 0: AB 4922 1: A 4923 4924 /(a+|b){1,}/i 4925 AB 4926 0: AB 4927 1: A 4928 4929 /(a+|b)?/i 4930 AB 4931 0: A 4932 1: 4933 4934 /(a+|b){0,1}/i 4935 AB 4936 0: A 4937 1: 4938 4939 /(a+|b){0,1}?/i 4940 AB 4941 0: A 4942 1: 4943 4944 /[^ab]*/i 4945 CDE 4946 0: CDE 4947 4948 /abc/i 4949 4950 /a*/i 4951 4952 /([abc])*d/i 4953 ABBBCD 4954 0: ABBBCD 4955 4956 /([abc])*bcd/i 4957 ABCD 4958 0: ABCD 4959 4960 /a|b|c|d|e/i 4961 E 4962 0: E 4963 4964 /(a|b|c|d|e)f/i 4965 EF 4966 0: EF 4967 4968 /abcd*efg/i 4969 ABCDEFG 4970 0: ABCDEFG 4971 4972 /ab*/i 4973 XABYABBBZ 4974 0: AB 4975 XAYABBBZ 4976 0: A 4977 4978 /(ab|cd)e/i 4979 ABCDE 4980 0: CDE 4981 4982 /[abhgefdc]ij/i 4983 HIJ 4984 0: HIJ 4985 4986 /^(ab|cd)e/i 4987 \= Expect no match 4988 ABCDE 4989 No match 4990 4991 /(abc|)ef/i 4992 ABCDEF 4993 0: EF 4994 4995 /(a|b)c*d/i 4996 ABCD 4997 0: BCD 4998 4999 /(ab|ab*)bc/i 5000 ABC 5001 0: ABC 5002 5003 /a([bc]*)c*/i 5004 ABC 5005 0: ABC 5006 1: A 5007 5008 /a([bc]*)(c*d)/i 5009 ABCD 5010 0: ABCD 5011 5012 /a([bc]+)(c*d)/i 5013 ABCD 5014 0: ABCD 5015 5016 /a([bc]*)(c+d)/i 5017 ABCD 5018 0: ABCD 5019 5020 /a[bcd]*dcdcde/i 5021 ADCDCDE 5022 0: ADCDCDE 5023 5024 /a[bcd]+dcdcde/i 5025 5026 /(ab|a)b*c/i 5027 ABC 5028 0: ABC 5029 5030 /((a)(b)c)(d)/i 5031 ABCD 5032 0: ABCD 5033 5034 /[a-zA-Z_][a-zA-Z0-9_]*/i 5035 ALPHA 5036 0: ALPHA 5037 5038 /^a(bc+|b[eh])g|.h$/i 5039 ABH 5040 0: BH 5041 5042 /(bc+d$|ef*g.|h?i(j|k))/i 5043 EFFGZ 5044 0: EFFGZ 5045 IJ 5046 0: IJ 5047 REFFGZ 5048 0: EFFGZ 5049 \= Expect no match 5050 ADCDCDE 5051 No match 5052 EFFG 5053 No match 5054 BCDD 5055 No match 5056 5057 /((((((((((a))))))))))/i 5058 A 5059 0: A 5060 5061 /(((((((((a)))))))))/i 5062 A 5063 0: A 5064 5065 /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))/i 5066 A 5067 0: A 5068 5069 /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/i 5070 C 5071 0: C 5072 5073 /multiple words of text/i 5074 \= Expect no match 5075 AA 5076 No match 5077 UH-UH 5078 No match 5079 5080 /multiple words/i 5081 MULTIPLE WORDS, YEAH 5082 0: MULTIPLE WORDS 5083 5084 /(.*)c(.*)/i 5085 ABCDE 5086 0: ABCDE 5087 5088 /\((.*), (.*)\)/i 5089 (A, B) 5090 0: (A, B) 5091 5092 /[k]/i 5093 5094 /abcd/i 5095 ABCD 5096 0: ABCD 5097 5098 /a(bc)d/i 5099 ABCD 5100 0: ABCD 5101 5102 /a[-]?c/i 5103 AC 5104 0: AC 5105 5106 /a(?!b)./ 5107 abad 5108 0: ad 5109 5110 /a(?=d)./ 5111 abad 5112 0: ad 5113 5114 /a(?=c|d)./ 5115 abad 5116 0: ad 5117 5118 /a(?:b|c|d)(.)/ 5119 ace 5120 0: ace 5121 5122 /a(?:b|c|d)*(.)/ 5123 ace 5124 0: ace 5125 1: ac 5126 5127 /a(?:b|c|d)+?(.)/ 5128 ace 5129 0: ace 5130 acdbcdbe 5131 0: acdbcdbe 5132 1: acdbcdb 5133 2: acdbcd 5134 3: acdbc 5135 4: acdb 5136 5: acd 5137 5138 /a(?:b|c|d)+(.)/ 5139 acdbcdbe 5140 0: acdbcdbe 5141 1: acdbcdb 5142 2: acdbcd 5143 3: acdbc 5144 4: acdb 5145 5: acd 5146 5147 /a(?:b|c|d){2}(.)/ 5148 acdbcdbe 5149 0: acdb 5150 5151 /a(?:b|c|d){4,5}(.)/ 5152 acdbcdbe 5153 0: acdbcdb 5154 1: acdbcd 5155 5156 /a(?:b|c|d){4,5}?(.)/ 5157 acdbcdbe 5158 0: acdbcdb 5159 1: acdbcd 5160 5161 /((foo)|(bar))*/ 5162 foobar 5163 0: foobar 5164 1: foo 5165 2: 5166 5167 /a(?:b|c|d){6,7}(.)/ 5168 acdbcdbe 5169 0: acdbcdbe 5170 5171 /a(?:b|c|d){6,7}?(.)/ 5172 acdbcdbe 5173 0: acdbcdbe 5174 5175 /a(?:b|c|d){5,6}(.)/ 5176 acdbcdbe 5177 0: acdbcdbe 5178 1: acdbcdb 5179 5180 /a(?:b|c|d){5,6}?(.)/ 5181 acdbcdbe 5182 0: acdbcdbe 5183 1: acdbcdb 5184 5185 /a(?:b|c|d){5,7}(.)/ 5186 acdbcdbe 5187 0: acdbcdbe 5188 1: acdbcdb 5189 5190 /a(?:b|c|d){5,7}?(.)/ 5191 acdbcdbe 5192 0: acdbcdbe 5193 1: acdbcdb 5194 5195 /a(?:b|(c|e){1,2}?|d)+?(.)/ 5196 ace 5197 0: ace 5198 5199 /^(.+)?B/ 5200 AB 5201 0: AB 5202 5203 /^([^a-z])|(\^)$/ 5204 . 5205 0: . 5206 5207 /^[<>]&/ 5208 <&OUT 5209 0: <& 5210 5211 /(?:(f)(o)(o)|(b)(a)(r))*/ 5212 foobar 5213 0: foobar 5214 1: foo 5215 2: 5216 5217 /(?<=a)b/ 5218 ab 5219 0: b 5220 \= Expect no match 5221 cb 5222 No match 5223 b 5224 No match 5225 5226 /(?<!c)b/ 5227 ab 5228 0: b 5229 b 5230 0: b 5231 b 5232 0: b 5233 5234 /(?:..)*a/ 5235 aba 5236 0: aba 5237 1: a 5238 5239 /(?:..)*?a/ 5240 aba 5241 0: aba 5242 1: a 5243 5244 /^(){3,5}/ 5245 abc 5246 0: 5247 5248 /^(a+)*ax/ 5249 aax 5250 0: aax 5251 5252 /^((a|b)+)*ax/ 5253 aax 5254 0: aax 5255 5256 /^((a|bc)+)*ax/ 5257 aax 5258 0: aax 5259 5260 /(a|x)*ab/ 5261 cab 5262 0: ab 5263 5264 /(a)*ab/ 5265 cab 5266 0: ab 5267 5268 /(?:(?i)a)b/ 5269 ab 5270 0: ab 5271 5272 /((?i)a)b/ 5273 ab 5274 0: ab 5275 5276 /(?:(?i)a)b/ 5277 Ab 5278 0: Ab 5279 5280 /((?i)a)b/ 5281 Ab 5282 0: Ab 5283 5284 /(?:(?i)a)b/ 5285 \= Expect no match 5286 cb 5287 No match 5288 aB 5289 No match 5290 5291 /((?i)a)b/ 5292 5293 /(?i:a)b/ 5294 ab 5295 0: ab 5296 5297 /((?i:a))b/ 5298 ab 5299 0: ab 5300 5301 /(?i:a)b/ 5302 Ab 5303 0: Ab 5304 5305 /((?i:a))b/ 5306 Ab 5307 0: Ab 5308 5309 /(?i:a)b/ 5310 \= Expect no match 5311 aB 5312 No match 5313 aB 5314 No match 5315 5316 /((?i:a))b/ 5317 5318 /(?:(?-i)a)b/i 5319 ab 5320 0: ab 5321 5322 /((?-i)a)b/i 5323 ab 5324 0: ab 5325 5326 /(?:(?-i)a)b/i 5327 aB 5328 0: aB 5329 5330 /((?-i)a)b/i 5331 aB 5332 0: aB 5333 5334 /(?:(?-i)a)b/i 5335 aB 5336 0: aB 5337 \= Expect no match 5338 Ab 5339 No match 5340 5341 /((?-i)a)b/i 5342 5343 /(?:(?-i)a)b/i 5344 aB 5345 0: aB 5346 5347 /((?-i)a)b/i 5348 aB 5349 0: aB 5350 5351 /(?:(?-i)a)b/i 5352 \= Expect no match 5353 Ab 5354 No match 5355 AB 5356 No 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 5368 /(?-i:a)b/i 5369 aB 5370 0: aB 5371 5372 /((?-i:a))b/i 5373 aB 5374 0: aB 5375 5376 /(?-i:a)b/i 5377 \= Expect no match 5378 AB 5379 No match 5380 Ab 5381 No match 5382 5383 /((?-i:a))b/i 5384 5385 /(?-i:a)b/i 5386 aB 5387 0: aB 5388 5389 /((?-i:a))b/i 5390 aB 5391 0: aB 5392 5393 /(?-i:a)b/i 5394 \= Expect no match 5395 Ab 5396 No match 5397 AB 5398 No match 5399 5400 /((?-i:a))b/i 5401 5402 /((?-i:a.))b/i 5403 \= Expect no match 5404 AB 5405 No match 5406 a\nB 5407 No match 5408 5409 /((?s-i:a.))b/i 5410 a\nB 5411 0: a\x0aB 5412 5413 /(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))/ 5414 cabbbb 5415 0: cabbbb 5416 5417 /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/ 5418 caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 5419 0: caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 5420 5421 /foo\w*\d{4}baz/ 5422 foobar1234baz 5423 0: foobar1234baz 5424 5425 /x(~~)*(?:(?:F)?)?/ 5426 x~~ 5427 0: x~~ 5428 1: x 5429 5430 /^a(?#xxx){3}c/ 5431 aaac 5432 0: aaac 5433 5434 /^a (?#xxx) (?#yyy) {3}c/x 5435 aaac 5436 0: aaac 5437 5438 /(?<![cd])b/ 5439 \= Expect no match 5440 B\nB 5441 No match 5442 dbcb 5443 No match 5444 5445 /(?<![cd])[ab]/ 5446 dbaacb 5447 0: a 5448 5449 /(?<!(c|d))b/ 5450 5451 /(?<!(c|d))[ab]/ 5452 dbaacb 5453 0: a 5454 5455 /(?<!cd)[ab]/ 5456 cdaccb 5457 0: b 5458 5459 /^(?:a?b?)*$/ 5460 \= Expect no match 5461 dbcb 5462 No match 5463 a-- 5464 No match 5465 5466 /((?s)^a(.))((?m)^b$)/ 5467 a\nb\nc\n 5468 0: a\x0ab 5469 5470 /((?m)^b$)/ 5471 a\nb\nc\n 5472 0: b 5473 5474 /(?m)^b/ 5475 a\nb\n 5476 0: b 5477 5478 /(?m)^(b)/ 5479 a\nb\n 5480 0: b 5481 5482 /((?m)^b)/ 5483 a\nb\n 5484 0: b 5485 5486 /\n((?m)^b)/ 5487 a\nb\n 5488 0: \x0ab 5489 5490 /((?s).)c(?!.)/ 5491 a\nb\nc\n 5492 0: \x0ac 5493 a\nb\nc\n 5494 0: \x0ac 5495 5496 /((?s)b.)c(?!.)/ 5497 a\nb\nc\n 5498 0: b\x0ac 5499 a\nb\nc\n 5500 0: b\x0ac 5501 5502 /^b/ 5503 5504 /()^b/ 5505 \= Expect no match 5506 a\nb\nc\n 5507 No match 5508 a\nb\nc\n 5509 No match 5510 5511 /((?m)^b)/ 5512 a\nb\nc\n 5513 0: b 5514 5515 /(?(?!a)a|b)/ 5516 5517 /(?(?!a)b|a)/ 5518 a 5519 0: a 5520 5521 /(?(?=a)b|a)/ 5522 \= Expect no match 5523 a 5524 No match 5525 a 5526 No match 5527 5528 /(?(?=a)a|b)/ 5529 a 5530 0: a 5531 5532 /(\w+:)+/ 5533 one: 5534 0: one: 5535 5536 /$(?<=^(a))/ 5537 a 5538 0: 5539 5540 /([\w:]+::)?(\w+)$/ 5541 abcd 5542 0: abcd 5543 xy:z:::abcd 5544 0: xy:z:::abcd 5545 5546 /^[^bcd]*(c+)/ 5547 aexycd 5548 0: aexyc 5549 5550 /(a*)b+/ 5551 caab 5552 0: aab 5553 5554 /([\w:]+::)?(\w+)$/ 5555 abcd 5556 0: abcd 5557 xy:z:::abcd 5558 0: xy:z:::abcd 5559 \= Expect no match 5560 abcd: 5561 No match 5562 abcd: 5563 No match 5564 5565 /^[^bcd]*(c+)/ 5566 aexycd 5567 0: aexyc 5568 5569 /(>a+)ab/ 5570 5571 /(?>a+)b/ 5572 aaab 5573 0: aaab 5574 5575 /([[:]+)/ 5576 a:[b]: 5577 0: :[ 5578 5579 /([[=]+)/ 5580 a=[b]= 5581 0: =[ 5582 5583 /([[.]+)/ 5584 a.[b]. 5585 0: .[ 5586 5587 /((?>a+)b)/ 5588 aaab 5589 0: aaab 5590 5591 /(?>(a+))b/ 5592 aaab 5593 0: aaab 5594 5595 /((?>[^()]+)|\([^()]*\))+/ 5596 ((abc(ade)ufh()()x 5597 0: abc(ade)ufh()()x 5598 1: abc(ade)ufh()() 5599 2: abc(ade)ufh() 5600 3: abc(ade)ufh 5601 4: abc(ade) 5602 5: abc 5603 5604 /a\Z/ 5605 \= Expect no match 5606 aaab 5607 No match 5608 a\nb\n 5609 No match 5610 5611 /b\Z/ 5612 a\nb\n 5613 0: b 5614 5615 /b\z/ 5616 5617 /b\Z/ 5618 a\nb 5619 0: b 5620 5621 /b\z/ 5622 a\nb 5623 0: b 5624 5625 /(?>.*)(?<=(abcd|wxyz))/ 5626 alphabetabcd 5627 0: alphabetabcd 5628 endingwxyz 5629 0: endingwxyz 5630 \= Expect no match 5631 a rather long string that doesn't end with one of them 5632 No match 5633 5634 /word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/ 5635 word cat dog elephant mussel cow horse canary baboon snake shark otherword 5636 0: word cat dog elephant mussel cow horse canary baboon snake shark otherword 5637 \= Expect no match 5638 word cat dog elephant mussel cow horse canary baboon snake shark 5639 No match 5640 5641 /word (?>[a-zA-Z0-9]+ ){0,30}otherword/ 5642 \= Expect no match 5643 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 5644 No match 5645 5646 /(?<=\d{3}(?!999))foo/ 5647 999foo 5648 0: foo 5649 123999foo 5650 0: foo 5651 \= Expect no match 5652 123abcfoo 5653 No match 5654 5655 /(?<=(?!...999)\d{3})foo/ 5656 999foo 5657 0: foo 5658 123999foo 5659 0: foo 5660 \= Expect no match 5661 123abcfoo 5662 No match 5663 5664 /(?<=\d{3}(?!999)...)foo/ 5665 123abcfoo 5666 0: foo 5667 123456foo 5668 0: foo 5669 \= Expect no match 5670 123999foo 5671 No match 5672 5673 /(?<=\d{3}...)(?<!999)foo/ 5674 123abcfoo 5675 0: foo 5676 123456foo 5677 0: foo 5678 \= Expect no match 5679 123999foo 5680 No match 5681 5682 /((Z)+|A)*/ 5683 ZABCDEFG 5684 0: ZA 5685 1: Z 5686 2: 5687 5688 /(Z()|A)*/ 5689 ZABCDEFG 5690 0: ZA 5691 1: Z 5692 2: 5693 5694 /(Z(())|A)*/ 5695 ZABCDEFG 5696 0: ZA 5697 1: Z 5698 2: 5699 5700 /((?>Z)+|A)*/ 5701 ZABCDEFG 5702 0: ZA 5703 1: Z 5704 2: 5705 5706 /((?>)+|A)*/ 5707 ZABCDEFG 5708 0: 5709 5710 /a*/g 5711 abbab 5712 0: a 5713 0: 5714 0: 5715 0: a 5716 0: 5717 0: 5718 5719 /^[\d-a]/ 5720 abcde 5721 0: a 5722 -things 5723 0: - 5724 0digit 5725 0: 0 5726 \= Expect no match 5727 bcdef 5728 No match 5729 5730 /[[:space:]]+/ 5731 > \x09\x0a\x0c\x0d\x0b< 5732 0: \x09\x0a\x0c\x0d\x0b 5733 5734 /[[:blank:]]+/ 5735 > \x09\x0a\x0c\x0d\x0b< 5736 0: \x09 5737 5738 /[\s]+/ 5739 > \x09\x0a\x0c\x0d\x0b< 5740 0: \x09\x0a\x0c\x0d\x0b 5741 5742 /\s+/ 5743 > \x09\x0a\x0c\x0d\x0b< 5744 0: \x09\x0a\x0c\x0d\x0b 5745 5746 /ab/x 5748 ab 5749 0: ab 5750 5751 /(?!\A)x/m 5752 a\nxb\n 5753 0: x 5754 5755 /(?!^)x/m 5756 \= Expect no match 5757 a\nxb\n 5758 No match 5759 5760 /abc\Qabc\Eabc/ 5761 abcabcabc 5762 0: abcabcabc 5763 5764 /abc\Q(*+|\Eabc/ 5765 abc(*+|abc 5766 0: abc(*+|abc 5767 5768 / abc\Q abc\Eabc/x 5769 abc abcabc 5770 0: abc abcabc 5771 \= Expect no match 5772 abcabcabc 5773 No match 5774 5775 /abc#comment 5776 \Q#not comment 5777 literal\E/x 5778 abc#not comment\n literal 5779 0: abc#not comment\x0a literal 5780 5781 /abc#comment 5782 \Q#not comment 5783 literal/x 5784 abc#not comment\n literal 5785 0: abc#not comment\x0a literal 5786 5787 /abc#comment 5788 \Q#not comment 5789 literal\E #more comment 5790 /x 5791 abc#not comment\n literal 5792 0: abc#not comment\x0a literal 5793 5794 /abc#comment 5795 \Q#not comment 5796 literal\E #more comment/x 5797 abc#not comment\n literal 5798 0: abc#not comment\x0a literal 5799 5800 /\Qabc\$xyz\E/ 5801 abc\\\$xyz 5802 0: abc\$xyz 5803 5804 /\Qabc\E\$\Qxyz\E/ 5805 abc\$xyz 5806 0: abc$xyz 5807 5808 /\Gabc/ 5809 abc 5810 0: abc 5811 \= Expect no match 5812 xyzabc 5813 No match 5814 5815 /\Gabc./g 5816 abc1abc2xyzabc3 5817 0: abc1 5818 0: abc2 5819 5820 /abc./g 5821 abc1abc2xyzabc3 5822 0: abc1 5823 0: abc2 5824 0: abc3 5825 5826 /a(?x: b c )d/ 5827 XabcdY 5828 0: abcd 5829 \= Expect no match 5830 Xa b c d Y 5831 No match 5832 5833 /((?x)x y z | a b c)/ 5834 XabcY 5835 0: abc 5836 AxyzB 5837 0: xyz 5838 5839 /(?i)AB(?-i)C/ 5840 XabCY 5841 0: abC 5842 \= Expect no match 5843 XabcY 5844 No match 5845 5846 /((?i)AB(?-i)C|D)E/ 5847 abCE 5848 0: abCE 5849 DE 5850 0: DE 5851 \= Expect no match 5852 abcE 5853 No match 5854 abCe 5855 No match 5856 dE 5857 No match 5858 De 5859 No match 5860 5861 /[z\Qa-d]\E]/ 5862 z 5863 0: z 5864 a 5865 0: a 5866 - 5867 0: - 5868 d 5869 0: d 5870 ] 5871 0: ] 5872 \= Expect no match 5873 b 5874 No match 5875 5876 /(a+)*b/ 5877 \= Expect no match 5878 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 5879 No match 5880 5881 /(?i)reg(?:ul(?:[a]|ae)r|ex)/ 5882 REGular 5883 0: REGular 5884 regulaer 5885 0: regulaer 5886 Regex 5887 0: Regex 5888 regulr 5889 0: regul\xe4r 5890 5891 /[--]+/ 5892 5893 0: \xc5\xe6\xe5\xe4\xe0 5894 5895 0: \xc5\xe6\xe5\xe4\xff 5896 5897 0: \xc5\xe6\xe5\xe4\xc0 5898 5899 0: \xc5\xe6\xe5\xe4\xdf 5900 5901 /(?<=Z)X./ 5902 \x84XAZXB 5903 0: XB 5904 5905 /^(?(2)a|(1)(2))+$/ 5906 123a 5907 Failed: error -40: backreference condition or recursion test is not supported for DFA matching 5908 5909 /(?<=a|bbbb)c/ 5910 ac 5911 0: c 5912 bbbbc 5913 0: c 5914 5915 /line\nbreak/ 5916 this is a line\nbreak 5917 0: line\x0abreak 5918 line one\nthis is a line\nbreak in the second line 5919 0: line\x0abreak 5920 5921 /line\nbreak/firstline 5922 this is a line\nbreak 5923 0: line\x0abreak 5924 \= Expect no match 5925 line one\nthis is a line\nbreak in the second line 5926 No match 5927 5928 /line\nbreak/m,firstline 5929 this is a line\nbreak 5930 0: line\x0abreak 5931 \= Expect no match 5932 line one\nthis is a line\nbreak in the second line 5933 No match 5934 5935 /1234/ 5936 123\=ps 5937 Partial match: 123 5938 \= Expect no match 5939 a4\=ps,dfa_restart 5940 No match 5941 5942 /1234/ 5943 123\=ps 5944 Partial match: 123 5945 4\=ps,dfa_restart 5946 0: 4 5947 5948 /^/gm 5949 a\nb\nc\n 5950 0: 5951 0: 5952 0: 5953 \ 5954 0: 5955 5956 /(?<=C\n)^/gm 5957 A\nC\nC\n 5958 0: 5959 5960 /(?s)A?B/ 5961 AB 5962 0: AB 5963 aB 5964 0: B 5965 5966 /(?s)A*B/ 5967 AB 5968 0: AB 5969 aB 5970 0: B 5971 5972 /(?m)A?B/ 5973 AB 5974 0: AB 5975 aB 5976 0: B 5977 5978 /(?m)A*B/ 5979 AB 5980 0: AB 5981 aB 5982 0: B 5983 5984 /Content-Type\x3A[^\r\n]{6,}/ 5985 Content-Type:xxxxxyyy 5986 0: Content-Type:xxxxxyyy 5987 5988 /Content-Type\x3A[^\r\n]{6,}z/ 5989 Content-Type:xxxxxyyyz 5990 0: Content-Type:xxxxxyyyz 5991 5992 /Content-Type\x3A[^a]{6,}/ 5993 Content-Type:xxxyyy 5994 0: Content-Type:xxxyyy 5995 5996 /Content-Type\x3A[^a]{6,}z/ 5997 Content-Type:xxxyyyz 5998 0: Content-Type:xxxyyyz 5999 6000 /^abc/Im,newline=lf 6001 Capturing subpattern count = 0 6002 Options: multiline 6003 Forced newline is LF 6004 First code unit at start or follows newline 6005 Last code unit = 'c' 6006 Subject length lower bound = 3 6007 xyz\nabc 6008 0: abc 6009 xyz\r\nabc 6010 0: abc 6011 \= Expect no match 6012 xyz\rabc 6013 No match 6014 xyzabc\r 6015 No match 6016 xyzabc\rpqr 6017 No match 6018 xyzabc\r\n 6019 No match 6020 xyzabc\r\npqr 6021 No match 6022 6023 /^abc/Im,newline=crlf 6024 Capturing subpattern count = 0 6025 Options: multiline 6026 Forced newline is CRLF 6027 First code unit at start or follows newline 6028 Last code unit = 'c' 6029 Subject length lower bound = 3 6030 xyz\r\nabclf> 6031 0: abc 6032 \= Expect no match 6033 xyz\nabclf 6034 No match 6035 xyz\rabclf 6036 No match 6037 6038 /^abc/Im,newline=cr 6039 Capturing subpattern count = 0 6040 Options: multiline 6041 Forced newline is CR 6042 First code unit at start or follows newline 6043 Last code unit = 'c' 6044 Subject length lower bound = 3 6045 xyz\rabc 6046 0: abc 6047 \= Expect no match 6048 xyz\nabc 6049 No match 6050 xyz\r\nabc 6051 No match 6052 6053 /.*/I,newline=lf 6054 Capturing subpattern count = 0 6055 May match empty string 6056 Forced newline is LF 6057 First code unit at start or follows newline 6058 Subject length lower bound = 0 6059 abc\ndef 6060 0: abc 6061 abc\rdef 6062 0: abc\x0ddef 6063 abc\r\ndef 6064 0: abc\x0d 6065 6066 /.*/I,newline=cr 6067 Capturing subpattern count = 0 6068 May match empty string 6069 Forced newline is CR 6070 First code unit at start or follows newline 6071 Subject length lower bound = 0 6072 abc\ndef 6073 0: abc\x0adef 6074 abc\rdef 6075 0: abc 6076 abc\r\ndef 6077 0: abc 6078 6079 /.*/I,newline=crlf 6080 Capturing subpattern count = 0 6081 May match empty string 6082 Forced newline is CRLF 6083 First code unit at start or follows newline 6084 Subject length lower bound = 0 6085 abc\ndef 6086 0: abc\x0adef 6087 abc\rdef 6088 0: abc\x0ddef 6089 abc\r\ndef 6090 0: abc 6091 6092 /\w+(.)(.)?def/Is 6093 Capturing subpattern count = 2 6094 Options: dotall 6095 Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P 6096 Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z 6097 Last code unit = 'f' 6098 Subject length lower bound = 5 6099 abc\ndef 6100 0: abc\x0adef 6101 abc\rdef 6102 0: abc\x0ddef 6103 abc\r\ndef 6104 0: abc\x0d\x0adef 6105 6106 /\w+(.)(.)?def/s 6107 abc\ndef 6108 0: abc\x0adef 6109 abc\rdef 6110 0: abc\x0ddef 6111 abc\r\ndef 6112 0: abc\x0d\x0adef 6113 6114 /^\w+=.*(\\\n.*)*/ 6115 abc=xyz\\\npqr 6116 0: abc=xyz\\x0apqr 6117 1: abc=xyz\\x0apq 6118 2: abc=xyz\\x0ap 6119 3: abc=xyz\\x0a 6120 4: abc=xyz\ 6121 5: abc=xyz 6122 6: abc=xy 6123 7: abc=x 6124 8: abc= 6125 6126 /^(a()*)*/ 6127 aaaa 6128 0: aaaa 6129 1: aaa 6130 2: aa 6131 3: a 6132 4: 6133 6134 /^(?:a(?:(?:))*)*/ 6135 aaaa 6136 0: aaaa 6137 1: aaa 6138 2: aa 6139 3: a 6140 4: 6141 6142 /^(a()+)+/ 6143 aaaa 6144 0: aaaa 6145 1: aaa 6146 2: aa 6147 3: a 6148 6149 /^(?:a(?:(?:))+)+/ 6150 aaaa 6151 0: aaaa 6152 1: aaa 6153 2: aa 6154 3: a 6155 6156 /(a|)*\d/ 6157 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 6158 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 6159 \= Expect no match 6160 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 6161 No match 6162 6163 /(?>a|)*\d/ 6164 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 6165 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 6166 \= Expect no match 6167 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 6168 No match 6169 6170 /(?:a|)*\d/ 6171 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 6172 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 6173 \= Expect no match 6174 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 6175 No match 6176 6177 /^a.b/newline=lf 6178 a\rb 6179 0: a\x0db 6180 \= Expect no match 6181 a\nb 6182 No match 6183 6184 /^a.b/newline=cr 6185 a\nb 6186 0: a\x0ab 6187 \= Expect no match 6188 a\rb 6189 No match 6190 6191 /^a.b/newline=anycrlf 6192 a\x85b 6193 0: a\x85b 6194 \= Expect no match 6195 a\rb 6196 No match 6197 6198 /^a.b/newline=any 6199 \= Expect no match 6200 a\nb 6201 No match 6202 a\rb 6203 No match 6204 a\x85b 6205 No match 6206 6207 /^abc./gmx,newline=any 6208 abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK 6209 0: abc1 6210 0: abc2 6211 0: abc3 6212 0: abc4 6213 0: abc5 6214 0: abc6 6215 0: abc7 6216 6217 /abc.$/gmx,newline=any 6218 abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9 6219 0: abc1 6220 0: abc2 6221 0: abc3 6222 0: abc4 6223 0: abc5 6224 0: abc6 6225 0: abc9 6226 6227 /^a\Rb/bsr=unicode 6228 a\nb 6229 0: a\x0ab 6230 a\rb 6231 0: a\x0db 6232 a\r\nb 6233 0: a\x0d\x0ab 6234 a\x0bb 6235 0: a\x0bb 6236 a\x0cb 6237 0: a\x0cb 6238 a\x85b 6239 0: a\x85b 6240 \= Expect no match 6241 a\n\rb 6242 No match 6243 6244 /^a\R*b/bsr=unicode 6245 ab 6246 0: ab 6247 a\nb 6248 0: a\x0ab 6249 a\rb 6250 0: a\x0db 6251 a\r\nb 6252 0: a\x0d\x0ab 6253 a\x0bb 6254 0: a\x0bb 6255 a\x0cb 6256 0: a\x0cb 6257 a\x85b 6258 0: a\x85b 6259 a\n\rb 6260 0: a\x0a\x0db 6261 a\n\r\x85\x0cb 6262 0: a\x0a\x0d\x85\x0cb 6263 6264 /^a\R+b/bsr=unicode 6265 a\nb 6266 0: a\x0ab 6267 a\rb 6268 0: a\x0db 6269 a\r\nb 6270 0: a\x0d\x0ab 6271 a\x0bb 6272 0: a\x0bb 6273 a\x0cb 6274 0: a\x0cb 6275 a\x85b 6276 0: a\x85b 6277 a\n\rb 6278 0: a\x0a\x0db 6279 a\n\r\x85\x0cb 6280 0: a\x0a\x0d\x85\x0cb 6281 \= Expect no match 6282 ab 6283 No match 6284 6285 /^a\R{1,3}b/bsr=unicode 6286 a\nb 6287 0: a\x0ab 6288 a\n\rb 6289 0: a\x0a\x0db 6290 a\n\r\x85b 6291 0: a\x0a\x0d\x85b 6292 a\r\n\r\nb 6293 0: a\x0d\x0a\x0d\x0ab 6294 a\r\n\r\n\r\nb 6295 0: a\x0d\x0a\x0d\x0a\x0d\x0ab 6296 a\n\r\n\rb 6297 0: a\x0a\x0d\x0a\x0db 6298 a\n\n\r\nb 6299 0: a\x0a\x0a\x0d\x0ab 6300 \= Expect no match 6301 a\n\n\n\rb 6302 No match 6303 a\r 6304 No match 6305 6306 /.+foo/ 6307 afoo 6308 0: afoo 6309 \= Expect no match 6310 \r\nfoo 6311 No match 6312 \nfoo 6313 No match 6314 6315 /.+foo/newline=crlf 6316 afoo 6317 0: afoo 6318 \nfoo 6319 0: \x0afoo 6320 \= Expect no match 6321 \r\nfoo 6322 No match 6323 6324 /.+foo/newline=any 6325 afoo 6326 0: afoo 6327 \= Expect no match 6328 \nfoo 6329 No match 6330 \r\nfoo 6331 No match 6332 6333 /.+foo/s 6334 afoo 6335 0: afoo 6336 \r\nfoo 6337 0: \x0d\x0afoo 6338 \nfoo 6339 0: \x0afoo 6340 6341 /^$/gm,newline=any 6342 abc\r\rxyz 6343 0: 6344 abc\n\rxyz 6345 0: 6346 \= Expect no match 6347 abc\r\nxyz 6348 No match 6349 6350 /^X/m 6351 XABC 6352 0: X 6353 \= Expect no match 6354 XABC\=notbol 6355 No match 6356 6357 /(?m)^$/g,newline=any,aftertext 6358 abc\r\n\r\n 6359 0: 6360 0+ \x0d\x0a 6361 6362 /(?m)^$|^\r\n/g,newline=any,aftertext 6363 abc\r\n\r\n 6364 0: \x0d\x0a 6365 0+ 6366 1: 6367 6368 /(?m)$/g,newline=any,aftertext 6369 abc\r\n\r\n 6370 0: 6371 0+ \x0d\x0a\x0d\x0a 6372 0: 6373 0+ \x0d\x0a 6374 0: 6375 0+ 6376 6377 /(?|(abc)|(xyz))/ 6378 >abc< 6379 0: abc 6380 >xyz< 6381 0: xyz 6382 6383 /(x)(?|(abc)|(xyz))(x)/ 6384 xabcx 6385 0: xabcx 6386 xxyzx 6387 0: xxyzx 6388 6389 /(x)(?|(abc)(pqr)|(xyz))(x)/ 6390 xabcpqrx 6391 0: xabcpqrx 6392 xxyzx 6393 0: xxyzx 6394 6395 /(?|(abc)|(xyz))(?1)/ 6396 abcabc 6397 0: abcabc 6398 xyzabc 6399 0: xyzabc 6400 \= Expect no match 6401 xyzxyz 6402 No match 6403 6404 /\H\h\V\v/ 6405 X X\x0a 6406 0: X X\x0a 6407 X\x09X\x0b 6408 0: X\x09X\x0b 6409 \= Expect no match 6410 \xa0 X\x0a 6411 No match 6412 6413 /\H*\h+\V?\v{3,4}/ 6414 \x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a 6415 0: \x09 \xa0X\x0a\x0b\x0c\x0d 6416 \x09\x20\xa0\x0a\x0b\x0c\x0d\x0a 6417 0: \x09 \xa0\x0a\x0b\x0c\x0d 6418 \x09\x20\xa0\x0a\x0b\x0c 6419 0: \x09 \xa0\x0a\x0b\x0c 6420 \= Expect no match 6421 \x09\x20\xa0\x0a\x0b 6422 No match 6423 6424 /\H{3,4}/ 6425 XY ABCDE 6426 0: ABCD 6427 XY PQR ST 6428 0: PQR 6429 6430 /.\h{3,4}./ 6431 XY AB PQRS 6432 0: B P 6433 1: B 6434 6435 /\h*X\h?\H+Y\H?Z/ 6436 >XNNNYZ 6437 0: XNNNYZ 6438 > X NYQZ 6439 0: X NYQZ 6440 \= Expect no match 6441 >XYZ 6442 No match 6443 > X NY Z 6444 No match 6445 6446 /\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/ 6447 >XY\x0aZ\x0aA\x0bNN\x0c 6448 0: XY\x0aZ\x0aA\x0bNN\x0c 6449 >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c 6450 0: \x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c 6451 6452 /.+A/newline=crlf 6453 \= Expect no match 6454 \r\nA 6455 No match 6456 6457 /\nA/newline=crlf 6458 \r\nA 6459 0: \x0aA 6460 6461 /[\r\n]A/newline=crlf 6462 \r\nA 6463 0: \x0aA 6464 6465 /(\r|\n)A/newline=crlf 6466 \r\nA 6467 0: \x0aA 6468 6469 /a\Rb/I,bsr=anycrlf 6470 Capturing subpattern count = 0 6471 \R matches CR, LF, or CRLF 6472 First code unit = 'a' 6473 Last code unit = 'b' 6474 Subject length lower bound = 3 6475 a\rb 6476 0: a\x0db 6477 a\nb 6478 0: a\x0ab 6479 a\r\nb 6480 0: a\x0d\x0ab 6481 \= Expect no match 6482 a\x85b 6483 No match 6484 a\x0bb 6485 No match 6486 6487 /a\Rb/I,bsr=unicode 6488 Capturing subpattern count = 0 6489 \R matches any Unicode newline 6490 First code unit = 'a' 6491 Last code unit = 'b' 6492 Subject length lower bound = 3 6493 a\rb 6494 0: a\x0db 6495 a\nb 6496 0: a\x0ab 6497 a\r\nb 6498 0: a\x0d\x0ab 6499 a\x85b 6500 0: a\x85b 6501 a\x0bb 6502 0: a\x0bb 6503 6504 /a\R?b/I,bsr=anycrlf 6505 Capturing subpattern count = 0 6506 \R matches CR, LF, or CRLF 6507 First code unit = 'a' 6508 Last code unit = 'b' 6509 Subject length lower bound = 2 6510 a\rb 6511 0: a\x0db 6512 a\nb 6513 0: a\x0ab 6514 a\r\nb 6515 0: a\x0d\x0ab 6516 \= Expect no match 6517 a\x85b 6518 No match 6519 a\x0bb 6520 No match 6521 6522 /a\R?b/I,bsr=unicode 6523 Capturing subpattern count = 0 6524 \R matches any Unicode newline 6525 First code unit = 'a' 6526 Last code unit = 'b' 6527 Subject length lower bound = 2 6528 a\rb 6529 0: a\x0db 6530 a\nb 6531 0: a\x0ab 6532 a\r\nb 6533 0: a\x0d\x0ab 6534 a\x85b 6535 0: a\x85b 6536 a\x0bb 6537 0: a\x0bb 6538 6539 /a\R{2,4}b/I,bsr=anycrlf 6540 Capturing subpattern count = 0 6541 \R matches CR, LF, or CRLF 6542 First code unit = 'a' 6543 Last code unit = 'b' 6544 Subject length lower bound = 4 6545 a\r\n\nb 6546 0: a\x0d\x0a\x0ab 6547 a\n\r\rb 6548 0: a\x0a\x0d\x0db 6549 a\r\n\r\n\r\n\r\nb 6550 0: a\x0d\x0a\x0d\x0a\x0d\x0a\x0d\x0ab 6551 \= Expect no match 6552 a\x0b\x0bb 6553 No match 6554 a\x85\x85b 6555 No match 6556 6557 /a\R{2,4}b/I,bsr=unicode 6558 Capturing subpattern count = 0 6559 \R matches any Unicode newline 6560 First code unit = 'a' 6561 Last code unit = 'b' 6562 Subject length lower bound = 4 6563 a\r\rb 6564 0: a\x0d\x0db 6565 a\n\n\nb 6566 0: a\x0a\x0a\x0ab 6567 a\r\n\n\r\rb 6568 0: a\x0d\x0a\x0a\x0d\x0db 6569 a\x85\x85b 6570 0: a\x85\x85b 6571 a\x0b\x0bb 6572 0: a\x0b\x0bb 6573 \= Expect no match 6574 a\r\r\r\r\rb 6575 No match 6576 6577 /a(?!)|\wbc/ 6578 abc 6579 0: abc 6580 6581 /a[]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames 6582 \= Expect no match 6583 ab 6584 No match 6585 6586 /a[]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames 6587 \= Expect no match 6588 ab 6589 No match 6590 6591 /a[]*+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames 6592 \= Expect no match 6593 ab 6594 No match 6595 6596 /a[^]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames 6597 aXb 6598 0: aXb 6599 a\nb 6600 0: a\x0ab 6601 \= Expect no match 6602 ab 6603 No match 6604 6605 /a[^]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames 6606 aXb 6607 0: aXb 6608 a\nX\nXb 6609 0: a\x0aX\x0aXb 6610 \= Expect no match 6611 ab 6612 No match 6613 6614 /X$/dollar_endonly 6615 X 6616 0: X 6617 \= Expect no match 6618 X\n 6619 No match 6620 6621 /X$/ 6622 X 6623 0: X 6624 X\n 6625 0: X 6626 6627 /xyz/auto_callout 6628 xyz 6629 --->xyz 6630 +0 ^ x 6631 +1 ^^ y 6632 +2 ^ ^ z 6633 +3 ^ ^ 6634 0: xyz 6635 abcxyz 6636 --->abcxyz 6637 +0 ^ x 6638 +1 ^^ y 6639 +2 ^ ^ z 6640 +3 ^ ^ 6641 0: xyz 6642 \= Expect no match 6643 abc 6644 No match 6645 abcxypqr 6646 No match 6647 6648 /xyz/auto_callout,no_start_optimize 6649 abcxyz 6650 --->abcxyz 6651 +0 ^ x 6652 +0 ^ x 6653 +0 ^ x 6654 +0 ^ x 6655 +1 ^^ y 6656 +2 ^ ^ z 6657 +3 ^ ^ 6658 0: xyz 6659 \= Expect no match 6660 abc 6661 --->abc 6662 +0 ^ x 6663 +0 ^ x 6664 +0 ^ x 6665 +0 ^ x 6666 No match 6667 abcxypqr 6668 --->abcxypqr 6669 +0 ^ x 6670 +0 ^ x 6671 +0 ^ x 6672 +0 ^ x 6673 +1 ^^ y 6674 +2 ^ ^ z 6675 +0 ^ x 6676 +0 ^ x 6677 +0 ^ x 6678 +0 ^ x 6679 +0 ^ x 6680 No match 6681 6682 /(*NO_START_OPT)xyz/auto_callout 6683 abcxyz 6684 --->abcxyz 6685 +15 ^ x 6686 +15 ^ x 6687 +15 ^ x 6688 +15 ^ x 6689 +16 ^^ y 6690 +17 ^ ^ z 6691 +18 ^ ^ 6692 0: xyz 6693 6694 /(?C)ab/ 6695 ab 6696 --->ab 6697 0 ^ a 6698 0: ab 6699 ab\=callout_none 6700 0: ab 6701 6702 /ab/auto_callout 6703 ab 6704 --->ab 6705 +0 ^ a 6706 +1 ^^ b 6707 +2 ^ ^ 6708 0: ab 6709 ab\=callout_none 6710 0: ab 6711 6712 /^"((?(?=[a])[^"])|b)*"$/auto_callout 6713 "ab" 6714 --->"ab" 6715 +0 ^ ^ 6716 +1 ^ " 6717 +2 ^^ ((?(?=[a])[^"])|b)* 6718 +21 ^^ " 6719 +3 ^^ (?(?=[a])[^"]) 6720 +18 ^^ b 6721 +5 ^^ (?=[a]) 6722 +8 ^ [a] 6723 +11 ^^ ) 6724 +12 ^^ [^"] 6725 +16 ^ ^ ) 6726 +17 ^ ^ | 6727 +21 ^ ^ " 6728 +3 ^ ^ (?(?=[a])[^"]) 6729 +18 ^ ^ b 6730 +5 ^ ^ (?=[a]) 6731 +8 ^ [a] 6732 +19 ^ ^ ) 6733 +21 ^ ^ " 6734 +3 ^ ^ (?(?=[a])[^"]) 6735 +18 ^ ^ b 6736 +5 ^ ^ (?=[a]) 6737 +8 ^ [a] 6738 +17 ^ ^ | 6739 +22 ^ ^ $ 6740 +23 ^ ^ 6741 0: "ab" 6742 "ab"\=callout_none 6743 0: "ab" 6744 6745 /\d+X|9+Y/ 6746 ++++123999\=ps 6747 Partial match: 123999 6748 ++++123999Y\=ps 6749 0: 999Y 6750 6751 /Z(*F)/ 6752 \= Expect no match 6753 Z\=ps 6754 No match 6755 ZA\=ps 6756 No match 6757 6758 /Z(?!)/ 6759 \= Expect no match 6760 Z\=ps 6761 No match 6762 ZA\=ps 6763 No match 6764 6765 /dog(sbody)?/ 6766 dogs\=ps 6767 0: dog 6768 dogs\=ph 6769 Partial match: dogs 6770 6771 /dog(sbody)??/ 6772 dogs\=ps 6773 0: dog 6774 dogs\=ph 6775 Partial match: dogs 6776 6777 /dog|dogsbody/ 6778 dogs\=ps 6779 0: dog 6780 dogs\=ph 6781 Partial match: dogs 6782 6783 /dogsbody|dog/ 6784 dogs\=ps 6785 0: dog 6786 dogs\=ph 6787 Partial match: dogs 6788 6789 /Z(*F)Q|ZXY/ 6790 Z\=ps 6791 Partial match: Z 6792 \= Expect no match 6793 ZA\=ps 6794 No match 6795 X\=ps 6796 No match 6797 6798 /\bthe cat\b/ 6799 the cat\=ps 6800 0: the cat 6801 the cat\=ph 6802 Partial match: the cat 6803 6804 /dog(sbody)?/ 6805 dogs\=ps 6806 0: dog 6807 body\=dfa_restart 6808 0: body 6809 6810 /dog(sbody)?/ 6811 dogs\=ph 6812 Partial match: dogs 6813 body\=dfa_restart 6814 0: body 6815 6816 /abc/ 6817 abc\=ps 6818 0: abc 6819 abc\=ph 6820 0: abc 6821 6822 /abc\K123/ 6823 xyzabc123pqr 6824 Failed: error -42: pattern contains an item that is not supported for DFA matching 6825 6826 /(?<=abc)123/ 6827 xyzabc123pqr 6828 0: 123 6829 xyzabc12\=ps 6830 Partial match: abc12 6831 <<< 6832 xyzabc12\=ph 6833 Partial match: abc12 6834 <<< 6835 6836 /\babc\b/ 6837 +++abc+++ 6838 0: abc 6839 +++ab\=ps 6840 Partial match: +ab 6841 < 6842 +++ab\=ph 6843 Partial match: +ab 6844 < 6845 6846 /(?=C)/g,aftertext 6847 ABCDECBA 6848 0: 6849 0+ CDECBA 6850 0: 6851 0+ CBA 6852 6853 /(abc|def|xyz)/I 6854 Capturing subpattern count = 1 6855 Starting code units: a d x 6856 Subject length lower bound = 3 6857 terhjk;abcdaadsfe 6858 0: abc 6859 the quick xyz brown fox 6860 0: xyz 6861 \= Expect no match 6862 thejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd 6863 No match 6864 6865 /(abc|def|xyz)/I,no_start_optimize 6866 Capturing subpattern count = 1 6867 Options: no_start_optimize 6868 Subject length lower bound = 0 6869 terhjk;abcdaadsfe 6870 0: abc 6871 the quick xyz brown fox 6872 0: xyz 6873 \= Expect no match 6874 thejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd 6875 No match 6876 6877 /abcd*/aftertext 6878 xxxxabcd\=ps 6879 0: abcd 6880 0+ 6881 xxxxabcd\=ph 6882 Partial match: abcd 6883 dddxxx\=dfa_restart 6884 0: ddd 6885 0+ xxx 6886 xxxxabcd\=ph 6887 Partial match: abcd 6888 xxx\=dfa_restart 6889 0: 6890 0+ xxx 6891 6892 /abcd*/i 6893 xxxxabcd\=ps 6894 0: abcd 6895 xxxxabcd\=ph 6896 Partial match: abcd 6897 XXXXABCD\=ps 6898 0: ABCD 6899 XXXXABCD\=ph 6900 Partial match: ABCD 6901 6902 /abc\d*/ 6903 xxxxabc1\=ps 6904 0: abc1 6905 xxxxabc1\=ph 6906 Partial match: abc1 6907 6908 /abc[de]*/ 6909 xxxxabcde\=ps 6910 0: abcde 6911 xxxxabcde\=ph 6912 Partial match: abcde 6913 6914 /(?:(?1)|B)(A(*F)|C)/ 6915 ABCD 6916 0: BC 6917 CCD 6918 0: CC 6919 \= Expect no match 6920 CAD 6921 No match 6922 6923 /^(?:(?1)|B)(A(*F)|C)/ 6924 CCD 6925 0: CC 6926 BCD 6927 0: BC 6928 \= Expect no match 6929 ABCD 6930 No match 6931 CAD 6932 No match 6933 BAD 6934 No match 6935 6936 /^(?!a(*SKIP)b)/ 6937 ac 6938 Failed: error -42: pattern contains an item that is not supported for DFA matching 6939 6940 /^(?=a(*SKIP)b|ac)/ 6941 ac 6942 Failed: error -42: pattern contains an item that is not supported for DFA matching 6943 6944 /^(?=a(*THEN)b|ac)/ 6945 ac 6946 Failed: error -42: pattern contains an item that is not supported for DFA matching 6947 6948 /^(?=a(*PRUNE)b)/ 6949 ab 6950 Failed: error -42: pattern contains an item that is not supported for DFA matching 6951 6952 /^(?(?!a(*SKIP)b))/ 6953 ac 6954 Failed: error -42: pattern contains an item that is not supported for DFA matching 6955 6956 /(?<=abc)def/ 6957 abc\=ph 6958 Partial match: abc 6959 <<< 6960 6961 /abc$/ 6962 abc 6963 0: abc 6964 abc\=ps 6965 0: abc 6966 abc\=ph 6967 Partial match: abc 6968 6969 /abc$/m 6970 abc 6971 0: abc 6972 abc\n 6973 0: abc 6974 abc\=ph 6975 Partial match: abc 6976 abc\n\=ph 6977 0: abc 6978 abc\=ps 6979 0: abc 6980 abc\n\=ps 6981 0: abc 6982 6983 /abc\z/ 6984 abc 6985 0: abc 6986 abc\=ps 6987 0: abc 6988 abc\=ph 6989 Partial match: abc 6990 6991 /abc\Z/ 6992 abc 6993 0: abc 6994 abc\=ps 6995 0: abc 6996 abc\=ph 6997 Partial match: abc 6998 6999 /abc\b/ 7000 abc 7001 0: abc 7002 abc\=ps 7003 0: abc 7004 abc\=ph 7005 Partial match: abc 7006 7007 /abc\B/ 7008 abc\=ps 7009 Partial match: abc 7010 abc\=ph 7011 Partial match: abc 7012 \= Expect no match 7013 abc 7014 No match 7015 7016 /.+/ 7017 abc\=offset=0 7018 0: abc 7019 abc\=offset=1 7020 0: bc 7021 abc\=offset=2 7022 0: c 7023 \= Bad offsets 7024 abc\=offset=4 7025 Failed: error -33: bad offset value 7026 abc\=offset=-4 7027 ** Invalid value in 'offset=-4' 7028 \= Expect no match 7029 abc\=offset=3 7030 No match 7031 7032 /^(?:a)++\w/ 7033 aaaab 7034 0: aaaab 7035 \= Expect no match 7036 aaaa 7037 No match 7038 bbb 7039 No match 7040 7041 /^(?:aa|(?:a)++\w)/ 7042 aaaab 7043 0: aaaab 7044 1: aa 7045 aaaa 7046 0: aa 7047 \= Expect no match 7048 bbb 7049 No match 7050 7051 /^(?:a)*+\w/ 7052 aaaab 7053 0: aaaab 7054 bbb 7055 0: b 7056 \= Expect no match 7057 aaaa 7058 No match 7059 7060 /^(a)++\w/ 7061 aaaab 7062 0: aaaab 7063 \= Expect no match 7064 aaaa 7065 No match 7066 bbb 7067 No match 7068 7069 /^(a|)++\w/ 7070 aaaab 7071 0: aaaab 7072 \= Expect no match 7073 aaaa 7074 No match 7075 bbb 7076 No match 7077 7078 /(?=abc){3}abc/aftertext 7079 abcabcabc 7080 0: abc 7081 0+ abcabc 7082 \= Expect no match 7083 xyz 7084 No match 7085 7086 /(?=abc)+abc/aftertext 7087 abcabcabc 7088 0: abc 7089 0+ abcabc 7090 \= Expect no match 7091 xyz 7092 No match 7093 7094 /(?=abc)++abc/aftertext 7095 abcabcabc 7096 0: abc 7097 0+ abcabc 7098 \= Expect no match 7099 xyz 7100 No match 7101 7102 /(?=abc){0}xyz/ 7103 xyz 7104 0: xyz 7105 7106 /(?=abc){1}xyz/ 7107 \= Expect no match 7108 xyz 7109 No match 7110 7111 /(?=(a))?./ 7112 ab 7113 0: a 7114 bc 7115 0: b 7116 7117 /(?=(a))??./ 7118 ab 7119 0: a 7120 bc 7121 0: b 7122 7123 /^(?=(a)){0}b(?1)/ 7124 backgammon 7125 0: ba 7126 7127 /^(?=(?1))?[az]([abc])d/ 7128 abd 7129 0: abd 7130 zcdxx 7131 0: zcd 7132 7133 /^(?!a){0}\w+/ 7134 aaaaa 7135 0: aaaaa 7136 7137 /(?<=(abc))?xyz/ 7138 abcxyz 7139 0: xyz 7140 pqrxyz 7141 0: xyz 7142 7143 /((?2))((?1))/ 7144 abc 7145 Failed: error -52: nested recursion at the same subject position 7146 7147 /(?(R)a+|(?R)b)/ 7148 aaaabcde 7149 0: aaaab 7150 7151 /(?(R)a+|((?R))b)/ 7152 aaaabcde 7153 0: aaaab 7154 7155 /((?(R)a+|(?1)b))/ 7156 aaaabcde 7157 0: aaaab 7158 7159 /((?(R2)a+|(?1)b))/ 7160 aaaabcde 7161 Failed: error -40: backreference condition or recursion test is not supported for DFA matching 7162 7163 /(?(R)a*(?1)|((?R))b)/ 7164 aaaabcde 7165 Failed: error -52: nested recursion at the same subject position 7166 7167 /(a+)/no_auto_possess 7168 aaaa\=ovector=3 7169 Matched, but offsets vector is too small to show all matches 7170 0: aaaa 7171 1: aaa 7172 2: aa 7173 aaaa\=ovector=4 7174 0: aaaa 7175 1: aaa 7176 2: aa 7177 3: a 7178 7179 /^\R/ 7180 \r\=ps 7181 0: \x0d 7182 \r\=ph 7183 Partial match: \x0d 7184 7185 /^\R{2,3}x/ 7186 \r\=ps 7187 Partial match: \x0d 7188 \r\=ph 7189 Partial match: \x0d 7190 \r\r\=ps 7191 Partial match: \x0d\x0d 7192 \r\r\=ph 7193 Partial match: \x0d\x0d 7194 \r\r\r\=ps 7195 Partial match: \x0d\x0d\x0d 7196 \r\r\r\=ph 7197 Partial match: \x0d\x0d\x0d 7198 \r\rx 7199 0: \x0d\x0dx 7200 \r\r\rx 7201 0: \x0d\x0d\x0dx 7202 7203 /^\R{2,3}?x/ 7204 \r\=ps 7205 Partial match: \x0d 7206 \r\=ph 7207 Partial match: \x0d 7208 \r\r\=ps 7209 Partial match: \x0d\x0d 7210 \r\r\=ph 7211 Partial match: \x0d\x0d 7212 \r\r\r\=ps 7213 Partial match: \x0d\x0d\x0d 7214 \r\r\r\=ph 7215 Partial match: \x0d\x0d\x0d 7216 \r\rx 7217 0: \x0d\x0dx 7218 \r\r\rx 7219 0: \x0d\x0d\x0dx 7220 7221 /^\R?x/ 7222 \r\=ps 7223 Partial match: \x0d 7224 \r\=ph 7225 Partial match: \x0d 7226 x 7227 0: x 7228 \rx 7229 0: \x0dx 7230 7231 /^\R+x/ 7232 \r\=ps 7233 Partial match: \x0d 7234 \r\=ph 7235 Partial match: \x0d 7236 \r\n\=ps 7237 Partial match: \x0d\x0a 7238 \r\n\=ph 7239 Partial match: \x0d\x0a 7240 \rx 7241 0: \x0dx 7242 7243 /^a$/newline=crlf 7244 a\r\=ps 7245 Partial match: a\x0d 7246 a\r\=ph 7247 Partial match: a\x0d 7248 7249 /^a$/m,newline=crlf 7250 a\r\=ps 7251 Partial match: a\x0d 7252 a\r\=ph 7253 Partial match: a\x0d 7254 7255 /^(a$|a\r)/newline=crlf 7256 a\r\=ps 7257 0: a\x0d 7258 a\r\=ph 7259 Partial match: a\x0d 7260 7261 /^(a$|a\r)/m,newline=crlf 7262 a\r\=ps 7263 0: a\x0d 7264 a\r\=ph 7265 Partial match: a\x0d 7266 7267 /./newline=crlf 7268 \r\=ps 7269 0: \x0d 7270 \r\=ph 7271 Partial match: \x0d 7272 7273 /.{2,3}/newline=crlf 7274 \r\=ps 7275 Partial match: \x0d 7276 \r\=ph 7277 Partial match: \x0d 7278 \r\r\=ps 7279 0: \x0d\x0d 7280 \r\r\=ph 7281 Partial match: \x0d\x0d 7282 \r\r\r\=ps 7283 0: \x0d\x0d\x0d 7284 \r\r\r\=ph 7285 Partial match: \x0d\x0d\x0d 7286 7287 /.{2,3}?/newline=crlf 7288 \r\=ps 7289 Partial match: \x0d 7290 \r\=ph 7291 Partial match: \x0d 7292 \r\r\=ps 7293 0: \x0d\x0d 7294 \r\r\=ph 7295 Partial match: \x0d\x0d 7296 \r\r\r\=ps 7297 0: \x0d\x0d\x0d 7298 1: \x0d\x0d 7299 \r\r\r\=ph 7300 Partial match: \x0d\x0d\x0d 7301 7302 # Test simple validity check for restarts 7303 7304 /abcdef/ 7305 abc\=dfa_restart 7306 Failed: error -38: invalid data in workspace for DFA restart 7307 7308 /<H((?(?!<H|F>)(.)|(?R))++)*F>/ 7309 text <H more text <H texting more hexA0-"\xA0" hex above 7F-"\xBC" F> text xxxxx <H text F> text F> text2 <H text sample F> more text. 7310 0: <H more text <H texting more hexA0-"\xa0" hex above 7F-"\xbc" F> text xxxxx <H text F> text F> 7311 7312 /^(?>.{4})abc|^\w\w.xabcd/ 7313 xxxxabcd 7314 0: xxxxabcd 7315 1: xxxxabc 7316 xx\xa0xabcd 7317 0: xx\xa0xabcd 7318 1: xx\xa0xabc 7319 7320 /^(.{4}){2}+abc|^\w\w.x\w\w\w\wabcd/ 7321 xxxxxxxxabcd 7322 0: xxxxxxxxabcd 7323 1: xxxxxxxxabc 7324 xx\xa0xxxxxabcd 7325 0: xx\xa0xxxxxabcd 7326 1: xx\xa0xxxxxabc 7327 7328 /abcd/ 7329 abcd\=ovector=0 7330 0: abcd 7331 7332 # These tests show up auto-possessification 7333 7334 /[ab]*/ 7335 aaaa 7336 0: aaaa 7337 7338 /[ab]*?/ 7339 aaaa 7340 0: aaaa 7341 1: aaa 7342 2: aa 7343 3: a 7344 4: 7345 7346 /[ab]?/ 7347 aaaa 7348 0: a 7349 7350 /[ab]??/ 7351 aaaa 7352 0: a 7353 1: 7354 7355 /[ab]+/ 7356 aaaa 7357 0: aaaa 7358 7359 /[ab]+?/ 7360 aaaa 7361 0: aaaa 7362 1: aaa 7363 2: aa 7364 3: a 7365 7366 /[ab]{2,3}/ 7367 aaaa 7368 0: aaa 7369 7370 /[ab]{2,3}?/ 7371 aaaa 7372 0: aaa 7373 1: aa 7374 7375 /[ab]{2,}/ 7376 aaaa 7377 0: aaaa 7378 7379 /[ab]{2,}?/ 7380 aaaa 7381 0: aaaa 7382 1: aaa 7383 2: aa 7384 7385 '\A(?:[^\"]++|\"(?:[^\"]*+|\"\")*+\")++' 7386 NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED 7387 0: NON QUOTED "QUOT""ED" AFTER 7388 7389 '\A(?:[^\"]++|\"(?:[^\"]++|\"\")*+\")++' 7390 NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED 7391 0: NON QUOTED "QUOT""ED" AFTER 7392 7393 /abc(?=xyz)/allusedtext 7394 abcxyzpqr 7395 0: abcxyz 7396 >>> 7397 abcxyzpqr\=aftertext 7398 0: abcxyz 7399 >>> 7400 0+ xyzpqr 7401 7402 /(?<=pqr)abc(?=xyz)/allusedtext 7403 xyzpqrabcxyzpqr 7404 0: pqrabcxyz 7405 <<< >>> 7406 xyzpqrabcxyzpqr\=aftertext 7407 0: pqrabcxyz 7408 <<< >>> 7409 0+ xyzpqr 7410 7411 /a\b/ 7412 a.\=allusedtext 7413 0: a. 7414 > 7415 a\=allusedtext 7416 0: a 7417 7418 /abc(?=abcde)(?=ab)/allusedtext 7419 abcabcdefg 7420 0: abcabcde 7421 >>>>> 7422 7423 /a*?b*?/ 7424 ab 7425 0: ab 7426 1: a 7427 2: 7428 7429 /(*NOTEMPTY)a*?b*?/ 7430 ab 7431 0: ab 7432 1: a 7433 ba 7434 0: b 7435 cb 7436 0: b 7437 7438 /(*NOTEMPTY_ATSTART)a*?b*?/aftertext 7439 ab 7440 0: ab 7441 0+ 7442 1: a 7443 cdab 7444 0: 7445 0+ dab 7446 7447 /(a)(b)|(c)/ 7448 XcX\=ovector=2,get=1,get=2,get=3,get=4,getall 7449 0: c 7450 Get substring 1 failed (-55): requested value is not set 7451 Get substring 2 failed (-54): requested value is not available 7452 Get substring 3 failed (-54): requested value is not available 7453 Get substring 4 failed (-54): requested value is not available 7454 0L c 7455 7456 /(?<A>aa)/ 7457 aa\=get=A 7458 0: aa 7459 Get substring 'A' failed (-41): function is not supported for DFA matching 7460 aa\=copy=A 7461 0: aa 7462 Copy substring 'A' failed (-41): function is not supported for DFA matching 7463 7464 /a+/no_auto_possess 7465 a\=ovector=2,get=1,get=2,getall 7466 0: a 7467 Get substring 1 failed (-55): requested value is not set 7468 Get substring 2 failed (-54): requested value is not available 7469 0L a 7470 aaa\=ovector=2,get=1,get=2,getall 7471 Matched, but offsets vector is too small to show all matches 7472 0: aaa 7473 1: aa 7474 1G aa (2) 7475 Get substring 2 failed (-54): requested value is not available 7476 0L aaa 7477 1L aa 7478 7479 /a(b)c(d)/ 7480 abc\=ph,copy=0,copy=1,getall 7481 Partial match: abc 7482 0C abc (3) 7483 Copy substring 1 failed (-2): partial match 7484 get substring list failed (-2): partial match 7485 7486 /ab(?C" any text with spaces ")cde/B 7487 ------------------------------------------------------------------ 7488 Bra 7489 ab 7490 CalloutStr " any text with spaces " 6 30 1 7491 cde 7492 Ket 7493 End 7494 ------------------------------------------------------------------ 7495 abcde 7496 Callout (6): " any text with spaces " 7497 --->abcde 7498 ^ ^ c 7499 0: abcde 7500 12abcde 7501 Callout (6): " any text with spaces " 7502 --->12abcde 7503 ^ ^ c 7504 0: abcde 7505 7506 /^a(b)c(?C1)def/ 7507 abcdef 7508 --->abcdef 7509 1 ^ ^ d 7510 0: abcdef 7511 7512 /^a(b)c(?C"AB")def/ 7513 abcdef 7514 Callout (10): "AB" 7515 --->abcdef 7516 ^ ^ d 7517 0: abcdef 7518 7519 /^a(b)c(?C1)def/ 7520 abcdef\=callout_capture 7521 Callout 1: last capture = 0 7522 0: 7523 --->abcdef 7524 ^ ^ d 7525 0: abcdef 7526 7527 /^a(b)c(?C{AB})def/B 7528 ------------------------------------------------------------------ 7529 Bra 7530 ^ 7531 a 7532 CBra 1 7533 b 7534 Ket 7535 c 7536 CalloutStr {AB} 10 14 1 7537 def 7538 Ket 7539 End 7540 ------------------------------------------------------------------ 7541 abcdef\=callout_capture 7542 Callout (10): {AB} last capture = 0 7543 0: 7544 --->abcdef 7545 ^ ^ d 7546 0: abcdef 7547 7548 /^(?(?C25)(?=abc)abcd|xyz)/B 7549 ------------------------------------------------------------------ 7550 Bra 7551 ^ 7552 Cond 7553 Callout 25 9 7 7554 Assert 7555 abc 7556 Ket 7557 abcd 7558 Alt 7559 xyz 7560 Ket 7561 Ket 7562 End 7563 ------------------------------------------------------------------ 7564 abcdefg 7565 --->abcdefg 7566 25 ^ (?=abc) 7567 0: abcd 7568 xyz123 7569 --->xyz123 7570 25 ^ (?=abc) 7571 0: xyz 7572 7573 /^(?(?C$abc$)(?=abc)abcd|xyz)/B 7574 ------------------------------------------------------------------ 7575 Bra 7576 ^ 7577 Cond 7578 CalloutStr $abc$ 7 12 7 7579 Assert 7580 abc 7581 Ket 7582 abcd 7583 Alt 7584 xyz 7585 Ket 7586 Ket 7587 End 7588 ------------------------------------------------------------------ 7589 abcdefg 7590 Callout (7): $abc$ 7591 --->abcdefg 7592 ^ (?=abc) 7593 0: abcd 7594 xyz123 7595 Callout (7): $abc$ 7596 --->xyz123 7597 ^ (?=abc) 7598 0: xyz 7599 7600 /^ab(?C'first')cd(?C"second")ef/ 7601 abcdefg 7602 Callout (7): 'first' 7603 --->abcdefg 7604 ^ ^ c 7605 Callout (20): "second" 7606 --->abcdefg 7607 ^ ^ e 7608 0: abcdef 7609 7610 /(?:a(?C`code`)){3}X/ 7611 aaaXY 7612 Callout (8): `code` 7613 --->aaaXY 7614 ^^ ) 7615 Callout (8): `code` 7616 --->aaaXY 7617 ^ ^ ) 7618 Callout (8): `code` 7619 --->aaaXY 7620 ^ ^ ) 7621 0: aaaX 7622 7623 # Binary zero in callout string 7624 /"a(?C'x" 00 "z')b"/hex 7625 abcdefgh 7626 Callout (5): 'x\x00z' 7627 --->abcdefgh 7628 ^^ b 7629 0: ab 7630 7631 /(?(?!)a|b)/ 7632 bbb 7633 0: b 7634 \= Expect no match 7635 aaa 7636 No match 7637 7638 /^/gm 7639 \n\n\n 7640 0: 7641 0: 7642 0: 7643 7644 /^/gm,alt_circumflex 7645 \n\n\n 7646 0: 7647 0: 7648 0: 7649 0: 7650 7651 /abc/use_offset_limit 7652 1234abcde\=offset_limit=100 7653 0: abc 7654 1234abcde\=offset_limit=9 7655 0: abc 7656 1234abcde\=offset_limit=4 7657 0: abc 7658 1234abcde\=offset_limit=4,offset=4 7659 0: abc 7660 \= Expect no match 7661 1234abcde\=offset_limit=4,offset=5 7662 No match 7663 1234abcde\=offset_limit=3 7664 No match 7665 7666 /(?<=abc)/use_offset_limit 7667 1234abc\=offset_limit=7 7668 0: 7669 \= Expect no match 7670 1234abc\=offset_limit=6 7671 No match 7672 7673 /abcd/null_context 7674 abcd\=null_context 7675 0: abcd 7676 7677 /()()a+/no_auto_possess 7678 aaa\=dfa,allcaptures 7679 ** Ignored after DFA matching: allcaptures 7680 0: aaa 7681 1: aa 7682 2: a 7683 a\=dfa,allcaptures 7684 ** Ignored after DFA matching: allcaptures 7685 0: a 7686 7687 # End of testinput6 7688