Home | History | Annotate | Download | only in testdata
      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 ^          (
    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 ^     ^    End of pattern
    730  +1 ^     ^    a
    731  +4 ^     ^    c
    732  0: ababab
    733   abcdabcd
    734 --->abcdabcd
    735  +0 ^            (
    736  +1 ^            a
    737  +4 ^            c
    738  +2 ^^           b
    739  +3 ^ ^          |
    740  +1 ^ ^          a
    741  +4 ^ ^          c
    742  +5 ^  ^         d
    743  +6 ^   ^        ){3,4}
    744  +1 ^   ^        a
    745  +4 ^   ^        c
    746  +2 ^    ^       b
    747  +3 ^     ^      |
    748 +12 ^     ^      End of pattern
    749  +1 ^     ^      a
    750  +4 ^     ^      c
    751  +5 ^      ^     d
    752  +6 ^       ^    ){3,4}
    753 +12 ^       ^    End of pattern
    754  0: abcdabcd
    755  1: abcdab
    756   abcdcdcdcdcd  
    757 --->abcdcdcdcdcd
    758  +0 ^                (
    759  +1 ^                a
    760  +4 ^                c
    761  +2 ^^               b
    762  +3 ^ ^              |
    763  +1 ^ ^              a
    764  +4 ^ ^              c
    765  +5 ^  ^             d
    766  +6 ^   ^            ){3,4}
    767  +1 ^   ^            a
    768  +4 ^   ^            c
    769  +5 ^    ^           d
    770  +6 ^     ^          ){3,4}
    771 +12 ^     ^          End of pattern
    772  +1 ^     ^          a
    773  +4 ^     ^          c
    774  +5 ^      ^         d
    775  +6 ^       ^        ){3,4}
    776 +12 ^       ^        End of pattern
    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 /\x5c/
   2679     \\
   2680  0: \
   2681 
   2682 /\x20Z/
   2683     the Zoo
   2684  0:  Z
   2685 \= Expect no match
   2686     Zulu
   2687 No match
   2688 
   2689 /ab{3cd/
   2690     ab{3cd
   2691  0: ab{3cd
   2692 
   2693 /ab{3,cd/
   2694     ab{3,cd
   2695  0: ab{3,cd
   2696 
   2697 /ab{3,4a}cd/
   2698     ab{3,4a}cd
   2699  0: ab{3,4a}cd
   2700 
   2701 /{4,5a}bc/
   2702     {4,5a}bc
   2703  0: {4,5a}bc
   2704 
   2705 /^a.b/newline=lf
   2706     a\rb
   2707  0: a\x0db
   2708 \= Expect no match
   2709     a\nb
   2710 No match
   2711 
   2712 /abc$/
   2713     abc
   2714  0: abc
   2715     abc\n
   2716  0: abc
   2717 \= Expect no match
   2718     abc\ndef
   2719 No match
   2720 
   2721 /(abc)\123/
   2722     abc\x53
   2723  0: abcS
   2724 
   2725 /(abc)\223/
   2726     abc\x93
   2727  0: abc\x93
   2728 
   2729 /(abc)\323/
   2730     abc\xd3
   2731  0: abc\xd3
   2732 
   2733 /(abc)\100/
   2734     abc\x40
   2735  0: abc@
   2736     abc\100
   2737  0: abc@
   2738 
   2739 /(abc)\1000/
   2740     abc\x400
   2741  0: abc@0
   2742     abc\x40\x30
   2743  0: abc@0
   2744     abc\1000
   2745  0: abc@0
   2746     abc\100\x30
   2747  0: abc@0
   2748     abc\100\060
   2749  0: abc@0
   2750     abc\100\60
   2751  0: abc@0
   2752 
   2753 /(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\123/
   2754     abcdefghijk\12S
   2755  0: abcdefghijk\x0aS
   2756 
   2757 /a{0}bc/
   2758     bc
   2759  0: bc
   2760 
   2761 /(a|(bc)){0,0}?xyz/
   2762     xyz
   2763  0: xyz
   2764 
   2765 /abc[\10]de/
   2766     abc\010de
   2767  0: abc\x08de
   2768 
   2769 /abc[\1]de/
   2770     abc\1de
   2771  0: abc\x01de
   2772 
   2773 /(abc)[\1]de/
   2774     abc\1de
   2775  0: abc\x01de
   2776 
   2777 /(?s)a.b/
   2778     a\nb
   2779  0: a\x0ab
   2780 
   2781 /^([^a])([^\b])([^c]*)([^d]{3,4})/
   2782     baNOTccccd
   2783  0: baNOTcccc
   2784  1: baNOTccc
   2785  2: baNOTcc
   2786  3: baNOTc
   2787     baNOTcccd
   2788  0: baNOTccc
   2789  1: baNOTcc
   2790  2: baNOTc
   2791     baNOTccd
   2792  0: baNOTcc
   2793  1: baNOTc
   2794     bacccd
   2795  0: baccc
   2796 \= Expect no match
   2797     anything
   2798 No match
   2799     b\bc   
   2800 No match
   2801     baccd
   2802 No match
   2803 
   2804 /[^a]/
   2805     Abc
   2806  0: A
   2807   
   2808 /[^a]/i
   2809     Abc 
   2810  0: b
   2811 
   2812 /[^a]+/
   2813     AAAaAbc
   2814  0: AAA
   2815   
   2816 /[^a]+/i
   2817     AAAaAbc 
   2818  0: bc
   2819 
   2820 /[^a]+/
   2821     bbb\nccc
   2822  0: bbb\x0accc
   2823    
   2824 /[^k]$/
   2825     abc
   2826  0: c
   2827 \= Expect no match
   2828     abk   
   2829 No match
   2830    
   2831 /[^k]{2,3}$/
   2832     abc
   2833  0: abc
   2834     kbc
   2835  0: bc
   2836     kabc 
   2837  0: abc
   2838 \= Expect no match
   2839     abk
   2840 No match
   2841     akb
   2842 No match
   2843     akk 
   2844 No match
   2845 
   2846 /^\d{8,}\@.+[^k]$/
   2847     12345678\@a.b.c.d
   2848  0: 12345678 (a] a.b.c.d
   2849     123456789\@x.y.z
   2850  0: 123456789 (a] x.y.z
   2851 \= Expect no match
   2852     12345678\@x.y.uk
   2853 No match
   2854     1234567\@a.b.c.d       
   2855 No match
   2856 
   2857 /[^a]/
   2858     aaaabcd
   2859  0: b
   2860     aaAabcd 
   2861  0: A
   2862 
   2863 /[^a]/i
   2864     aaaabcd
   2865  0: b
   2866     aaAabcd 
   2867  0: b
   2868 
   2869 /[^az]/
   2870     aaaabcd
   2871  0: b
   2872     aaAabcd 
   2873  0: A
   2874 
   2875 /[^az]/i
   2876     aaaabcd
   2877  0: b
   2878     aaAabcd 
   2879  0: b
   2880 
   2881 /\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/
   2882  \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
   2883  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
   2884 
   2885 /P[^*]TAIRE[^*]{1,6}?LL/
   2886     xxxxxxxxxxxPSTAIREISLLxxxxxxxxx
   2887  0: PSTAIREISLL
   2888 
   2889 /P[^*]TAIRE[^*]{1,}?LL/
   2890     xxxxxxxxxxxPSTAIREISLLxxxxxxxxx
   2891  0: PSTAIREISLL
   2892 
   2893 /(\.\d\d[1-9]?)\d+/
   2894     1.230003938
   2895  0: .230003938
   2896     1.875000282   
   2897  0: .875000282
   2898     1.235  
   2899  0: .235
   2900                   
   2901 /(\.\d\d((?=0)|\d(?=\d)))/
   2902     1.230003938      
   2903  0: .230
   2904  1: .23
   2905     1.875000282
   2906  0: .875
   2907 \= Expect no match 
   2908     1.235 
   2909 No match
   2910     
   2911 /a(?)b/
   2912     ab 
   2913  0: ab
   2914  
   2915 /\b(foo)\s+(\w+)/i
   2916     Food is on the foo table
   2917  0: foo table
   2918     
   2919 /foo(.*)bar/
   2920     The food is under the bar in the barn.
   2921  0: food is under the bar in the bar
   2922  1: food is under the bar
   2923     
   2924 /foo(.*?)bar/
   2925     The food is under the bar in the barn.
   2926  0: food is under the bar in the bar
   2927  1: food is under the bar
   2928 
   2929 /(.*)(\d*)/no_auto_possess
   2930     I have 2 numbers: 53147
   2931 Matched, but offsets vector is too small to show all matches
   2932  0: I have 2 numbers: 53147
   2933  1: I have 2 numbers: 5314
   2934  2: I have 2 numbers: 531
   2935  3: I have 2 numbers: 53
   2936  4: I have 2 numbers: 5
   2937  5: I have 2 numbers: 
   2938  6: I have 2 numbers:
   2939  7: I have 2 numbers
   2940  8: I have 2 number
   2941  9: I have 2 numbe
   2942 10: I have 2 numb
   2943 11: I have 2 num
   2944 12: I have 2 nu
   2945 13: I have 2 n
   2946 14: I have 2 
   2947     
   2948 /(.*)(\d+)/
   2949     I have 2 numbers: 53147
   2950  0: I have 2 numbers: 53147
   2951  1: I have 2
   2952  
   2953 /(.*?)(\d*)/no_auto_possess
   2954     I have 2 numbers: 53147
   2955 Matched, but offsets vector is too small to show all matches
   2956  0: I have 2 numbers: 53147
   2957  1: I have 2 numbers: 5314
   2958  2: I have 2 numbers: 531
   2959  3: I have 2 numbers: 53
   2960  4: I have 2 numbers: 5
   2961  5: I have 2 numbers: 
   2962  6: I have 2 numbers:
   2963  7: I have 2 numbers
   2964  8: I have 2 number
   2965  9: I have 2 numbe
   2966 10: I have 2 numb
   2967 11: I have 2 num
   2968 12: I have 2 nu
   2969 13: I have 2 n
   2970 14: I have 2 
   2971 
   2972 /(.*?)(\d+)/
   2973     I have 2 numbers: 53147
   2974  0: I have 2 numbers: 53147
   2975  1: I have 2
   2976 
   2977 /(.*)(\d+)$/
   2978     I have 2 numbers: 53147
   2979  0: I have 2 numbers: 53147
   2980 
   2981 /(.*?)(\d+)$/
   2982     I have 2 numbers: 53147
   2983  0: I have 2 numbers: 53147
   2984 
   2985 /(.*)\b(\d+)$/
   2986     I have 2 numbers: 53147
   2987  0: I have 2 numbers: 53147
   2988 
   2989 /(.*\D)(\d+)$/
   2990     I have 2 numbers: 53147
   2991  0: I have 2 numbers: 53147
   2992 
   2993 /^\D*(?!123)/
   2994     ABC123
   2995  0: AB
   2996  1: A
   2997  2: 
   2998      
   2999 /^(\D*)(?=\d)(?!123)/
   3000     ABC445
   3001  0: ABC
   3002 \= Expect no match
   3003     ABC123
   3004 No match
   3005     
   3006 /^[W-]46]/
   3007     W46]789 
   3008  0: W46]
   3009     -46]789
   3010  0: -46]
   3011 \= Expect no match
   3012     Wall
   3013 No match
   3014     Zebra
   3015 No match
   3016     42
   3017 No match
   3018     [abcd] 
   3019 No match
   3020     ]abcd[
   3021 No match
   3022        
   3023 /^[W-\]46]/
   3024     W46]789 
   3025  0: W
   3026     Wall
   3027  0: W
   3028     Zebra
   3029  0: Z
   3030     Xylophone  
   3031  0: X
   3032     42
   3033  0: 4
   3034     [abcd] 
   3035  0: [
   3036     ]abcd[
   3037  0: ]
   3038     \\backslash 
   3039  0: \
   3040 \= Expect no match
   3041     -46]789
   3042 No match
   3043     well
   3044 No match
   3045     
   3046 /\d\d\/\d\d\/\d\d\d\d/
   3047     01/01/2000
   3048  0: 01/01/2000
   3049 
   3050 /word (?:[a-zA-Z0-9]+ ){0,10}otherword/
   3051   word cat dog elephant mussel cow horse canary baboon snake shark otherword
   3052  0: word cat dog elephant mussel cow horse canary baboon snake shark otherword
   3053 \= Expect no match
   3054   word cat dog elephant mussel cow horse canary baboon snake shark
   3055 No match
   3056 
   3057 /word (?:[a-zA-Z0-9]+ ){0,300}otherword/
   3058 \= Expect no match
   3059   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
   3060 No match
   3061 
   3062 /^(a){0,0}/
   3063     bcd
   3064  0: 
   3065     abc
   3066  0: 
   3067     aab     
   3068  0: 
   3069 
   3070 /^(a){0,1}/
   3071     bcd
   3072  0: 
   3073     abc
   3074  0: a
   3075  1: 
   3076     aab  
   3077  0: a
   3078  1: 
   3079 
   3080 /^(a){0,2}/
   3081     bcd
   3082  0: 
   3083     abc
   3084  0: a
   3085  1: 
   3086     aab  
   3087  0: aa
   3088  1: a
   3089  2: 
   3090 
   3091 /^(a){0,3}/
   3092     bcd
   3093  0: 
   3094     abc
   3095  0: a
   3096  1: 
   3097     aab
   3098  0: aa
   3099  1: a
   3100  2: 
   3101     aaa   
   3102  0: aaa
   3103  1: aa
   3104  2: a
   3105  3: 
   3106 
   3107 /^(a){0,}/
   3108     bcd
   3109  0: 
   3110     abc
   3111  0: a
   3112  1: 
   3113     aab
   3114  0: aa
   3115  1: a
   3116  2: 
   3117     aaa
   3118  0: aaa
   3119  1: aa
   3120  2: a
   3121  3: 
   3122     aaaaaaaa    
   3123  0: aaaaaaaa
   3124  1: aaaaaaa
   3125  2: aaaaaa
   3126  3: aaaaa
   3127  4: aaaa
   3128  5: aaa
   3129  6: aa
   3130  7: a
   3131  8: 
   3132 
   3133 /^(a){1,1}/
   3134     abc
   3135  0: a
   3136     aab  
   3137  0: a
   3138 \= Expect no match
   3139     bcd
   3140 No match
   3141 
   3142 /^(a){1,2}/
   3143     abc
   3144  0: a
   3145     aab  
   3146  0: aa
   3147  1: a
   3148 \= Expect no match
   3149     bcd
   3150 No match
   3151 
   3152 /^(a){1,3}/
   3153     abc
   3154  0: a
   3155     aab
   3156  0: aa
   3157  1: a
   3158     aaa   
   3159  0: aaa
   3160  1: aa
   3161  2: a
   3162 \= Expect no match
   3163     bcd
   3164 No match
   3165 
   3166 /^(a){1,}/
   3167     abc
   3168  0: a
   3169     aab
   3170  0: aa
   3171  1: a
   3172     aaa
   3173  0: aaa
   3174  1: aa
   3175  2: a
   3176     aaaaaaaa    
   3177  0: aaaaaaaa
   3178  1: aaaaaaa
   3179  2: aaaaaa
   3180  3: aaaaa
   3181  4: aaaa
   3182  5: aaa
   3183  6: aa
   3184  7: a
   3185 \= Expect no match
   3186     bcd
   3187 No match
   3188 
   3189 /.*\.gif/
   3190     borfle\nbib.gif\nno
   3191  0: bib.gif
   3192 
   3193 /.{0,}\.gif/
   3194     borfle\nbib.gif\nno
   3195  0: bib.gif
   3196 
   3197 /.*\.gif/m
   3198     borfle\nbib.gif\nno
   3199  0: bib.gif
   3200 
   3201 /.*\.gif/s
   3202     borfle\nbib.gif\nno
   3203  0: borfle\x0abib.gif
   3204 
   3205 /.*\.gif/ms
   3206     borfle\nbib.gif\nno
   3207  0: borfle\x0abib.gif
   3208     
   3209 /.*$/
   3210     borfle\nbib.gif\nno
   3211  0: no
   3212 
   3213 /.*$/m
   3214     borfle\nbib.gif\nno
   3215  0: borfle
   3216 
   3217 /.*$/s
   3218     borfle\nbib.gif\nno
   3219  0: borfle\x0abib.gif\x0ano
   3220 
   3221 /.*$/ms
   3222     borfle\nbib.gif\nno
   3223  0: borfle\x0abib.gif\x0ano
   3224  1: borfle\x0abib.gif
   3225  2: borfle
   3226     
   3227 /.*$/
   3228     borfle\nbib.gif\nno\n
   3229  0: no
   3230 
   3231 /.*$/m
   3232     borfle\nbib.gif\nno\n
   3233  0: borfle
   3234 
   3235 /.*$/s
   3236     borfle\nbib.gif\nno\n
   3237  0: borfle\x0abib.gif\x0ano\x0a
   3238  1: borfle\x0abib.gif\x0ano
   3239 
   3240 /.*$/ms
   3241     borfle\nbib.gif\nno\n
   3242  0: borfle\x0abib.gif\x0ano\x0a
   3243  1: borfle\x0abib.gif\x0ano
   3244  2: borfle\x0abib.gif
   3245  3: borfle
   3246     
   3247 /(.*X|^B)/
   3248     abcde\n1234Xyz
   3249  0: 1234X
   3250     BarFoo 
   3251  0: B
   3252 \= Expect no match
   3253     abcde\nBar  
   3254 No match
   3255 
   3256 /(.*X|^B)/m
   3257     abcde\n1234Xyz
   3258  0: 1234X
   3259     BarFoo 
   3260  0: B
   3261     abcde\nBar  
   3262  0: B
   3263 
   3264 /(.*X|^B)/s
   3265     abcde\n1234Xyz
   3266  0: abcde\x0a1234X
   3267     BarFoo 
   3268  0: B
   3269 \= Expect no match
   3270     abcde\nBar  
   3271 No match
   3272 
   3273 /(.*X|^B)/ms
   3274     abcde\n1234Xyz
   3275  0: abcde\x0a1234X
   3276     BarFoo 
   3277  0: B
   3278     abcde\nBar  
   3279  0: B
   3280 
   3281 /(?s)(.*X|^B)/
   3282     abcde\n1234Xyz
   3283  0: abcde\x0a1234X
   3284     BarFoo 
   3285  0: B
   3286 \= Expect no match 
   3287     abcde\nBar  
   3288 No match
   3289 
   3290 /(?s:.*X|^B)/
   3291     abcde\n1234Xyz
   3292  0: abcde\x0a1234X
   3293     BarFoo 
   3294  0: B
   3295 \= Expect no match 
   3296     abcde\nBar  
   3297 No match
   3298 
   3299 /^.*B/
   3300 \= Expect no match
   3301     abc\nB
   3302 No match
   3303      
   3304 /(?s)^.*B/
   3305     abc\nB
   3306  0: abc\x0aB
   3307 
   3308 /(?m)^.*B/
   3309     abc\nB
   3310  0: B
   3311      
   3312 /(?ms)^.*B/
   3313     abc\nB
   3314  0: abc\x0aB
   3315 
   3316 /(?ms)^B/
   3317     abc\nB
   3318  0: B
   3319 
   3320 /(?s)B$/
   3321     B\n
   3322  0: B
   3323 
   3324 /^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/
   3325     123456654321
   3326  0: 123456654321
   3327   
   3328 /^\d\d\d\d\d\d\d\d\d\d\d\d/
   3329     123456654321 
   3330  0: 123456654321
   3331 
   3332 /^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/
   3333     123456654321
   3334  0: 123456654321
   3335   
   3336 /^[abc]{12}/
   3337     abcabcabcabc
   3338  0: abcabcabcabc
   3339     
   3340 /^[a-c]{12}/
   3341     abcabcabcabc
   3342  0: abcabcabcabc
   3343     
   3344 /^(a|b|c){12}/
   3345     abcabcabcabc 
   3346  0: abcabcabcabc
   3347 
   3348 /^[abcdefghijklmnopqrstuvwxy0123456789]/
   3349     n
   3350  0: n
   3351 \= Expect no match 
   3352     z 
   3353 No match
   3354 
   3355 /abcde{0,0}/
   3356     abcd
   3357  0: abcd
   3358 \= Expect no match
   3359     abce  
   3360 No match
   3361 
   3362 /ab[cd]{0,0}e/
   3363     abe
   3364  0: abe
   3365 \= Expect no match
   3366     abcde 
   3367 No match
   3368     
   3369 /ab(c){0,0}d/
   3370     abd
   3371  0: abd
   3372 \= Expect no match
   3373     abcd   
   3374 No match
   3375 
   3376 /a(b*)/
   3377     a
   3378  0: a
   3379     ab
   3380  0: ab
   3381     abbbb
   3382  0: abbbb
   3383 \= Expect no match
   3384     bbbbb    
   3385 No match
   3386     
   3387 /ab\d{0}e/
   3388     abe
   3389  0: abe
   3390 \= Expect no match
   3391     ab1e   
   3392 No match
   3393     
   3394 /"([^\\"]+|\\.)*"/
   3395     the \"quick\" brown fox
   3396  0: "quick"
   3397     \"the \\\"quick\\\" brown fox\" 
   3398  0: "the \"quick\" brown fox"
   3399 
   3400 /.*?/g,aftertext
   3401     abc
   3402  0: abc
   3403  0+ 
   3404  1: ab
   3405  2: a
   3406  3: 
   3407  0: 
   3408  0+ 
   3409   
   3410 /\b/g,aftertext
   3411     abc 
   3412  0: 
   3413  0+ abc
   3414  0: 
   3415  0+ 
   3416 
   3417 /\b/g,aftertext
   3418     abc 
   3419  0: 
   3420  0+ abc
   3421  0: 
   3422  0+ 
   3423 
   3424 //g
   3425     abc
   3426  0: 
   3427  0: 
   3428  0: 
   3429  0: 
   3430 
   3431 /<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
   3432   <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>
   3433  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>
   3434 
   3435 /a[^a]b/
   3436     acb
   3437  0: acb
   3438     a\nb
   3439  0: a\x0ab
   3440     
   3441 /a.b/
   3442     acb
   3443  0: acb
   3444 \= Expect no match 
   3445     a\nb   
   3446 No match
   3447     
   3448 /a[^a]b/s
   3449     acb
   3450  0: acb
   3451     a\nb  
   3452  0: a\x0ab
   3453     
   3454 /a.b/s
   3455     acb
   3456  0: acb
   3457     a\nb  
   3458  0: a\x0ab
   3459 
   3460 /^(b+?|a){1,2}?c/
   3461     bac
   3462  0: bac
   3463     bbac
   3464  0: bbac
   3465     bbbac
   3466  0: bbbac
   3467     bbbbac
   3468  0: bbbbac
   3469     bbbbbac 
   3470  0: bbbbbac
   3471 
   3472 /^(b+|a){1,2}?c/
   3473     bac
   3474  0: bac
   3475     bbac
   3476  0: bbac
   3477     bbbac
   3478  0: bbbac
   3479     bbbbac
   3480  0: bbbbac
   3481     bbbbbac 
   3482  0: bbbbbac
   3483     
   3484 /(?!\A)x/m
   3485     a\bx\n  
   3486  0: x
   3487 \= Expect no match
   3488     x\nb\n
   3489 No match
   3490     
   3491 /\x0{ab}/
   3492     \0{ab} 
   3493  0: \x00{ab}
   3494 
   3495 /(A|B)*?CD/
   3496     CD 
   3497  0: CD
   3498     
   3499 /(A|B)*CD/
   3500     CD 
   3501  0: CD
   3502 
   3503 /(?<!bar)foo/
   3504     foo
   3505  0: foo
   3506     catfood
   3507  0: foo
   3508     arfootle
   3509  0: foo
   3510     rfoosh
   3511  0: foo
   3512 \= Expect no match
   3513     barfoo
   3514 No match
   3515     towbarfoo
   3516 No match
   3517 
   3518 /\w{3}(?<!bar)foo/
   3519     catfood
   3520  0: catfoo
   3521 \= Expect no match
   3522     foo
   3523 No match
   3524     barfoo
   3525 No match
   3526     towbarfoo
   3527 No match
   3528 
   3529 /(?<=(foo)a)bar/
   3530     fooabar
   3531  0: bar
   3532 \= Expect no match
   3533     bar
   3534 No match
   3535     foobbar
   3536 No match
   3537       
   3538 /\Aabc\z/m
   3539     abc
   3540  0: abc
   3541 \= Expect no match
   3542     abc\n   
   3543 No match
   3544     qqq\nabc
   3545 No match
   3546     abc\nzzz
   3547 No match
   3548     qqq\nabc\nzzz
   3549 No match
   3550 
   3551 "(?>.*/)foo"
   3552 \= Expect no match
   3553     /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/
   3554 No match
   3555 
   3556 "(?>.*/)foo"
   3557     /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo
   3558  0: /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo
   3559 
   3560 /(?>(\.\d\d[1-9]?))\d+/
   3561     1.230003938
   3562  0: .230003938
   3563     1.875000282
   3564  0: .875000282
   3565 \= Expect no match 
   3566     1.235 
   3567 No match
   3568 
   3569 /^((?>\w+)|(?>\s+))*$/
   3570     now is the time for all good men to come to the aid of the party
   3571  0: now is the time for all good men to come to the aid of the party
   3572 \= Expect no match
   3573     this is not a line with only words and spaces!
   3574 No match
   3575     
   3576 /(\d+)(\w)/
   3577     12345a
   3578  0: 12345a
   3579  1: 12345
   3580  2: 1234
   3581  3: 123
   3582  4: 12
   3583     12345+ 
   3584  0: 12345
   3585  1: 1234
   3586  2: 123
   3587  3: 12
   3588 
   3589 /((?>\d+))(\w)/
   3590     12345a
   3591  0: 12345a
   3592 \= Expect no match
   3593     12345+ 
   3594 No match
   3595 
   3596 /(?>a+)b/
   3597     aaab
   3598  0: aaab
   3599 
   3600 /((?>a+)b)/
   3601     aaab
   3602  0: aaab
   3603 
   3604 /(?>(a+))b/
   3605     aaab
   3606  0: aaab
   3607 
   3608 /(?>b)+/
   3609     aaabbbccc
   3610  0: bbb
   3611  1: bb
   3612  2: b
   3613 
   3614 /(?>a+|b+|c+)*c/
   3615     aaabbbbccccd
   3616  0: aaabbbbcccc
   3617  1: aaabbbbc
   3618     
   3619 /(a+|b+|c+)*c/
   3620     aaabbbbccccd
   3621  0: aaabbbbcccc
   3622  1: aaabbbbccc
   3623  2: aaabbbbcc
   3624  3: aaabbbbc
   3625 
   3626 /((?>[^()]+)|\([^()]*\))+/
   3627     ((abc(ade)ufh()()x
   3628  0: abc(ade)ufh()()x
   3629  1: abc(ade)ufh()()
   3630  2: abc(ade)ufh()
   3631  3: abc(ade)ufh
   3632  4: abc(ade)
   3633  5: abc
   3634     
   3635 /\(((?>[^()]+)|\([^()]+\))+\)/
   3636     (abc)
   3637  0: (abc)
   3638     (abc(def)xyz)
   3639  0: (abc(def)xyz)
   3640 \= Expect no match
   3641     ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa   
   3642 No match
   3643 
   3644 /a(?-i)b/i
   3645     ab
   3646  0: ab
   3647     Ab
   3648  0: Ab
   3649 \= Expect no match 
   3650     aB
   3651 No match
   3652     AB
   3653 No match
   3654         
   3655 /(a (?x)b c)d e/
   3656     a bcd e
   3657  0: a bcd e
   3658 \= Expect no match
   3659     a b cd e
   3660 No match
   3661     abcd e   
   3662 No match
   3663     a bcde 
   3664 No match
   3665  
   3666 /(a b(?x)c d (?-x)e f)/
   3667     a bcde f
   3668  0: a bcde f
   3669 \= Expect no match
   3670     abcdef  
   3671 No match
   3672 
   3673 /(a(?i)b)c/
   3674     abc
   3675  0: abc
   3676     aBc
   3677  0: aBc
   3678 \= Expect no match
   3679     abC
   3680 No match
   3681     aBC  
   3682 No match
   3683     Abc
   3684 No match
   3685     ABc
   3686 No match
   3687     ABC
   3688 No match
   3689     AbC
   3690 No match
   3691     
   3692 /a(?i:b)c/
   3693     abc
   3694  0: abc
   3695     aBc
   3696  0: aBc
   3697 \= Expect no match 
   3698     ABC
   3699 No match
   3700     abC
   3701 No match
   3702     aBC
   3703 No match
   3704     
   3705 /a(?i:b)*c/
   3706     aBc
   3707  0: aBc
   3708     aBBc
   3709  0: aBBc
   3710 \= Expect no match 
   3711     aBC
   3712 No match
   3713     aBBC
   3714 No match
   3715     
   3716 /a(?=b(?i)c)\w\wd/
   3717     abcd
   3718  0: abcd
   3719     abCd
   3720  0: abCd
   3721 \= Expect no match
   3722     aBCd
   3723 No match
   3724     abcD     
   3725 No match
   3726     
   3727 /(?s-i:more.*than).*million/i
   3728     more than million
   3729  0: more than million
   3730     more than MILLION
   3731  0: more than MILLION
   3732     more \n than Million 
   3733  0: more \x0a than Million
   3734 \= Expect no match
   3735     MORE THAN MILLION    
   3736 No match
   3737     more \n than \n million 
   3738 No match
   3739 
   3740 /(?:(?s-i)more.*than).*million/i
   3741     more than million
   3742  0: more than million
   3743     more than MILLION
   3744  0: more than MILLION
   3745     more \n than Million 
   3746  0: more \x0a than Million
   3747 \= Expect no match
   3748     MORE THAN MILLION    
   3749 No match
   3750     more \n than \n million 
   3751 No match
   3752     
   3753 /(?>a(?i)b+)+c/
   3754     abc
   3755  0: abc
   3756     aBbc
   3757  0: aBbc
   3758     aBBc 
   3759  0: aBBc
   3760 \= Expect no match
   3761     Abc
   3762 No match
   3763     abAb    
   3764 No match
   3765     abbC 
   3766 No match
   3767     
   3768 /(?=a(?i)b)\w\wc/
   3769     abc
   3770  0: abc
   3771     aBc
   3772  0: aBc
   3773 \= Expect no match
   3774     Ab 
   3775 No match
   3776     abC
   3777 No match
   3778     aBC     
   3779 No match
   3780     
   3781 /(?<=a(?i)b)(\w\w)c/
   3782     abxxc
   3783  0: xxc
   3784     aBxxc
   3785  0: xxc
   3786 \= Expect no match
   3787     Abxxc
   3788 No match
   3789     ABxxc
   3790 No match
   3791     abxxC      
   3792 No match
   3793 
   3794 /^(?(?=abc)\w{3}:|\d\d)$/
   3795     abc:
   3796  0: abc:
   3797     12
   3798  0: 12
   3799 \= Expect no match
   3800     123
   3801 No match
   3802     xyz    
   3803 No match
   3804 
   3805 /^(?(?!abc)\d\d|\w{3}:)$/
   3806     abc:
   3807  0: abc:
   3808     12
   3809  0: 12
   3810 \= Expect no match
   3811     123
   3812 No match
   3813     xyz    
   3814 No match
   3815     
   3816 /(?(?<=foo)bar|cat)/
   3817     foobar
   3818  0: bar
   3819     cat
   3820  0: cat
   3821     fcat
   3822  0: cat
   3823     focat   
   3824  0: cat
   3825 \= Expect no match
   3826     foocat  
   3827 No match
   3828 
   3829 /(?(?<!foo)cat|bar)/
   3830     foobar
   3831  0: bar
   3832     cat
   3833  0: cat
   3834     fcat
   3835  0: cat
   3836     focat   
   3837  0: cat
   3838 \= Expect no match
   3839     foocat  
   3840 No match
   3841 
   3842 /(?>a*)*/
   3843     a
   3844  0: a
   3845  1: 
   3846     aa
   3847  0: aa
   3848  1: 
   3849     aaaa
   3850  0: aaaa
   3851  1: 
   3852     
   3853 /(abc|)+/
   3854     abc
   3855  0: abc
   3856  1: 
   3857     abcabc
   3858  0: abcabc
   3859  1: abc
   3860  2: 
   3861     abcabcabc
   3862  0: abcabcabc
   3863  1: abcabc
   3864  2: abc
   3865  3: 
   3866     xyz      
   3867  0: 
   3868 
   3869 /([a]*)*/
   3870     a
   3871  0: a
   3872  1: 
   3873     aaaaa 
   3874  0: aaaaa
   3875  1: aaaa
   3876  2: aaa
   3877  3: aa
   3878  4: a
   3879  5: 
   3880  
   3881 /([ab]*)*/
   3882     a
   3883  0: a
   3884  1: 
   3885     b
   3886  0: b
   3887  1: 
   3888     ababab
   3889  0: ababab
   3890  1: ababa
   3891  2: abab
   3892  3: aba
   3893  4: ab
   3894  5: a
   3895  6: 
   3896     aaaabcde
   3897  0: aaaab
   3898  1: aaaa
   3899  2: aaa
   3900  3: aa
   3901  4: a
   3902  5: 
   3903     bbbb    
   3904  0: bbbb
   3905  1: bbb
   3906  2: bb
   3907  3: b
   3908  4: 
   3909  
   3910 /([^a]*)*/
   3911     b
   3912  0: b
   3913  1: 
   3914     bbbb
   3915  0: bbbb
   3916  1: bbb
   3917  2: bb
   3918  3: b
   3919  4: 
   3920     aaa   
   3921  0: 
   3922  
   3923 /([^ab]*)*/
   3924     cccc
   3925  0: cccc
   3926  1: ccc
   3927  2: cc
   3928  3: c
   3929  4: 
   3930     abab  
   3931  0: 
   3932  
   3933 /([a]*?)*/
   3934     a
   3935  0: a
   3936  1: 
   3937     aaaa 
   3938  0: aaaa
   3939  1: aaa
   3940  2: aa
   3941  3: a
   3942  4: 
   3943  
   3944 /([ab]*?)*/
   3945     a
   3946  0: a
   3947  1: 
   3948     b
   3949  0: b
   3950  1: 
   3951     abab
   3952  0: abab
   3953  1: aba
   3954  2: ab
   3955  3: a
   3956  4: 
   3957     baba   
   3958  0: baba
   3959  1: bab
   3960  2: ba
   3961  3: b
   3962  4: 
   3963  
   3964 /([^a]*?)*/
   3965     b
   3966  0: b
   3967  1: 
   3968     bbbb
   3969  0: bbbb
   3970  1: bbb
   3971  2: bb
   3972  3: b
   3973  4: 
   3974     aaa   
   3975  0: 
   3976  
   3977 /([^ab]*?)*/
   3978     c
   3979  0: c
   3980  1: 
   3981     cccc
   3982  0: cccc
   3983  1: ccc
   3984  2: cc
   3985  3: c
   3986  4: 
   3987     baba   
   3988  0: 
   3989  
   3990 /(?>a*)*/
   3991     a
   3992  0: a
   3993  1: 
   3994     aaabcde 
   3995  0: aaa
   3996  1: 
   3997  
   3998 /((?>a*))*/
   3999     aaaaa
   4000  0: aaaaa
   4001  1: 
   4002     aabbaa 
   4003  0: aa
   4004  1: 
   4005  
   4006 /((?>a*?))*/
   4007     aaaaa
   4008  0: aaaaa
   4009  1: 
   4010     aabbaa 
   4011  0: aa
   4012  1: 
   4013 
   4014 /(?(?=[^a-z]+[a-z])  \d{2}-[a-z]{3}-\d{2}  |  \d{2}-\d{2}-\d{2} ) /x
   4015     12-sep-98
   4016  0: 12-sep-98
   4017     12-09-98
   4018  0: 12-09-98
   4019 \= Expect no match
   4020     sep-12-98
   4021 No match
   4022         
   4023 /(?i:saturday|sunday)/
   4024     saturday
   4025  0: saturday
   4026     sunday
   4027  0: sunday
   4028     Saturday
   4029  0: Saturday
   4030     Sunday
   4031  0: Sunday
   4032     SATURDAY
   4033  0: SATURDAY
   4034     SUNDAY
   4035  0: SUNDAY
   4036     SunDay
   4037  0: SunDay
   4038     
   4039 /(a(?i)bc|BB)x/
   4040     abcx
   4041  0: abcx
   4042     aBCx
   4043  0: aBCx
   4044     bbx
   4045  0: bbx
   4046     BBx
   4047  0: BBx
   4048 \= Expect no match
   4049     abcX
   4050 No match
   4051     aBCX
   4052 No match
   4053     bbX
   4054 No match
   4055     BBX               
   4056 No match
   4057 
   4058 /^([ab](?i)[cd]|[ef])/
   4059     ac
   4060  0: ac
   4061     aC
   4062  0: aC
   4063     bD
   4064  0: bD
   4065     elephant
   4066  0: e
   4067     Europe 
   4068  0: E
   4069     frog
   4070  0: f
   4071     France
   4072  0: F
   4073 \= Expect no match
   4074     Africa     
   4075 No match
   4076 
   4077 /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/
   4078     ab
   4079  0: ab
   4080     aBd
   4081  0: aBd
   4082     xy
   4083  0: xy
   4084     xY
   4085  0: xY
   4086     zebra
   4087  0: z
   4088     Zambesi
   4089  0: Z
   4090 \= Expect no match
   4091     aCD  
   4092 No match
   4093     XY  
   4094 No match
   4095 
   4096 /(?<=foo\n)^bar/m
   4097     foo\nbar
   4098  0: bar
   4099 \= Expect no match
   4100     bar
   4101 No match
   4102     baz\nbar   
   4103 No match
   4104 
   4105 /(?<=(?<!foo)bar)baz/
   4106     barbaz
   4107  0: baz
   4108     barbarbaz 
   4109  0: baz
   4110     koobarbaz 
   4111  0: baz
   4112 \= Expect no match
   4113     baz
   4114 No match
   4115     foobarbaz 
   4116 No match
   4117 
   4118 # The following tests are taken from the Perl 5.005 test suite; some of them
   4119 # are compatible with 5.004, but I'd rather not have to sort them out.
   4120 
   4121 /abc/
   4122     abc
   4123  0: abc
   4124     xabcy
   4125  0: abc
   4126     ababc
   4127  0: abc
   4128 \= Expect no match
   4129     xbc
   4130 No match
   4131     axc
   4132 No match
   4133     abx
   4134 No match
   4135 
   4136 /ab*c/
   4137     abc
   4138  0: abc
   4139 
   4140 /ab*bc/
   4141     abc
   4142  0: abc
   4143     abbc
   4144  0: abbc
   4145     abbbbc
   4146  0: abbbbc
   4147 
   4148 /.{1}/
   4149     abbbbc
   4150  0: a
   4151 
   4152 /.{3,4}/
   4153     abbbbc
   4154  0: abbb
   4155 
   4156 /ab{0,}bc/
   4157     abbbbc
   4158  0: abbbbc
   4159 
   4160 /ab+bc/
   4161     abbc
   4162  0: abbc
   4163 \= Expect no match
   4164     abc
   4165 No match
   4166     abq
   4167 No match
   4168 
   4169 /ab+bc/
   4170     abbbbc
   4171  0: abbbbc
   4172 
   4173 /ab{1,}bc/
   4174     abbbbc
   4175  0: abbbbc
   4176 
   4177 /ab{1,3}bc/
   4178     abbbbc
   4179  0: abbbbc
   4180 
   4181 /ab{3,4}bc/
   4182     abbbbc
   4183  0: abbbbc
   4184 
   4185 /ab{4,5}bc/
   4186 \= Expect no match
   4187     abq
   4188 No match
   4189     abbbbc
   4190 No match
   4191 
   4192 /ab?bc/
   4193     abbc
   4194  0: abbc
   4195     abc
   4196  0: abc
   4197 
   4198 /ab{0,1}bc/
   4199     abc
   4200  0: abc
   4201 
   4202 /ab?bc/
   4203 
   4204 /ab?c/
   4205     abc
   4206  0: abc
   4207 
   4208 /ab{0,1}c/
   4209     abc
   4210  0: abc
   4211 
   4212 /^abc$/
   4213     abc
   4214  0: abc
   4215 \= Expect no match
   4216     abbbbc
   4217 No match
   4218     abcc
   4219 No match
   4220 
   4221 /^abc/
   4222     abcc
   4223  0: abc
   4224 
   4225 /^abc$/
   4226 
   4227 /abc$/
   4228     aabc
   4229  0: abc
   4230     aabc
   4231  0: abc
   4232 \= Expect no match
   4233     aabcd
   4234 No match
   4235 
   4236 /^/
   4237     abc
   4238  0: 
   4239 
   4240 /$/
   4241     abc
   4242  0: 
   4243 
   4244 /a.c/
   4245     abc
   4246  0: abc
   4247     axc
   4248  0: axc
   4249 
   4250 /a.*c/
   4251     axyzc
   4252  0: axyzc
   4253 
   4254 /a[bc]d/
   4255     abd
   4256  0: abd
   4257 \= Expect no match
   4258     axyzd
   4259 No match
   4260     abc
   4261 No match
   4262 
   4263 /a[b-d]e/
   4264     ace
   4265  0: ace
   4266 
   4267 /a[b-d]/
   4268     aac
   4269  0: ac
   4270 
   4271 /a[-b]/
   4272     a-
   4273  0: a-
   4274 
   4275 /a[b-]/
   4276     a-
   4277  0: a-
   4278 
   4279 /a]/
   4280     a]
   4281  0: a]
   4282 
   4283 /a[]]b/
   4284     a]b
   4285  0: a]b
   4286 
   4287 /a[^bc]d/
   4288     aed
   4289  0: aed
   4290 \= Expect no match
   4291     abd
   4292 No match
   4293     abd
   4294 No match
   4295 
   4296 /a[^-b]c/
   4297     adc
   4298  0: adc
   4299 
   4300 /a[^]b]c/
   4301     adc
   4302  0: adc
   4303     a-c
   4304  0: a-c
   4305 \= Expect no match
   4306     a]c
   4307 No match
   4308 
   4309 /\ba\b/
   4310     a-
   4311  0: a
   4312     -a
   4313  0: a
   4314     -a-
   4315  0: a
   4316 
   4317 /\by\b/
   4318 \= Expect no match
   4319     xy
   4320 No match
   4321     yz
   4322 No match
   4323     xyz
   4324 No match
   4325 
   4326 /\Ba\B/
   4327 \= Expect no match
   4328     a-
   4329 No match
   4330     -a
   4331 No match
   4332     -a-
   4333 No match
   4334 
   4335 /\By\b/
   4336     xy
   4337  0: y
   4338 
   4339 /\by\B/
   4340     yz
   4341  0: y
   4342 
   4343 /\By\B/
   4344     xyz
   4345  0: y
   4346 
   4347 /\w/
   4348     a
   4349  0: a
   4350 
   4351 /\W/
   4352     -
   4353  0: -
   4354 \= Expect no match
   4355     a
   4356 No match
   4357 
   4358 /a\sb/
   4359     a b
   4360  0: a b
   4361 
   4362 /a\Sb/
   4363     a-b
   4364  0: a-b
   4365 \= Expect no match
   4366     a b
   4367 No match
   4368 
   4369 /\d/
   4370     1
   4371  0: 1
   4372 
   4373 /\D/
   4374     -
   4375  0: -
   4376 \= Expect no match
   4377     1
   4378 No match
   4379 
   4380 /[\w]/
   4381     a
   4382  0: a
   4383 
   4384 /[\W]/
   4385     -
   4386  0: -
   4387 \= Expect no match
   4388     a
   4389 No match
   4390 
   4391 /a[\s]b/
   4392     a b
   4393  0: a b
   4394 
   4395 /a[\S]b/
   4396     a-b
   4397  0: a-b
   4398 \= Expect no match
   4399     a b
   4400 No match
   4401 
   4402 /[\d]/
   4403     1
   4404  0: 1
   4405 
   4406 /[\D]/
   4407     -
   4408  0: -
   4409 \= Expect no match
   4410     1
   4411 No match
   4412 
   4413 /ab|cd/
   4414     abc
   4415  0: ab
   4416     abcd
   4417  0: ab
   4418 
   4419 /()ef/
   4420     def
   4421  0: ef
   4422 
   4423 /$b/
   4424 
   4425 /a\(b/
   4426     a(b
   4427  0: a(b
   4428 
   4429 /a\(*b/
   4430     ab
   4431  0: ab
   4432     a((b
   4433  0: a((b
   4434 
   4435 /a\\b/
   4436     a\\b
   4437  0: a\b
   4438 \= Expect no match
   4439     a\b
   4440 No match
   4441 
   4442 /((a))/
   4443     abc
   4444  0: a
   4445 
   4446 /(a)b(c)/
   4447     abc
   4448  0: abc
   4449 
   4450 /a+b+c/
   4451     aabbabc
   4452  0: abc
   4453 
   4454 /a{1,}b{1,}c/
   4455     aabbabc
   4456  0: abc
   4457 
   4458 /a.+?c/
   4459     abcabc
   4460  0: abcabc
   4461  1: abc
   4462 
   4463 /(a+|b)*/
   4464     ab
   4465  0: ab
   4466  1: a
   4467  2: 
   4468 
   4469 /(a+|b){0,}/
   4470     ab
   4471  0: ab
   4472  1: a
   4473  2: 
   4474 
   4475 /(a+|b)+/
   4476     ab
   4477  0: ab
   4478  1: a
   4479 
   4480 /(a+|b){1,}/
   4481     ab
   4482  0: ab
   4483  1: a
   4484 
   4485 /(a+|b)?/
   4486     ab
   4487  0: a
   4488  1: 
   4489 
   4490 /(a+|b){0,1}/
   4491     ab
   4492  0: a
   4493  1: 
   4494 
   4495 /[^ab]*/
   4496     cde
   4497  0: cde
   4498 
   4499 /abc/
   4500 \= Expect no match
   4501     b
   4502 No match
   4503 
   4504 /a*/
   4505 
   4506 /([abc])*d/
   4507     abbbcd
   4508  0: abbbcd
   4509 
   4510 /([abc])*bcd/
   4511     abcd
   4512  0: abcd
   4513 
   4514 /a|b|c|d|e/
   4515     e
   4516  0: e
   4517 
   4518 /(a|b|c|d|e)f/
   4519     ef
   4520  0: ef
   4521 
   4522 /abcd*efg/
   4523     abcdefg
   4524  0: abcdefg
   4525 
   4526 /ab*/
   4527     xabyabbbz
   4528  0: ab
   4529     xayabbbz
   4530  0: a
   4531 
   4532 /(ab|cd)e/
   4533     abcde
   4534  0: cde
   4535 
   4536 /[abhgefdc]ij/
   4537     hij
   4538  0: hij
   4539 
   4540 /^(ab|cd)e/
   4541 
   4542 /(abc|)ef/
   4543     abcdef
   4544  0: ef
   4545 
   4546 /(a|b)c*d/
   4547     abcd
   4548  0: bcd
   4549 
   4550 /(ab|ab*)bc/
   4551     abc
   4552  0: abc
   4553 
   4554 /a([bc]*)c*/
   4555     abc
   4556  0: abc
   4557  1: a
   4558 
   4559 /a([bc]*)(c*d)/
   4560     abcd
   4561  0: abcd
   4562 
   4563 /a([bc]+)(c*d)/
   4564     abcd
   4565  0: abcd
   4566 
   4567 /a([bc]*)(c+d)/
   4568     abcd
   4569  0: abcd
   4570 
   4571 /a[bcd]*dcdcde/
   4572     adcdcde
   4573  0: adcdcde
   4574 
   4575 /a[bcd]+dcdcde/
   4576 \= Expect no match
   4577     abcde
   4578 No match
   4579     adcdcde
   4580 No match
   4581 
   4582 /(ab|a)b*c/
   4583     abc
   4584  0: abc
   4585 
   4586 /((a)(b)c)(d)/
   4587     abcd
   4588  0: abcd
   4589 
   4590 /[a-zA-Z_][a-zA-Z0-9_]*/
   4591     alpha
   4592  0: alpha
   4593 
   4594 /^a(bc+|b[eh])g|.h$/
   4595     abh
   4596  0: bh
   4597 
   4598 /(bc+d$|ef*g.|h?i(j|k))/
   4599     effgz
   4600  0: effgz
   4601     ij
   4602  0: ij
   4603     reffgz
   4604  0: effgz
   4605 \= Expect no match
   4606     effg
   4607 No match
   4608     bcdd
   4609 No match
   4610 
   4611 /((((((((((a))))))))))/
   4612     a
   4613  0: a
   4614 
   4615 /(((((((((a)))))))))/
   4616     a
   4617  0: a
   4618 
   4619 /multiple words of text/
   4620 \= Expect no match
   4621     aa
   4622 No match
   4623     uh-uh
   4624 No match
   4625 
   4626 /multiple words/
   4627     multiple words, yeah
   4628  0: multiple words
   4629 
   4630 /(.*)c(.*)/
   4631     abcde
   4632  0: abcde
   4633 
   4634 /\((.*), (.*)\)/
   4635     (a, b)
   4636  0: (a, b)
   4637 
   4638 /[k]/
   4639 
   4640 /abcd/
   4641     abcd
   4642  0: abcd
   4643 
   4644 /a(bc)d/
   4645     abcd
   4646  0: abcd
   4647 
   4648 /a[-]?c/
   4649     ac
   4650  0: ac
   4651 
   4652 /abc/i
   4653     ABC
   4654  0: ABC
   4655     XABCY
   4656  0: ABC
   4657     ABABC
   4658  0: ABC
   4659 \= Expect no match
   4660     aaxabxbaxbbx
   4661 No match
   4662     XBC
   4663 No match
   4664     AXC
   4665 No match
   4666     ABX
   4667 No match
   4668 
   4669 /ab*c/i
   4670     ABC
   4671  0: ABC
   4672 
   4673 /ab*bc/i
   4674     ABC
   4675  0: ABC
   4676     ABBC
   4677  0: ABBC
   4678 
   4679 /ab*?bc/i
   4680     ABBBBC
   4681  0: ABBBBC
   4682 
   4683 /ab{0,}?bc/i
   4684     ABBBBC
   4685  0: ABBBBC
   4686 
   4687 /ab+?bc/i
   4688     ABBC
   4689  0: ABBC
   4690 
   4691 /ab+bc/i
   4692 \= Expect no match
   4693     ABC
   4694 No match
   4695     ABQ
   4696 No match
   4697 
   4698 /ab{1,}bc/i
   4699 
   4700 /ab+bc/i
   4701     ABBBBC
   4702  0: ABBBBC
   4703 
   4704 /ab{1,}?bc/i
   4705     ABBBBC
   4706  0: ABBBBC
   4707 
   4708 /ab{1,3}?bc/i
   4709     ABBBBC
   4710  0: ABBBBC
   4711 
   4712 /ab{3,4}?bc/i
   4713     ABBBBC
   4714  0: ABBBBC
   4715 
   4716 /ab{4,5}?bc/i
   4717 \= Expect no match
   4718     ABQ
   4719 No match
   4720     ABBBBC
   4721 No match
   4722 
   4723 /ab??bc/i
   4724     ABBC
   4725  0: ABBC
   4726     ABC
   4727  0: ABC
   4728 
   4729 /ab{0,1}?bc/i
   4730     ABC
   4731  0: ABC
   4732 
   4733 /ab??bc/i
   4734 
   4735 /ab??c/i
   4736     ABC
   4737  0: ABC
   4738 
   4739 /ab{0,1}?c/i
   4740     ABC
   4741  0: ABC
   4742 
   4743 /^abc$/i
   4744     ABC
   4745  0: ABC
   4746 \= Expect no match
   4747     ABBBBC
   4748 No match
   4749     ABCC
   4750 No match
   4751 
   4752 /^abc/i
   4753     ABCC
   4754  0: ABC
   4755 
   4756 /^abc$/i
   4757 
   4758 /abc$/i
   4759     AABC
   4760  0: ABC
   4761 
   4762 /^/i
   4763     ABC
   4764  0: 
   4765 
   4766 /$/i
   4767     ABC
   4768  0: 
   4769 
   4770 /a.c/i
   4771     ABC
   4772  0: ABC
   4773     AXC
   4774  0: AXC
   4775 
   4776 /a.*?c/i
   4777     AXYZC
   4778  0: AXYZC
   4779 
   4780 /a.*c/i
   4781     AABC
   4782  0: AABC
   4783 \= Expect no match
   4784     AXYZD
   4785 No match
   4786 
   4787 /a[bc]d/i
   4788     ABD
   4789  0: ABD
   4790 
   4791 /a[b-d]e/i
   4792     ACE
   4793  0: ACE
   4794 \= Expect no match
   4795     ABC
   4796 No match
   4797     ABD
   4798 No match
   4799 
   4800 /a[b-d]/i
   4801     AAC
   4802  0: AC
   4803 
   4804 /a[-b]/i
   4805     A-
   4806  0: A-
   4807 
   4808 /a[b-]/i
   4809     A-
   4810  0: A-
   4811 
   4812 /a]/i
   4813     A]
   4814  0: A]
   4815 
   4816 /a[]]b/i
   4817     A]B
   4818  0: A]B
   4819 
   4820 /a[^bc]d/i
   4821     AED
   4822  0: AED
   4823 
   4824 /a[^-b]c/i
   4825     ADC
   4826  0: ADC
   4827 \= Expect no match
   4828     ABD
   4829 No match
   4830     A-C
   4831 No match
   4832 
   4833 /a[^]b]c/i
   4834     ADC
   4835  0: ADC
   4836 
   4837 /ab|cd/i
   4838     ABC
   4839  0: AB
   4840     ABCD
   4841  0: AB
   4842 
   4843 /()ef/i
   4844     DEF
   4845  0: EF
   4846 
   4847 /$b/i
   4848 \= Expect no match
   4849     A]C
   4850 No match
   4851     B
   4852 No match
   4853 
   4854 /a\(b/i
   4855     A(B
   4856  0: A(B
   4857 
   4858 /a\(*b/i
   4859     AB
   4860  0: AB
   4861     A((B
   4862  0: A((B
   4863 
   4864 /a\\b/i
   4865 \= Expect no match
   4866     A\=notbol
   4867 No match
   4868 
   4869 /((a))/i
   4870     ABC
   4871  0: A
   4872 
   4873 /(a)b(c)/i
   4874     ABC
   4875  0: ABC
   4876 
   4877 /a+b+c/i
   4878     AABBABC
   4879  0: ABC
   4880 
   4881 /a{1,}b{1,}c/i
   4882     AABBABC
   4883  0: ABC
   4884 
   4885 /a.+?c/i
   4886     ABCABC
   4887  0: ABCABC
   4888  1: ABC
   4889 
   4890 /a.*?c/i
   4891     ABCABC
   4892  0: ABCABC
   4893  1: ABC
   4894 
   4895 /a.{0,5}?c/i
   4896     ABCABC
   4897  0: ABCABC
   4898  1: ABC
   4899 
   4900 /(a+|b)*/i
   4901     AB
   4902  0: AB
   4903  1: A
   4904  2: 
   4905 
   4906 /(a+|b){0,}/i
   4907     AB
   4908  0: AB
   4909  1: A
   4910  2: 
   4911 
   4912 /(a+|b)+/i
   4913     AB
   4914  0: AB
   4915  1: A
   4916 
   4917 /(a+|b){1,}/i
   4918     AB
   4919  0: AB
   4920  1: A
   4921 
   4922 /(a+|b)?/i
   4923     AB
   4924  0: A
   4925  1: 
   4926 
   4927 /(a+|b){0,1}/i
   4928     AB
   4929  0: A
   4930  1: 
   4931 
   4932 /(a+|b){0,1}?/i
   4933     AB
   4934  0: A
   4935  1: 
   4936 
   4937 /[^ab]*/i
   4938     CDE
   4939  0: CDE
   4940 
   4941 /abc/i
   4942 
   4943 /a*/i
   4944 
   4945 /([abc])*d/i
   4946     ABBBCD
   4947  0: ABBBCD
   4948 
   4949 /([abc])*bcd/i
   4950     ABCD
   4951  0: ABCD
   4952 
   4953 /a|b|c|d|e/i
   4954     E
   4955  0: E
   4956 
   4957 /(a|b|c|d|e)f/i
   4958     EF
   4959  0: EF
   4960 
   4961 /abcd*efg/i
   4962     ABCDEFG
   4963  0: ABCDEFG
   4964 
   4965 /ab*/i
   4966     XABYABBBZ
   4967  0: AB
   4968     XAYABBBZ
   4969  0: A
   4970 
   4971 /(ab|cd)e/i
   4972     ABCDE
   4973  0: CDE
   4974 
   4975 /[abhgefdc]ij/i
   4976     HIJ
   4977  0: HIJ
   4978 
   4979 /^(ab|cd)e/i
   4980 \= Expect no match
   4981     ABCDE
   4982 No match
   4983 
   4984 /(abc|)ef/i
   4985     ABCDEF
   4986  0: EF
   4987 
   4988 /(a|b)c*d/i
   4989     ABCD
   4990  0: BCD
   4991 
   4992 /(ab|ab*)bc/i
   4993     ABC
   4994  0: ABC
   4995 
   4996 /a([bc]*)c*/i
   4997     ABC
   4998  0: ABC
   4999  1: A
   5000 
   5001 /a([bc]*)(c*d)/i
   5002     ABCD
   5003  0: ABCD
   5004 
   5005 /a([bc]+)(c*d)/i
   5006     ABCD
   5007  0: ABCD
   5008 
   5009 /a([bc]*)(c+d)/i
   5010     ABCD
   5011  0: ABCD
   5012 
   5013 /a[bcd]*dcdcde/i
   5014     ADCDCDE
   5015  0: ADCDCDE
   5016 
   5017 /a[bcd]+dcdcde/i
   5018 
   5019 /(ab|a)b*c/i
   5020     ABC
   5021  0: ABC
   5022 
   5023 /((a)(b)c)(d)/i
   5024     ABCD
   5025  0: ABCD
   5026 
   5027 /[a-zA-Z_][a-zA-Z0-9_]*/i
   5028     ALPHA
   5029  0: ALPHA
   5030 
   5031 /^a(bc+|b[eh])g|.h$/i
   5032     ABH
   5033  0: BH
   5034 
   5035 /(bc+d$|ef*g.|h?i(j|k))/i
   5036     EFFGZ
   5037  0: EFFGZ
   5038     IJ
   5039  0: IJ
   5040     REFFGZ
   5041  0: EFFGZ
   5042 \= Expect no match
   5043     ADCDCDE
   5044 No match
   5045     EFFG
   5046 No match
   5047     BCDD
   5048 No match
   5049 
   5050 /((((((((((a))))))))))/i
   5051     A
   5052  0: A
   5053 
   5054 /(((((((((a)))))))))/i
   5055     A
   5056  0: A
   5057 
   5058 /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))/i
   5059     A
   5060  0: A
   5061 
   5062 /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/i
   5063     C
   5064  0: C
   5065 
   5066 /multiple words of text/i
   5067 \= Expect no match
   5068     AA
   5069 No match
   5070     UH-UH
   5071 No match
   5072 
   5073 /multiple words/i
   5074     MULTIPLE WORDS, YEAH
   5075  0: MULTIPLE WORDS
   5076 
   5077 /(.*)c(.*)/i
   5078     ABCDE
   5079  0: ABCDE
   5080 
   5081 /\((.*), (.*)\)/i
   5082     (A, B)
   5083  0: (A, B)
   5084 
   5085 /[k]/i
   5086 
   5087 /abcd/i
   5088     ABCD
   5089  0: ABCD
   5090 
   5091 /a(bc)d/i
   5092     ABCD
   5093  0: ABCD
   5094 
   5095 /a[-]?c/i
   5096     AC
   5097  0: AC
   5098 
   5099 /a(?!b)./
   5100     abad
   5101  0: ad
   5102 
   5103 /a(?=d)./
   5104     abad
   5105  0: ad
   5106 
   5107 /a(?=c|d)./
   5108     abad
   5109  0: ad
   5110 
   5111 /a(?:b|c|d)(.)/
   5112     ace
   5113  0: ace
   5114 
   5115 /a(?:b|c|d)*(.)/
   5116     ace
   5117  0: ace
   5118  1: ac
   5119 
   5120 /a(?:b|c|d)+?(.)/
   5121     ace
   5122  0: ace
   5123     acdbcdbe
   5124  0: acdbcdbe
   5125  1: acdbcdb
   5126  2: acdbcd
   5127  3: acdbc
   5128  4: acdb
   5129  5: acd
   5130 
   5131 /a(?:b|c|d)+(.)/
   5132     acdbcdbe
   5133  0: acdbcdbe
   5134  1: acdbcdb
   5135  2: acdbcd
   5136  3: acdbc
   5137  4: acdb
   5138  5: acd
   5139 
   5140 /a(?:b|c|d){2}(.)/
   5141     acdbcdbe
   5142  0: acdb
   5143 
   5144 /a(?:b|c|d){4,5}(.)/
   5145     acdbcdbe
   5146  0: acdbcdb
   5147  1: acdbcd
   5148 
   5149 /a(?:b|c|d){4,5}?(.)/
   5150     acdbcdbe
   5151  0: acdbcdb
   5152  1: acdbcd
   5153 
   5154 /((foo)|(bar))*/
   5155     foobar
   5156  0: foobar
   5157  1: foo
   5158  2: 
   5159 
   5160 /a(?:b|c|d){6,7}(.)/
   5161     acdbcdbe
   5162  0: acdbcdbe
   5163 
   5164 /a(?:b|c|d){6,7}?(.)/
   5165     acdbcdbe
   5166  0: acdbcdbe
   5167 
   5168 /a(?:b|c|d){5,6}(.)/
   5169     acdbcdbe
   5170  0: acdbcdbe
   5171  1: acdbcdb
   5172 
   5173 /a(?:b|c|d){5,6}?(.)/
   5174     acdbcdbe
   5175  0: acdbcdbe
   5176  1: acdbcdb
   5177 
   5178 /a(?:b|c|d){5,7}(.)/
   5179     acdbcdbe
   5180  0: acdbcdbe
   5181  1: acdbcdb
   5182 
   5183 /a(?:b|c|d){5,7}?(.)/
   5184     acdbcdbe
   5185  0: acdbcdbe
   5186  1: acdbcdb
   5187 
   5188 /a(?:b|(c|e){1,2}?|d)+?(.)/
   5189     ace
   5190  0: ace
   5191 
   5192 /^(.+)?B/
   5193     AB
   5194  0: AB
   5195 
   5196 /^([^a-z])|(\^)$/
   5197     .
   5198  0: .
   5199 
   5200 /^[<>]&/
   5201     <&OUT
   5202  0: <&
   5203 
   5204 /(?:(f)(o)(o)|(b)(a)(r))*/
   5205     foobar
   5206  0: foobar
   5207  1: foo
   5208  2: 
   5209 
   5210 /(?<=a)b/
   5211     ab
   5212  0: b
   5213 \= Expect no match
   5214     cb
   5215 No match
   5216     b
   5217 No match
   5218 
   5219 /(?<!c)b/
   5220     ab
   5221  0: b
   5222     b
   5223  0: b
   5224     b
   5225  0: b
   5226 
   5227 /(?:..)*a/
   5228     aba
   5229  0: aba
   5230  1: a
   5231 
   5232 /(?:..)*?a/
   5233     aba
   5234  0: aba
   5235  1: a
   5236 
   5237 /^(){3,5}/
   5238     abc
   5239  0: 
   5240 
   5241 /^(a+)*ax/
   5242     aax
   5243  0: aax
   5244 
   5245 /^((a|b)+)*ax/
   5246     aax
   5247  0: aax
   5248 
   5249 /^((a|bc)+)*ax/
   5250     aax
   5251  0: aax
   5252 
   5253 /(a|x)*ab/
   5254     cab
   5255  0: ab
   5256 
   5257 /(a)*ab/
   5258     cab
   5259  0: ab
   5260 
   5261 /(?:(?i)a)b/
   5262     ab
   5263  0: ab
   5264 
   5265 /((?i)a)b/
   5266     ab
   5267  0: ab
   5268 
   5269 /(?:(?i)a)b/
   5270     Ab
   5271  0: Ab
   5272 
   5273 /((?i)a)b/
   5274     Ab
   5275  0: Ab
   5276 
   5277 /(?:(?i)a)b/
   5278 \= Expect no match
   5279     cb
   5280 No match
   5281     aB
   5282 No match
   5283 
   5284 /((?i)a)b/
   5285 
   5286 /(?i:a)b/
   5287     ab
   5288  0: ab
   5289 
   5290 /((?i:a))b/
   5291     ab
   5292  0: ab
   5293 
   5294 /(?i:a)b/
   5295     Ab
   5296  0: Ab
   5297 
   5298 /((?i:a))b/
   5299     Ab
   5300  0: Ab
   5301 
   5302 /(?i:a)b/
   5303 \= Expect no match
   5304     aB
   5305 No match
   5306     aB
   5307 No match
   5308 
   5309 /((?i:a))b/
   5310 
   5311 /(?:(?-i)a)b/i
   5312     ab
   5313  0: ab
   5314 
   5315 /((?-i)a)b/i
   5316     ab
   5317  0: ab
   5318 
   5319 /(?:(?-i)a)b/i
   5320     aB
   5321  0: aB
   5322 
   5323 /((?-i)a)b/i
   5324     aB
   5325  0: aB
   5326 
   5327 /(?:(?-i)a)b/i
   5328     aB
   5329  0: aB
   5330 \= Expect no match
   5331     Ab
   5332 No match
   5333 
   5334 /((?-i)a)b/i
   5335 
   5336 /(?:(?-i)a)b/i
   5337     aB
   5338  0: aB
   5339 
   5340 /((?-i)a)b/i
   5341     aB
   5342  0: aB
   5343 
   5344 /(?:(?-i)a)b/i
   5345 \= Expect no match
   5346     Ab
   5347 No match
   5348     AB
   5349 No match
   5350 
   5351 /((?-i)a)b/i
   5352 
   5353 /(?-i:a)b/i
   5354     ab
   5355  0: ab
   5356 
   5357 /((?-i:a))b/i
   5358     ab
   5359  0: ab
   5360 
   5361 /(?-i:a)b/i
   5362     aB
   5363  0: aB
   5364 
   5365 /((?-i:a))b/i
   5366     aB
   5367  0: aB
   5368 
   5369 /(?-i:a)b/i
   5370 \= Expect no match
   5371     AB
   5372 No match
   5373     Ab
   5374 No match
   5375 
   5376 /((?-i:a))b/i
   5377 
   5378 /(?-i:a)b/i
   5379     aB
   5380  0: aB
   5381 
   5382 /((?-i:a))b/i
   5383     aB
   5384  0: aB
   5385 
   5386 /(?-i:a)b/i
   5387 \= Expect no match
   5388     Ab
   5389 No match
   5390     AB
   5391 No match
   5392 
   5393 /((?-i:a))b/i
   5394 
   5395 /((?-i:a.))b/i
   5396 \= Expect no match
   5397     AB
   5398 No match
   5399     a\nB
   5400 No match
   5401 
   5402 /((?s-i:a.))b/i
   5403     a\nB
   5404  0: a\x0aB
   5405 
   5406 /(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))/
   5407     cabbbb
   5408  0: cabbbb
   5409 
   5410 /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/
   5411     caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
   5412  0: caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
   5413 
   5414 /foo\w*\d{4}baz/
   5415     foobar1234baz
   5416  0: foobar1234baz
   5417 
   5418 /x(~~)*(?:(?:F)?)?/
   5419     x~~
   5420  0: x~~
   5421  1: x
   5422 
   5423 /^a(?#xxx){3}c/
   5424     aaac
   5425  0: aaac
   5426 
   5427 /^a (?#xxx) (?#yyy) {3}c/x
   5428     aaac
   5429  0: aaac
   5430 
   5431 /(?<![cd])b/
   5432 \= Expect no match
   5433     B\nB
   5434 No match
   5435     dbcb
   5436 No match
   5437 
   5438 /(?<![cd])[ab]/
   5439     dbaacb
   5440  0: a
   5441 
   5442 /(?<!(c|d))b/
   5443 
   5444 /(?<!(c|d))[ab]/
   5445     dbaacb
   5446  0: a
   5447 
   5448 /(?<!cd)[ab]/
   5449     cdaccb
   5450  0: b
   5451 
   5452 /^(?:a?b?)*$/
   5453 \= Expect no match
   5454     dbcb
   5455 No match
   5456     a--
   5457 No match
   5458 
   5459 /((?s)^a(.))((?m)^b$)/
   5460     a\nb\nc\n
   5461  0: a\x0ab
   5462 
   5463 /((?m)^b$)/
   5464     a\nb\nc\n
   5465  0: b
   5466 
   5467 /(?m)^b/
   5468     a\nb\n
   5469  0: b
   5470 
   5471 /(?m)^(b)/
   5472     a\nb\n
   5473  0: b
   5474 
   5475 /((?m)^b)/
   5476     a\nb\n
   5477  0: b
   5478 
   5479 /\n((?m)^b)/
   5480     a\nb\n
   5481  0: \x0ab
   5482 
   5483 /((?s).)c(?!.)/
   5484     a\nb\nc\n
   5485  0: \x0ac
   5486     a\nb\nc\n
   5487  0: \x0ac
   5488 
   5489 /((?s)b.)c(?!.)/
   5490     a\nb\nc\n
   5491  0: b\x0ac
   5492     a\nb\nc\n
   5493  0: b\x0ac
   5494 
   5495 /^b/
   5496 
   5497 /()^b/
   5498 \= Expect no match
   5499     a\nb\nc\n
   5500 No match
   5501     a\nb\nc\n
   5502 No match
   5503 
   5504 /((?m)^b)/
   5505     a\nb\nc\n
   5506  0: b
   5507 
   5508 /(?(?!a)a|b)/
   5509 
   5510 /(?(?!a)b|a)/
   5511     a
   5512  0: a
   5513 
   5514 /(?(?=a)b|a)/
   5515 \= Expect no match
   5516     a
   5517 No match
   5518     a
   5519 No match
   5520 
   5521 /(?(?=a)a|b)/
   5522     a
   5523  0: a
   5524 
   5525 /(\w+:)+/
   5526     one:
   5527  0: one:
   5528 
   5529 /$(?<=^(a))/
   5530     a
   5531  0: 
   5532 
   5533 /([\w:]+::)?(\w+)$/
   5534     abcd
   5535  0: abcd
   5536     xy:z:::abcd
   5537  0: xy:z:::abcd
   5538 
   5539 /^[^bcd]*(c+)/
   5540     aexycd
   5541  0: aexyc
   5542 
   5543 /(a*)b+/
   5544     caab
   5545  0: aab
   5546 
   5547 /([\w:]+::)?(\w+)$/
   5548     abcd
   5549  0: abcd
   5550     xy:z:::abcd
   5551  0: xy:z:::abcd
   5552 \= Expect no match
   5553     abcd:
   5554 No match
   5555     abcd:
   5556 No match
   5557 
   5558 /^[^bcd]*(c+)/
   5559     aexycd
   5560  0: aexyc
   5561 
   5562 /(>a+)ab/
   5563 
   5564 /(?>a+)b/
   5565     aaab
   5566  0: aaab
   5567 
   5568 /([[:]+)/
   5569     a:[b]:
   5570  0: :[
   5571 
   5572 /([[=]+)/
   5573     a=[b]=
   5574  0: =[
   5575 
   5576 /([[.]+)/
   5577     a.[b].
   5578  0: .[
   5579 
   5580 /((?>a+)b)/
   5581     aaab
   5582  0: aaab
   5583 
   5584 /(?>(a+))b/
   5585     aaab
   5586  0: aaab
   5587 
   5588 /((?>[^()]+)|\([^()]*\))+/
   5589     ((abc(ade)ufh()()x
   5590  0: abc(ade)ufh()()x
   5591  1: abc(ade)ufh()()
   5592  2: abc(ade)ufh()
   5593  3: abc(ade)ufh
   5594  4: abc(ade)
   5595  5: abc
   5596 
   5597 /a\Z/
   5598 \= Expect no match
   5599     aaab
   5600 No match
   5601     a\nb\n
   5602 No match
   5603 
   5604 /b\Z/
   5605     a\nb\n
   5606  0: b
   5607 
   5608 /b\z/
   5609 
   5610 /b\Z/
   5611     a\nb
   5612  0: b
   5613 
   5614 /b\z/
   5615     a\nb
   5616  0: b
   5617     
   5618 /(?>.*)(?<=(abcd|wxyz))/
   5619     alphabetabcd
   5620  0: alphabetabcd
   5621     endingwxyz
   5622  0: endingwxyz
   5623 \= Expect no match
   5624     a rather long string that doesn't end with one of them
   5625 No match
   5626 
   5627 /word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/
   5628     word cat dog elephant mussel cow horse canary baboon snake shark otherword
   5629  0: word cat dog elephant mussel cow horse canary baboon snake shark otherword
   5630 \= Expect no match
   5631     word cat dog elephant mussel cow horse canary baboon snake shark
   5632 No match
   5633   
   5634 /word (?>[a-zA-Z0-9]+ ){0,30}otherword/
   5635 \= Expect no match
   5636     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
   5637 No match
   5638 
   5639 /(?<=\d{3}(?!999))foo/
   5640     999foo
   5641  0: foo
   5642     123999foo 
   5643  0: foo
   5644 \= Expect no match
   5645     123abcfoo
   5646 No match
   5647     
   5648 /(?<=(?!...999)\d{3})foo/
   5649     999foo
   5650  0: foo
   5651     123999foo 
   5652  0: foo
   5653 \= Expect no match
   5654     123abcfoo
   5655 No match
   5656 
   5657 /(?<=\d{3}(?!999)...)foo/
   5658     123abcfoo
   5659  0: foo
   5660     123456foo 
   5661  0: foo
   5662 \= Expect no match
   5663     123999foo  
   5664 No match
   5665     
   5666 /(?<=\d{3}...)(?<!999)foo/
   5667     123abcfoo   
   5668  0: foo
   5669     123456foo 
   5670  0: foo
   5671 \= Expect no match
   5672     123999foo  
   5673 No match
   5674 
   5675 /((Z)+|A)*/
   5676     ZABCDEFG
   5677  0: ZA
   5678  1: Z
   5679  2: 
   5680 
   5681 /(Z()|A)*/
   5682     ZABCDEFG
   5683  0: ZA
   5684  1: Z
   5685  2: 
   5686 
   5687 /(Z(())|A)*/
   5688     ZABCDEFG
   5689  0: ZA
   5690  1: Z
   5691  2: 
   5692 
   5693 /((?>Z)+|A)*/
   5694     ZABCDEFG
   5695  0: ZA
   5696  1: Z
   5697  2: 
   5698 
   5699 /((?>)+|A)*/
   5700     ZABCDEFG
   5701  0: 
   5702 
   5703 /a*/g
   5704     abbab
   5705  0: a
   5706  0: 
   5707  0: 
   5708  0: a
   5709  0: 
   5710  0: 
   5711 
   5712 /[[:space:]]+/
   5713     > \x09\x0a\x0c\x0d\x0b<
   5714  0:  \x09\x0a\x0c\x0d\x0b
   5715      
   5716 /[[:blank:]]+/
   5717     > \x09\x0a\x0c\x0d\x0b<
   5718  0:  \x09
   5719      
   5720 /[\s]+/
   5721     > \x09\x0a\x0c\x0d\x0b<
   5722  0:  \x09\x0a\x0c\x0d\x0b
   5723      
   5724 /\s+/
   5725     > \x09\x0a\x0c\x0d\x0b<
   5726  0:  \x09\x0a\x0c\x0d\x0b
   5727      
   5728 /ab/x
   5730     ab
   5731  0: ab
   5732 
   5733 /(?!\A)x/m
   5734   a\nxb\n
   5735  0: x
   5736 
   5737 /(?!^)x/m
   5738 \= Expect no match
   5739     a\nxb\n
   5740 No match
   5741 
   5742 /abc\Qabc\Eabc/
   5743     abcabcabc
   5744  0: abcabcabc
   5745     
   5746 /abc\Q(*+|\Eabc/
   5747     abc(*+|abc 
   5748  0: abc(*+|abc
   5749 
   5750 /   abc\Q abc\Eabc/x
   5751     abc abcabc
   5752  0: abc abcabc
   5753 \= Expect no match
   5754     abcabcabc  
   5755 No match
   5756     
   5757 /abc#comment
   5758     \Q#not comment
   5759     literal\E/x
   5760     abc#not comment\n    literal     
   5761  0: abc#not comment\x0a    literal
   5762 
   5763 /abc#comment
   5764     \Q#not comment
   5765     literal/x
   5766     abc#not comment\n    literal     
   5767  0: abc#not comment\x0a    literal
   5768 
   5769 /abc#comment
   5770     \Q#not comment
   5771     literal\E #more comment
   5772     /x
   5773     abc#not comment\n    literal     
   5774  0: abc#not comment\x0a    literal
   5775 
   5776 /abc#comment
   5777     \Q#not comment
   5778     literal\E #more comment/x
   5779     abc#not comment\n    literal     
   5780  0: abc#not comment\x0a    literal
   5781 
   5782 /\Qabc\$xyz\E/
   5783     abc\\\$xyz
   5784  0: abc\$xyz
   5785 
   5786 /\Qabc\E\$\Qxyz\E/
   5787     abc\$xyz
   5788  0: abc$xyz
   5789 
   5790 /\Gabc/
   5791     abc
   5792  0: abc
   5793 \= Expect no match
   5794     xyzabc  
   5795 No match
   5796 
   5797 /\Gabc./g
   5798     abc1abc2xyzabc3
   5799  0: abc1
   5800  0: abc2
   5801 
   5802 /abc./g
   5803     abc1abc2xyzabc3 
   5804  0: abc1
   5805  0: abc2
   5806  0: abc3
   5807 
   5808 /a(?x: b c )d/
   5809     XabcdY
   5810  0: abcd
   5811 \= Expect no match 
   5812     Xa b c d Y 
   5813 No match
   5814 
   5815 /((?x)x y z | a b c)/
   5816     XabcY
   5817  0: abc
   5818     AxyzB 
   5819  0: xyz
   5820 
   5821 /(?i)AB(?-i)C/
   5822     XabCY
   5823  0: abC
   5824 \= Expect no match
   5825     XabcY  
   5826 No match
   5827 
   5828 /((?i)AB(?-i)C|D)E/
   5829     abCE
   5830  0: abCE
   5831     DE
   5832  0: DE
   5833 \= Expect no match
   5834     abcE
   5835 No match
   5836     abCe  
   5837 No match
   5838     dE
   5839 No match
   5840     De    
   5841 No match
   5842 
   5843 /[z\Qa-d]\E]/
   5844     z
   5845  0: z
   5846     a
   5847  0: a
   5848     -
   5849  0: -
   5850     d
   5851  0: d
   5852     ] 
   5853  0: ]
   5854 \= Expect no match
   5855     b     
   5856 No match
   5857 
   5858 /(a+)*b/
   5859 \= Expect no match
   5860     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 
   5861 No match
   5862     
   5863 /(?i)reg(?:ul(?:[a]|ae)r|ex)/
   5864     REGular
   5865  0: REGular
   5866     regulaer
   5867  0: regulaer
   5868     Regex  
   5869  0: Regex
   5870     regulr 
   5871  0: regul\xe4r
   5872 
   5873 /[--]+/
   5874     
   5875  0: \xc5\xe6\xe5\xe4\xe0
   5876     
   5877  0: \xc5\xe6\xe5\xe4\xff
   5878     
   5879  0: \xc5\xe6\xe5\xe4\xc0
   5880     
   5881  0: \xc5\xe6\xe5\xe4\xdf
   5882 
   5883 /(?<=Z)X./
   5884     \x84XAZXB
   5885  0: XB
   5886 
   5887 /^(?(2)a|(1)(2))+$/
   5888     123a
   5889 Failed: error -40: backreference condition or recursion test is not supported for DFA matching
   5890 
   5891 /(?<=a|bbbb)c/
   5892     ac
   5893  0: c
   5894     bbbbc
   5895  0: c
   5896 
   5897 /line\nbreak/
   5898     this is a line\nbreak
   5899  0: line\x0abreak
   5900     line one\nthis is a line\nbreak in the second line 
   5901  0: line\x0abreak
   5902 
   5903 /line\nbreak/firstline
   5904     this is a line\nbreak
   5905  0: line\x0abreak
   5906 \= Expect no match 
   5907     line one\nthis is a line\nbreak in the second line 
   5908 No match
   5909 
   5910 /line\nbreak/m,firstline
   5911     this is a line\nbreak
   5912  0: line\x0abreak
   5913 \= Expect no match 
   5914     line one\nthis is a line\nbreak in the second line 
   5915 No match
   5916 
   5917 /1234/
   5918     123\=ps
   5919 Partial match: 123
   5920 \= Expect no match 
   5921     a4\=ps,dfa_restart
   5922 No match
   5923 
   5924 /1234/
   5925     123\=ps
   5926 Partial match: 123
   5927     4\=ps,dfa_restart
   5928  0: 4
   5929 
   5930 /^/gm
   5931     a\nb\nc\n
   5932  0: 
   5933  0: 
   5934  0: 
   5935     \ 
   5936  0: 
   5937     
   5938 /(?<=C\n)^/gm
   5939     A\nC\nC\n 
   5940  0: 
   5941 
   5942 /(?s)A?B/
   5943     AB
   5944  0: AB
   5945     aB  
   5946  0: B
   5947 
   5948 /(?s)A*B/
   5949     AB
   5950  0: AB
   5951     aB  
   5952  0: B
   5953 
   5954 /(?m)A?B/
   5955     AB
   5956  0: AB
   5957     aB  
   5958  0: B
   5959 
   5960 /(?m)A*B/
   5961     AB
   5962  0: AB
   5963     aB  
   5964  0: B
   5965 
   5966 /Content-Type\x3A[^\r\n]{6,}/
   5967     Content-Type:xxxxxyyy 
   5968  0: Content-Type:xxxxxyyy
   5969 
   5970 /Content-Type\x3A[^\r\n]{6,}z/
   5971     Content-Type:xxxxxyyyz
   5972  0: Content-Type:xxxxxyyyz
   5973 
   5974 /Content-Type\x3A[^a]{6,}/
   5975     Content-Type:xxxyyy 
   5976  0: Content-Type:xxxyyy
   5977 
   5978 /Content-Type\x3A[^a]{6,}z/
   5979     Content-Type:xxxyyyz
   5980  0: Content-Type:xxxyyyz
   5981 
   5982 /^abc/Im,newline=lf
   5983 Capturing subpattern count = 0
   5984 Options: multiline
   5985 Forced newline is LF
   5986 First code unit at start or follows newline
   5987 Last code unit = 'c'
   5988 Subject length lower bound = 3
   5989     xyz\nabc
   5990  0: abc
   5991     xyz\r\nabc
   5992  0: abc
   5993 \= Expect no match
   5994     xyz\rabc
   5995 No match
   5996     xyzabc\r
   5997 No match
   5998     xyzabc\rpqr
   5999 No match
   6000     xyzabc\r\n
   6001 No match
   6002     xyzabc\r\npqr
   6003 No match
   6004 
   6005 /^abc/Im,newline=crlf
   6006 Capturing subpattern count = 0
   6007 Options: multiline
   6008 Forced newline is CRLF
   6009 First code unit at start or follows newline
   6010 Last code unit = 'c'
   6011 Subject length lower bound = 3
   6012     xyz\r\nabclf>
   6013  0: abc
   6014 \= Expect no match
   6015     xyz\nabclf
   6016 No match
   6017     xyz\rabclf
   6018 No match
   6019     
   6020 /^abc/Im,newline=cr
   6021 Capturing subpattern count = 0
   6022 Options: multiline
   6023 Forced newline is CR
   6024 First code unit at start or follows newline
   6025 Last code unit = 'c'
   6026 Subject length lower bound = 3
   6027     xyz\rabc
   6028  0: abc
   6029 \= Expect no match
   6030     xyz\nabc
   6031 No match
   6032     xyz\r\nabc
   6033 No match
   6034 
   6035 /.*/I,newline=lf
   6036 Capturing subpattern count = 0
   6037 May match empty string
   6038 Forced newline is LF
   6039 First code unit at start or follows newline
   6040 Subject length lower bound = 0
   6041     abc\ndef
   6042  0: abc
   6043     abc\rdef
   6044  0: abc\x0ddef
   6045     abc\r\ndef
   6046  0: abc\x0d
   6047 
   6048 /.*/I,newline=cr
   6049 Capturing subpattern count = 0
   6050 May match empty string
   6051 Forced newline is CR
   6052 First code unit at start or follows newline
   6053 Subject length lower bound = 0
   6054     abc\ndef
   6055  0: abc\x0adef
   6056     abc\rdef
   6057  0: abc
   6058     abc\r\ndef
   6059  0: abc
   6060 
   6061 /.*/I,newline=crlf
   6062 Capturing subpattern count = 0
   6063 May match empty string
   6064 Forced newline is CRLF
   6065 First code unit at start or follows newline
   6066 Subject length lower bound = 0
   6067     abc\ndef
   6068  0: abc\x0adef
   6069     abc\rdef
   6070  0: abc\x0ddef
   6071     abc\r\ndef
   6072  0: abc
   6073 
   6074 /\w+(.)(.)?def/Is
   6075 Capturing subpattern count = 2
   6076 Options: dotall
   6077 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 
   6078   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 
   6079 Last code unit = 'f'
   6080 Subject length lower bound = 5
   6081     abc\ndef
   6082  0: abc\x0adef
   6083     abc\rdef
   6084  0: abc\x0ddef
   6085     abc\r\ndef
   6086  0: abc\x0d\x0adef
   6087 
   6088 /\w+(.)(.)?def/s
   6089     abc\ndef
   6090  0: abc\x0adef
   6091     abc\rdef
   6092  0: abc\x0ddef
   6093     abc\r\ndef
   6094  0: abc\x0d\x0adef
   6095 
   6096 /^\w+=.*(\\\n.*)*/
   6097     abc=xyz\\\npqr
   6098  0: abc=xyz\\x0apqr
   6099  1: abc=xyz\\x0apq
   6100  2: abc=xyz\\x0ap
   6101  3: abc=xyz\\x0a
   6102  4: abc=xyz\
   6103  5: abc=xyz
   6104  6: abc=xy
   6105  7: abc=x
   6106  8: abc=
   6107 
   6108 /^(a()*)*/
   6109     aaaa
   6110  0: aaaa
   6111  1: aaa
   6112  2: aa
   6113  3: a
   6114  4: 
   6115 
   6116 /^(?:a(?:(?:))*)*/
   6117     aaaa
   6118  0: aaaa
   6119  1: aaa
   6120  2: aa
   6121  3: a
   6122  4: 
   6123 
   6124 /^(a()+)+/
   6125     aaaa
   6126  0: aaaa
   6127  1: aaa
   6128  2: aa
   6129  3: a
   6130 
   6131 /^(?:a(?:(?:))+)+/
   6132     aaaa
   6133  0: aaaa
   6134  1: aaa
   6135  2: aa
   6136  3: a
   6137 
   6138 /(a|)*\d/
   6139   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
   6140  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
   6141 \= Expect no match
   6142   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
   6143 No match
   6144 
   6145 /(?>a|)*\d/
   6146   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
   6147  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
   6148 \= Expect no match
   6149   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
   6150 No match
   6151 
   6152 /(?:a|)*\d/
   6153   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
   6154  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
   6155 \= Expect no match
   6156   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
   6157 No match
   6158 
   6159 /^a.b/newline=lf
   6160     a\rb
   6161  0: a\x0db
   6162 \= Expect no match
   6163     a\nb
   6164 No match
   6165 
   6166 /^a.b/newline=cr
   6167     a\nb
   6168  0: a\x0ab
   6169 \= Expect no match
   6170     a\rb
   6171 No match
   6172 
   6173 /^a.b/newline=anycrlf
   6174     a\x85b
   6175  0: a\x85b
   6176 \= Expect no match
   6177     a\rb
   6178 No match
   6179 
   6180 /^a.b/newline=any
   6181 \= Expect no match
   6182     a\nb
   6183 No match
   6184     a\rb
   6185 No match
   6186     a\x85b
   6187 No match
   6188 
   6189 /^abc./gmx,newline=any
   6190     abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK
   6191  0: abc1
   6192  0: abc2
   6193  0: abc3
   6194  0: abc4
   6195  0: abc5
   6196  0: abc6
   6197  0: abc7
   6198 
   6199 /abc.$/gmx,newline=any
   6200     abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9
   6201  0: abc1
   6202  0: abc2
   6203  0: abc3
   6204  0: abc4
   6205  0: abc5
   6206  0: abc6
   6207  0: abc9
   6208 
   6209 /^a\Rb/bsr=unicode
   6210     a\nb
   6211  0: a\x0ab
   6212     a\rb
   6213  0: a\x0db
   6214     a\r\nb
   6215  0: a\x0d\x0ab
   6216     a\x0bb
   6217  0: a\x0bb
   6218     a\x0cb
   6219  0: a\x0cb
   6220     a\x85b   
   6221  0: a\x85b
   6222 \= Expect no match
   6223     a\n\rb    
   6224 No match
   6225 
   6226 /^a\R*b/bsr=unicode
   6227     ab
   6228  0: ab
   6229     a\nb
   6230  0: a\x0ab
   6231     a\rb
   6232  0: a\x0db
   6233     a\r\nb
   6234  0: a\x0d\x0ab
   6235     a\x0bb
   6236  0: a\x0bb
   6237     a\x0cb
   6238  0: a\x0cb
   6239     a\x85b   
   6240  0: a\x85b
   6241     a\n\rb    
   6242  0: a\x0a\x0db
   6243     a\n\r\x85\x0cb 
   6244  0: a\x0a\x0d\x85\x0cb
   6245 
   6246 /^a\R+b/bsr=unicode
   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 \= Expect no match
   6264     ab  
   6265 No match
   6266     
   6267 /^a\R{1,3}b/bsr=unicode
   6268     a\nb
   6269  0: a\x0ab
   6270     a\n\rb
   6271  0: a\x0a\x0db
   6272     a\n\r\x85b
   6273  0: a\x0a\x0d\x85b
   6274     a\r\n\r\nb 
   6275  0: a\x0d\x0a\x0d\x0ab
   6276     a\r\n\r\n\r\nb 
   6277  0: a\x0d\x0a\x0d\x0a\x0d\x0ab
   6278     a\n\r\n\rb
   6279  0: a\x0a\x0d\x0a\x0db
   6280     a\n\n\r\nb 
   6281  0: a\x0a\x0a\x0d\x0ab
   6282 \= Expect no match
   6283     a\n\n\n\rb
   6284 No match
   6285     a\r
   6286 No match
   6287 
   6288 /.+foo/
   6289     afoo
   6290  0: afoo
   6291 \= Expect no match 
   6292     \r\nfoo 
   6293 No match
   6294     \nfoo 
   6295 No match
   6296 
   6297 /.+foo/newline=crlf
   6298     afoo
   6299  0: afoo
   6300     \nfoo 
   6301  0: \x0afoo
   6302 \= Expect no match 
   6303     \r\nfoo 
   6304 No match
   6305 
   6306 /.+foo/newline=any
   6307     afoo
   6308  0: afoo
   6309 \= Expect no match 
   6310     \nfoo 
   6311 No match
   6312     \r\nfoo 
   6313 No match
   6314 
   6315 /.+foo/s
   6316     afoo
   6317  0: afoo
   6318     \r\nfoo 
   6319  0: \x0d\x0afoo
   6320     \nfoo 
   6321  0: \x0afoo
   6322 
   6323 /^$/gm,newline=any
   6324     abc\r\rxyz
   6325  0: 
   6326     abc\n\rxyz  
   6327  0: 
   6328 \= Expect no match 
   6329     abc\r\nxyz
   6330 No match
   6331 
   6332 /^X/m
   6333     XABC
   6334  0: X
   6335 \= Expect no match 
   6336     XABC\=notbol
   6337 No match
   6338 
   6339 /(?m)^$/g,newline=any,aftertext
   6340     abc\r\n\r\n
   6341  0: 
   6342  0+ \x0d\x0a
   6343 
   6344 /(?m)^$|^\r\n/g,newline=any,aftertext
   6345     abc\r\n\r\n
   6346  0: \x0d\x0a
   6347  0+ 
   6348  1: 
   6349     
   6350 /(?m)$/g,newline=any,aftertext
   6351     abc\r\n\r\n
   6352  0: 
   6353  0+ \x0d\x0a\x0d\x0a
   6354  0: 
   6355  0+ \x0d\x0a
   6356  0: 
   6357  0+ 
   6358 
   6359 /(?|(abc)|(xyz))/
   6360    >abc<
   6361  0: abc
   6362    >xyz< 
   6363  0: xyz
   6364 
   6365 /(x)(?|(abc)|(xyz))(x)/
   6366     xabcx
   6367  0: xabcx
   6368     xxyzx 
   6369  0: xxyzx
   6370 
   6371 /(x)(?|(abc)(pqr)|(xyz))(x)/
   6372     xabcpqrx
   6373  0: xabcpqrx
   6374     xxyzx 
   6375  0: xxyzx
   6376 
   6377 /(?|(abc)|(xyz))(?1)/
   6378     abcabc
   6379  0: abcabc
   6380     xyzabc 
   6381  0: xyzabc
   6382 \= Expect no match 
   6383     xyzxyz 
   6384 No match
   6385  
   6386 /\H\h\V\v/
   6387     X X\x0a
   6388  0: X X\x0a
   6389     X\x09X\x0b
   6390  0: X\x09X\x0b
   6391 \= Expect no match
   6392     \xa0 X\x0a   
   6393 No match
   6394     
   6395 /\H*\h+\V?\v{3,4}/
   6396     \x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a
   6397  0: \x09 \xa0X\x0a\x0b\x0c\x0d
   6398     \x09\x20\xa0\x0a\x0b\x0c\x0d\x0a
   6399  0: \x09 \xa0\x0a\x0b\x0c\x0d
   6400     \x09\x20\xa0\x0a\x0b\x0c
   6401  0: \x09 \xa0\x0a\x0b\x0c
   6402 \= Expect no match 
   6403     \x09\x20\xa0\x0a\x0b
   6404 No match
   6405      
   6406 /\H{3,4}/
   6407     XY  ABCDE
   6408  0: ABCD
   6409     XY  PQR ST 
   6410  0: PQR
   6411     
   6412 /.\h{3,4}./
   6413     XY  AB    PQRS
   6414  0: B    P
   6415  1: B    
   6416 
   6417 /\h*X\h?\H+Y\H?Z/
   6418     >XNNNYZ
   6419  0: XNNNYZ
   6420     >  X NYQZ
   6421  0:   X NYQZ
   6422 \= Expect no match
   6423     >XYZ   
   6424 No match
   6425     >  X NY Z
   6426 No match
   6427 
   6428 /\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/
   6429     >XY\x0aZ\x0aA\x0bNN\x0c
   6430  0: XY\x0aZ\x0aA\x0bNN\x0c
   6431     >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c
   6432  0: \x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c
   6433 
   6434 /.+A/newline=crlf
   6435 \= Expect no match
   6436     \r\nA
   6437 No match
   6438     
   6439 /\nA/newline=crlf
   6440     \r\nA 
   6441  0: \x0aA
   6442 
   6443 /[\r\n]A/newline=crlf
   6444     \r\nA 
   6445  0: \x0aA
   6446 
   6447 /(\r|\n)A/newline=crlf
   6448     \r\nA 
   6449  0: \x0aA
   6450 
   6451 /a\Rb/I,bsr=anycrlf
   6452 Capturing subpattern count = 0
   6453 \R matches CR, LF, or CRLF
   6454 First code unit = 'a'
   6455 Last code unit = 'b'
   6456 Subject length lower bound = 3
   6457     a\rb
   6458  0: a\x0db
   6459     a\nb
   6460  0: a\x0ab
   6461     a\r\nb
   6462  0: a\x0d\x0ab
   6463 \= Expect no match
   6464     a\x85b
   6465 No match
   6466     a\x0bb     
   6467 No match
   6468 
   6469 /a\Rb/I,bsr=unicode
   6470 Capturing subpattern count = 0
   6471 \R matches any Unicode newline
   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     a\x85b
   6482  0: a\x85b
   6483     a\x0bb     
   6484  0: a\x0bb
   6485     
   6486 /a\R?b/I,bsr=anycrlf
   6487 Capturing subpattern count = 0
   6488 \R matches CR, LF, or CRLF
   6489 First code unit = 'a'
   6490 Last code unit = 'b'
   6491 Subject length lower bound = 2
   6492     a\rb
   6493  0: a\x0db
   6494     a\nb
   6495  0: a\x0ab
   6496     a\r\nb
   6497  0: a\x0d\x0ab
   6498 \= Expect no match
   6499     a\x85b
   6500 No match
   6501     a\x0bb     
   6502 No match
   6503 
   6504 /a\R?b/I,bsr=unicode
   6505 Capturing subpattern count = 0
   6506 \R matches any Unicode newline
   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     a\x85b
   6517  0: a\x85b
   6518     a\x0bb     
   6519  0: a\x0bb
   6520     
   6521 /a\R{2,4}b/I,bsr=anycrlf
   6522 Capturing subpattern count = 0
   6523 \R matches CR, LF, or CRLF
   6524 First code unit = 'a'
   6525 Last code unit = 'b'
   6526 Subject length lower bound = 4
   6527     a\r\n\nb
   6528  0: a\x0d\x0a\x0ab
   6529     a\n\r\rb
   6530  0: a\x0a\x0d\x0db
   6531     a\r\n\r\n\r\n\r\nb
   6532  0: a\x0d\x0a\x0d\x0a\x0d\x0a\x0d\x0ab
   6533 \= Expect no match
   6534     a\x0b\x0bb     
   6535 No match
   6536     a\x85\x85b
   6537 No match
   6538 
   6539 /a\R{2,4}b/I,bsr=unicode
   6540 Capturing subpattern count = 0
   6541 \R matches any Unicode newline
   6542 First code unit = 'a'
   6543 Last code unit = 'b'
   6544 Subject length lower bound = 4
   6545     a\r\rb
   6546  0: a\x0d\x0db
   6547     a\n\n\nb
   6548  0: a\x0a\x0a\x0ab
   6549     a\r\n\n\r\rb
   6550  0: a\x0d\x0a\x0a\x0d\x0db
   6551     a\x85\x85b
   6552  0: a\x85\x85b
   6553     a\x0b\x0bb     
   6554  0: a\x0b\x0bb
   6555 \= Expect no match 
   6556     a\r\r\r\r\rb 
   6557 No match
   6558     
   6559 /a(?!)|\wbc/
   6560     abc 
   6561  0: abc
   6562 
   6563 /a[]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
   6564 \= Expect no match
   6565     ab
   6566 No match
   6567 
   6568 /a[]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
   6569 \= Expect no match
   6570     ab 
   6571 No match
   6572 
   6573 /a[]*+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
   6574 \= Expect no match
   6575     ab 
   6576 No match
   6577 
   6578 /a[^]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
   6579     aXb
   6580  0: aXb
   6581     a\nb 
   6582  0: a\x0ab
   6583 \= Expect no match
   6584     ab  
   6585 No match
   6586     
   6587 /a[^]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
   6588     aXb
   6589  0: aXb
   6590     a\nX\nXb 
   6591  0: a\x0aX\x0aXb
   6592 \= Expect no match
   6593     ab  
   6594 No match
   6595 
   6596 /X$/dollar_endonly
   6597     X
   6598  0: X
   6599 \= Expect no match 
   6600     X\n 
   6601 No match
   6602 
   6603 /X$/
   6604     X
   6605  0: X
   6606     X\n 
   6607  0: X
   6608 
   6609 /xyz/auto_callout
   6610   xyz 
   6611 --->xyz
   6612  +0 ^       x
   6613  +1 ^^      y
   6614  +2 ^ ^     z
   6615  +3 ^  ^    End of pattern
   6616  0: xyz
   6617   abcxyz 
   6618 --->abcxyz
   6619  +0    ^       x
   6620  +1    ^^      y
   6621  +2    ^ ^     z
   6622  +3    ^  ^    End of pattern
   6623  0: xyz
   6624 \= Expect no match 
   6625   abc
   6626 No match
   6627   abcxypqr  
   6628 No match
   6629 
   6630 /xyz/auto_callout,no_start_optimize
   6631   abcxyz 
   6632 --->abcxyz
   6633  +0 ^          x
   6634  +0  ^         x
   6635  +0   ^        x
   6636  +0    ^       x
   6637  +1    ^^      y
   6638  +2    ^ ^     z
   6639  +3    ^  ^    End of pattern
   6640  0: xyz
   6641 \= Expect no match 
   6642   abc
   6643 --->abc
   6644  +0 ^       x
   6645  +0  ^      x
   6646  +0   ^     x
   6647  +0    ^    x
   6648 No match
   6649   abcxypqr  
   6650 --->abcxypqr
   6651  +0 ^            x
   6652  +0  ^           x
   6653  +0   ^          x
   6654  +0    ^         x
   6655  +1    ^^        y
   6656  +2    ^ ^       z
   6657  +0     ^        x
   6658  +0      ^       x
   6659  +0       ^      x
   6660  +0        ^     x
   6661  +0         ^    x
   6662 No match
   6663 
   6664 /(*NO_START_OPT)xyz/auto_callout
   6665   abcxyz 
   6666 --->abcxyz
   6667 +15 ^          x
   6668 +15  ^         x
   6669 +15   ^        x
   6670 +15    ^       x
   6671 +16    ^^      y
   6672 +17    ^ ^     z
   6673 +18    ^  ^    End of pattern
   6674  0: xyz
   6675   
   6676 /(?C)ab/
   6677   ab
   6678 --->ab
   6679   0 ^      a
   6680  0: ab
   6681   ab\=callout_none
   6682  0: ab
   6683   
   6684 /ab/auto_callout
   6685   ab
   6686 --->ab
   6687  +0 ^      a
   6688  +1 ^^     b
   6689  +2 ^ ^    End of pattern
   6690  0: ab
   6691   ab\=callout_none
   6692  0: ab
   6693 
   6694 /^"((?(?=[a])[^"])|b)*"$/auto_callout
   6695     "ab"
   6696 --->"ab"
   6697  +0 ^        ^
   6698  +1 ^        "
   6699  +2 ^^       (
   6700 +21 ^^       "
   6701  +3 ^^       (?
   6702 +18 ^^       b
   6703  +5 ^^       (?=
   6704  +8  ^       [a]
   6705 +11  ^^      )
   6706 +12 ^^       [^"]
   6707 +16 ^ ^      )
   6708 +17 ^ ^      |
   6709 +21 ^ ^      "
   6710  +3 ^ ^      (?
   6711 +18 ^ ^      b
   6712  +5 ^ ^      (?=
   6713  +8   ^      [a]
   6714 +19 ^  ^     )*
   6715 +21 ^  ^     "
   6716  +3 ^  ^     (?
   6717 +18 ^  ^     b
   6718  +5 ^  ^     (?=
   6719  +8    ^     [a]
   6720 +17 ^  ^     |
   6721 +22 ^   ^    $
   6722 +23 ^   ^    End of pattern
   6723  0: "ab"
   6724     "ab"\=callout_none
   6725  0: "ab"
   6726 
   6727 /\d+X|9+Y/
   6728     ++++123999\=ps
   6729 Partial match: 123999
   6730     ++++123999Y\=ps
   6731  0: 999Y
   6732 
   6733 /Z(*F)/
   6734 \= Expect no match 
   6735     Z\=ps
   6736 No match
   6737     ZA\=ps
   6738 No match
   6739     
   6740 /Z(?!)/
   6741 \= Expect no match 
   6742     Z\=ps
   6743 No match
   6744     ZA\=ps
   6745 No match
   6746 
   6747 /dog(sbody)?/
   6748     dogs\=ps
   6749  0: dog
   6750     dogs\=ph
   6751 Partial match: dogs
   6752     
   6753 /dog(sbody)??/
   6754     dogs\=ps
   6755  0: dog
   6756     dogs\=ph
   6757 Partial match: dogs
   6758 
   6759 /dog|dogsbody/
   6760     dogs\=ps
   6761  0: dog
   6762     dogs\=ph
   6763 Partial match: dogs
   6764  
   6765 /dogsbody|dog/
   6766     dogs\=ps
   6767  0: dog
   6768     dogs\=ph
   6769 Partial match: dogs
   6770 
   6771 /Z(*F)Q|ZXY/
   6772     Z\=ps
   6773 Partial match: Z
   6774 \= Expect no match 
   6775     ZA\=ps
   6776 No match
   6777     X\=ps
   6778 No match
   6779 
   6780 /\bthe cat\b/
   6781     the cat\=ps
   6782  0: the cat
   6783     the cat\=ph
   6784 Partial match: the cat
   6785 
   6786 /dog(sbody)?/
   6787     dogs\=ps
   6788  0: dog
   6789     body\=dfa_restart
   6790  0: body
   6791 
   6792 /dog(sbody)?/
   6793     dogs\=ph
   6794 Partial match: dogs
   6795     body\=dfa_restart
   6796  0: body
   6797 
   6798 /abc/
   6799    abc\=ps
   6800  0: abc
   6801    abc\=ph
   6802  0: abc
   6803 
   6804 /abc\K123/
   6805     xyzabc123pqr
   6806 Failed: error -42: pattern contains an item that is not supported for DFA matching
   6807     
   6808 /(?<=abc)123/
   6809     xyzabc123pqr 
   6810  0: 123
   6811     xyzabc12\=ps
   6812 Partial match: abc12
   6813                <<<
   6814     xyzabc12\=ph
   6815 Partial match: abc12
   6816                <<<
   6817 
   6818 /\babc\b/
   6819     +++abc+++
   6820  0: abc
   6821     +++ab\=ps
   6822 Partial match: +ab
   6823                <
   6824     +++ab\=ph
   6825 Partial match: +ab
   6826                <
   6827 
   6828 /(?=C)/g,aftertext
   6829     ABCDECBA
   6830  0: 
   6831  0+ CDECBA
   6832  0: 
   6833  0+ CBA
   6834 
   6835 /(abc|def|xyz)/I
   6836 Capturing subpattern count = 1
   6837 Starting code units: a d x 
   6838 Subject length lower bound = 3
   6839     terhjk;abcdaadsfe
   6840  0: abc
   6841     the quick xyz brown fox 
   6842  0: xyz
   6843 \= Expect no match
   6844     thejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd
   6845 No match
   6846 
   6847 /(abc|def|xyz)/I,no_start_optimize
   6848 Capturing subpattern count = 1
   6849 Options: no_start_optimize
   6850 Subject length lower bound = 0
   6851     terhjk;abcdaadsfe
   6852  0: abc
   6853     the quick xyz brown fox
   6854  0: xyz
   6855 \= Expect no match
   6856     thejk;adlfj aenjl;fda asdfasd ehj;kjxyasiupd
   6857 No match
   6858 
   6859 /abcd*/aftertext
   6860     xxxxabcd\=ps
   6861  0: abcd
   6862  0+ 
   6863     xxxxabcd\=ph
   6864 Partial match: abcd
   6865     dddxxx\=dfa_restart
   6866  0: ddd
   6867  0+ xxx
   6868     xxxxabcd\=ph
   6869 Partial match: abcd
   6870     xxx\=dfa_restart
   6871  0: 
   6872  0+ xxx
   6873 
   6874 /abcd*/i
   6875     xxxxabcd\=ps
   6876  0: abcd
   6877     xxxxabcd\=ph
   6878 Partial match: abcd
   6879     XXXXABCD\=ps
   6880  0: ABCD
   6881     XXXXABCD\=ph
   6882 Partial match: ABCD
   6883 
   6884 /abc\d*/
   6885     xxxxabc1\=ps
   6886  0: abc1
   6887     xxxxabc1\=ph
   6888 Partial match: abc1
   6889 
   6890 /abc[de]*/
   6891     xxxxabcde\=ps
   6892  0: abcde
   6893     xxxxabcde\=ph
   6894 Partial match: abcde
   6895 
   6896 /(?:(?1)|B)(A(*F)|C)/
   6897     ABCD
   6898  0: BC
   6899     CCD
   6900  0: CC
   6901 \= Expect no match
   6902     CAD   
   6903 No match
   6904 
   6905 /^(?:(?1)|B)(A(*F)|C)/
   6906     CCD
   6907  0: CC
   6908     BCD 
   6909  0: BC
   6910 \= Expect no match
   6911     ABCD
   6912 No match
   6913     CAD
   6914 No match
   6915     BAD    
   6916 No match
   6917 
   6918 /^(?!a(*SKIP)b)/
   6919     ac
   6920 Failed: error -42: pattern contains an item that is not supported for DFA matching
   6921     
   6922 /^(?=a(*SKIP)b|ac)/
   6923     ac
   6924 Failed: error -42: pattern contains an item that is not supported for DFA matching
   6925     
   6926 /^(?=a(*THEN)b|ac)/
   6927     ac
   6928 Failed: error -42: pattern contains an item that is not supported for DFA matching
   6929     
   6930 /^(?=a(*PRUNE)b)/
   6931     ab  
   6932 Failed: error -42: pattern contains an item that is not supported for DFA matching
   6933 
   6934 /^(?(?!a(*SKIP)b))/
   6935     ac
   6936 Failed: error -42: pattern contains an item that is not supported for DFA matching
   6937 
   6938 /(?<=abc)def/
   6939     abc\=ph
   6940 Partial match: abc
   6941                <<<
   6942 
   6943 /abc$/
   6944     abc
   6945  0: abc
   6946     abc\=ps
   6947  0: abc
   6948     abc\=ph
   6949 Partial match: abc
   6950 
   6951 /abc$/m
   6952     abc
   6953  0: abc
   6954     abc\n
   6955  0: abc
   6956     abc\=ph
   6957 Partial match: abc
   6958     abc\n\=ph
   6959  0: abc
   6960     abc\=ps
   6961  0: abc
   6962     abc\n\=ps
   6963  0: abc
   6964 
   6965 /abc\z/
   6966     abc
   6967  0: abc
   6968     abc\=ps
   6969  0: abc
   6970     abc\=ph
   6971 Partial match: abc
   6972 
   6973 /abc\Z/
   6974     abc
   6975  0: abc
   6976     abc\=ps
   6977  0: abc
   6978     abc\=ph
   6979 Partial match: abc
   6980 
   6981 /abc\b/
   6982     abc
   6983  0: abc
   6984     abc\=ps
   6985  0: abc
   6986     abc\=ph
   6987 Partial match: abc
   6988 
   6989 /abc\B/
   6990     abc\=ps
   6991 Partial match: abc
   6992     abc\=ph
   6993 Partial match: abc
   6994 \= Expect no match 
   6995     abc
   6996 No match
   6997 
   6998 /.+/
   6999     abc\=offset=0
   7000  0: abc
   7001     abc\=offset=1
   7002  0: bc
   7003     abc\=offset=2
   7004  0: c
   7005 \= Bad offsets
   7006     abc\=offset=4
   7007 Failed: error -33: bad offset value
   7008     abc\=offset=-4 
   7009 ** Invalid value in 'offset=-4'
   7010 \= Expect no match 
   7011     abc\=offset=3
   7012 No match
   7013 
   7014 /^(?:a)++\w/
   7015      aaaab
   7016  0: aaaab
   7017 \= Expect no match 
   7018      aaaa 
   7019 No match
   7020      bbb 
   7021 No match
   7022 
   7023 /^(?:aa|(?:a)++\w)/
   7024      aaaab
   7025  0: aaaab
   7026  1: aa
   7027      aaaa 
   7028  0: aa
   7029 \= Expect no match 
   7030      bbb 
   7031 No match
   7032 
   7033 /^(?:a)*+\w/
   7034      aaaab
   7035  0: aaaab
   7036      bbb 
   7037  0: b
   7038 \= Expect no match 
   7039      aaaa 
   7040 No match
   7041 
   7042 /^(a)++\w/
   7043      aaaab
   7044  0: aaaab
   7045 \= Expect no match 
   7046      aaaa 
   7047 No match
   7048      bbb 
   7049 No match
   7050 
   7051 /^(a|)++\w/
   7052      aaaab
   7053  0: aaaab
   7054 \= Expect no match 
   7055      aaaa 
   7056 No match
   7057      bbb 
   7058 No match
   7059 
   7060 /(?=abc){3}abc/aftertext
   7061     abcabcabc
   7062  0: abc
   7063  0+ abcabc
   7064 \= Expect no match
   7065     xyz  
   7066 No match
   7067     
   7068 /(?=abc)+abc/aftertext
   7069     abcabcabc
   7070  0: abc
   7071  0+ abcabc
   7072 \= Expect no match
   7073     xyz  
   7074 No match
   7075     
   7076 /(?=abc)++abc/aftertext
   7077     abcabcabc
   7078  0: abc
   7079  0+ abcabc
   7080 \= Expect no match
   7081     xyz  
   7082 No match
   7083     
   7084 /(?=abc){0}xyz/
   7085     xyz 
   7086  0: xyz
   7087 
   7088 /(?=abc){1}xyz/
   7089 \= Expect no match
   7090     xyz 
   7091 No match
   7092     
   7093 /(?=(a))?./
   7094     ab
   7095  0: a
   7096     bc
   7097  0: b
   7098       
   7099 /(?=(a))??./
   7100     ab
   7101  0: a
   7102     bc
   7103  0: b
   7104 
   7105 /^(?=(a)){0}b(?1)/
   7106     backgammon
   7107  0: ba
   7108 
   7109 /^(?=(?1))?[az]([abc])d/
   7110     abd 
   7111  0: abd
   7112     zcdxx 
   7113  0: zcd
   7114 
   7115 /^(?!a){0}\w+/
   7116     aaaaa
   7117  0: aaaaa
   7118 
   7119 /(?<=(abc))?xyz/
   7120     abcxyz
   7121  0: xyz
   7122     pqrxyz 
   7123  0: xyz
   7124 
   7125 /((?2))((?1))/
   7126     abc
   7127 Failed: error -52: nested recursion at the same subject position
   7128 
   7129 /(?(R)a+|(?R)b)/
   7130     aaaabcde
   7131  0: aaaab
   7132 
   7133 /(?(R)a+|((?R))b)/
   7134     aaaabcde
   7135  0: aaaab
   7136 
   7137 /((?(R)a+|(?1)b))/
   7138     aaaabcde
   7139  0: aaaab
   7140 
   7141 /((?(R2)a+|(?1)b))()/
   7142     aaaabcde
   7143 Failed: error -40: backreference condition or recursion test is not supported for DFA matching
   7144 
   7145 /(?(R)a*(?1)|((?R))b)/
   7146     aaaabcde
   7147 Failed: error -52: nested recursion at the same subject position
   7148 
   7149 /(a+)/no_auto_possess
   7150     aaaa\=ovector=3
   7151 Matched, but offsets vector is too small to show all matches
   7152  0: aaaa
   7153  1: aaa
   7154  2: aa
   7155     aaaa\=ovector=4
   7156  0: aaaa
   7157  1: aaa
   7158  2: aa
   7159  3: a
   7160 
   7161 /^\R/
   7162     \r\=ps
   7163  0: \x0d
   7164     \r\=ph
   7165 Partial match: \x0d
   7166     
   7167 /^\R{2,3}x/
   7168     \r\=ps
   7169 Partial match: \x0d
   7170     \r\=ph
   7171 Partial match: \x0d
   7172     \r\r\=ps
   7173 Partial match: \x0d\x0d
   7174     \r\r\=ph
   7175 Partial match: \x0d\x0d
   7176     \r\r\r\=ps
   7177 Partial match: \x0d\x0d\x0d
   7178     \r\r\r\=ph
   7179 Partial match: \x0d\x0d\x0d
   7180     \r\rx
   7181  0: \x0d\x0dx
   7182     \r\r\rx    
   7183  0: \x0d\x0d\x0dx
   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?x/
   7204     \r\=ps
   7205 Partial match: \x0d
   7206     \r\=ph
   7207 Partial match: \x0d
   7208     x
   7209  0: x
   7210     \rx  
   7211  0: \x0dx
   7212 
   7213 /^\R+x/
   7214     \r\=ps
   7215 Partial match: \x0d
   7216     \r\=ph
   7217 Partial match: \x0d
   7218     \r\n\=ps
   7219 Partial match: \x0d\x0a
   7220     \r\n\=ph
   7221 Partial match: \x0d\x0a
   7222     \rx  
   7223  0: \x0dx
   7224 
   7225 /^a$/newline=crlf
   7226     a\r\=ps
   7227 Partial match: a\x0d
   7228     a\r\=ph
   7229 Partial match: a\x0d
   7230 
   7231 /^a$/m,newline=crlf
   7232     a\r\=ps
   7233 Partial match: a\x0d
   7234     a\r\=ph
   7235 Partial match: a\x0d
   7236 
   7237 /^(a$|a\r)/newline=crlf
   7238     a\r\=ps
   7239  0: a\x0d
   7240     a\r\=ph
   7241 Partial match: a\x0d
   7242 
   7243 /^(a$|a\r)/m,newline=crlf
   7244     a\r\=ps
   7245  0: a\x0d
   7246     a\r\=ph
   7247 Partial match: a\x0d
   7248 
   7249 /./newline=crlf
   7250     \r\=ps
   7251  0: \x0d
   7252     \r\=ph
   7253 Partial match: \x0d
   7254   
   7255 /.{2,3}/newline=crlf
   7256     \r\=ps
   7257 Partial match: \x0d
   7258     \r\=ph
   7259 Partial match: \x0d
   7260     \r\r\=ps
   7261  0: \x0d\x0d
   7262     \r\r\=ph
   7263 Partial match: \x0d\x0d
   7264     \r\r\r\=ps
   7265  0: \x0d\x0d\x0d
   7266     \r\r\r\=ph
   7267 Partial match: \x0d\x0d\x0d
   7268 
   7269 /.{2,3}?/newline=crlf
   7270     \r\=ps
   7271 Partial match: \x0d
   7272     \r\=ph
   7273 Partial match: \x0d
   7274     \r\r\=ps
   7275  0: \x0d\x0d
   7276     \r\r\=ph
   7277 Partial match: \x0d\x0d
   7278     \r\r\r\=ps
   7279  0: \x0d\x0d\x0d
   7280  1: \x0d\x0d
   7281     \r\r\r\=ph
   7282 Partial match: \x0d\x0d\x0d
   7283 
   7284 # Test simple validity check for restarts 
   7285 
   7286 /abcdef/
   7287    abc\=dfa_restart
   7288 Failed: error -38: invalid data in workspace for DFA restart
   7289 
   7290 /<H((?(?!<H|F>)(.)|(?R))++)*F>/
   7291     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.
   7292  0: <H more text <H texting more  hexA0-"\xa0"    hex above 7F-"\xbc" F> text xxxxx <H text F> text F>
   7293 
   7294 /^(?>.{4})abc|^\w\w.xabcd/
   7295     xxxxabcd
   7296  0: xxxxabcd
   7297  1: xxxxabc
   7298     xx\xa0xabcd 
   7299  0: xx\xa0xabcd
   7300  1: xx\xa0xabc
   7301 
   7302 /^(.{4}){2}+abc|^\w\w.x\w\w\w\wabcd/
   7303     xxxxxxxxabcd
   7304  0: xxxxxxxxabcd
   7305  1: xxxxxxxxabc
   7306     xx\xa0xxxxxabcd 
   7307  0: xx\xa0xxxxxabcd
   7308  1: xx\xa0xxxxxabc
   7309 
   7310 /abcd/
   7311     abcd\=ovector=0
   7312  0: abcd
   7313 
   7314 # These tests show up auto-possessification 
   7315 
   7316 /[ab]*/
   7317     aaaa
   7318  0: aaaa
   7319     
   7320 /[ab]*?/
   7321     aaaa
   7322  0: aaaa
   7323  1: aaa
   7324  2: aa
   7325  3: a
   7326  4: 
   7327     
   7328 /[ab]?/
   7329     aaaa
   7330  0: a
   7331     
   7332 /[ab]??/
   7333     aaaa
   7334  0: a
   7335  1: 
   7336     
   7337 /[ab]+/
   7338     aaaa
   7339  0: aaaa
   7340     
   7341 /[ab]+?/
   7342     aaaa
   7343  0: aaaa
   7344  1: aaa
   7345  2: aa
   7346  3: a
   7347     
   7348 /[ab]{2,3}/
   7349     aaaa
   7350  0: aaa
   7351     
   7352 /[ab]{2,3}?/
   7353     aaaa
   7354  0: aaa
   7355  1: aa
   7356     
   7357 /[ab]{2,}/
   7358     aaaa    
   7359  0: aaaa
   7360 
   7361 /[ab]{2,}?/
   7362     aaaa    
   7363  0: aaaa
   7364  1: aaa
   7365  2: aa
   7366 
   7367 '\A(?:[^\"]++|\"(?:[^\"]*+|\"\")*+\")++'
   7368     NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
   7369  0: NON QUOTED "QUOT""ED" AFTER 
   7370 
   7371 '\A(?:[^\"]++|\"(?:[^\"]++|\"\")*+\")++'
   7372     NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
   7373  0: NON QUOTED "QUOT""ED" AFTER 
   7374 
   7375 /abc(?=xyz)/allusedtext
   7376     abcxyzpqr
   7377  0: abcxyz
   7378        >>>
   7379     abcxyzpqr\=aftertext
   7380  0: abcxyz
   7381        >>>
   7382  0+ xyzpqr
   7383     
   7384 /(?<=pqr)abc(?=xyz)/allusedtext
   7385     xyzpqrabcxyzpqr
   7386  0: pqrabcxyz
   7387     <<<   >>>
   7388     xyzpqrabcxyzpqr\=aftertext
   7389  0: pqrabcxyz
   7390     <<<   >>>
   7391  0+ xyzpqr
   7392     
   7393 /a\b/
   7394     a.\=allusedtext
   7395  0: a.
   7396      >
   7397     a\=allusedtext  
   7398  0: a
   7399 
   7400 /abc(?=abcde)(?=ab)/allusedtext
   7401     abcabcdefg
   7402  0: abcabcde
   7403        >>>>>
   7404 
   7405 /a*?b*?/
   7406     ab
   7407  0: ab
   7408  1: a
   7409  2: 
   7410 
   7411 /(*NOTEMPTY)a*?b*?/
   7412     ab
   7413  0: ab
   7414  1: a
   7415     ba
   7416  0: b
   7417     cb  
   7418  0: b
   7419 
   7420 /(*NOTEMPTY_ATSTART)a*?b*?/aftertext
   7421     ab
   7422  0: ab
   7423  0+ 
   7424  1: a
   7425     cdab 
   7426  0: 
   7427  0+ dab
   7428 
   7429 /(a)(b)|(c)/
   7430     XcX\=ovector=2,get=1,get=2,get=3,get=4,getall
   7431  0: c
   7432 Get substring 1 failed (-55): requested value is not set
   7433 Get substring 2 failed (-54): requested value is not available
   7434 Get substring 3 failed (-54): requested value is not available
   7435 Get substring 4 failed (-54): requested value is not available
   7436  0L c
   7437 
   7438 /(?<A>aa)/
   7439     aa\=get=A
   7440  0: aa
   7441 Get substring 'A' failed (-41): function is not supported for DFA matching
   7442     aa\=copy=A 
   7443  0: aa
   7444 Copy substring 'A' failed (-41): function is not supported for DFA matching
   7445 
   7446 /a+/no_auto_possess
   7447     a\=ovector=2,get=1,get=2,getall
   7448  0: a
   7449 Get substring 1 failed (-55): requested value is not set
   7450 Get substring 2 failed (-54): requested value is not available
   7451  0L a
   7452     aaa\=ovector=2,get=1,get=2,getall
   7453 Matched, but offsets vector is too small to show all matches
   7454  0: aaa
   7455  1: aa
   7456  1G aa (2)
   7457 Get substring 2 failed (-54): requested value is not available
   7458  0L aaa
   7459  1L aa
   7460 
   7461 /a(b)c(d)/
   7462     abc\=ph,copy=0,copy=1,getall
   7463 Partial match: abc
   7464  0C abc (3)
   7465 Copy substring 1 failed (-2): partial match
   7466 get substring list failed (-2): partial match
   7467 
   7468 /ab(?C" any text with spaces ")cde/B
   7469 ------------------------------------------------------------------
   7470         Bra
   7471         ab
   7472         CalloutStr " any text with spaces " 6 30 1
   7473         cde
   7474         Ket
   7475         End
   7476 ------------------------------------------------------------------
   7477     abcde
   7478 Callout (6): " any text with spaces "
   7479 --->abcde
   7480     ^ ^       c
   7481  0: abcde
   7482     12abcde
   7483 Callout (6): " any text with spaces "
   7484 --->12abcde
   7485       ^ ^       c
   7486  0: abcde
   7487 
   7488 /^a(b)c(?C1)def/
   7489       abcdef
   7490 --->abcdef
   7491   1 ^  ^       d
   7492  0: abcdef
   7493 
   7494 /^a(b)c(?C"AB")def/
   7495       abcdef
   7496 Callout (10): "AB"
   7497 --->abcdef
   7498     ^  ^       d
   7499  0: abcdef
   7500 
   7501 /^a(b)c(?C1)def/
   7502       abcdef\=callout_capture
   7503 Callout 1: last capture = 0
   7504 --->abcdef
   7505     ^  ^       d
   7506  0: abcdef
   7507 
   7508 /^a(b)c(?C{AB})def/B
   7509 ------------------------------------------------------------------
   7510         Bra
   7511         ^
   7512         a
   7513         CBra 1
   7514         b
   7515         Ket
   7516         c
   7517         CalloutStr {AB} 10 14 1
   7518         def
   7519         Ket
   7520         End
   7521 ------------------------------------------------------------------
   7522       abcdef\=callout_capture
   7523 Callout (10): {AB} last capture = 0
   7524 --->abcdef
   7525     ^  ^       d
   7526  0: abcdef
   7527 
   7528 /^(?(?C25)(?=abc)abcd|xyz)/B
   7529 ------------------------------------------------------------------
   7530         Bra
   7531         ^
   7532         Cond
   7533         Callout 25 9 3
   7534         Assert
   7535         abc
   7536         Ket
   7537         abcd
   7538         Alt
   7539         xyz
   7540         Ket
   7541         Ket
   7542         End
   7543 ------------------------------------------------------------------
   7544     abcdefg
   7545 --->abcdefg
   7546  25 ^           (?=
   7547  0: abcd
   7548     xyz123 
   7549 --->xyz123
   7550  25 ^          (?=
   7551  0: xyz
   7552 
   7553 /^(?(?C$abc$)(?=abc)abcd|xyz)/B
   7554 ------------------------------------------------------------------
   7555         Bra
   7556         ^
   7557         Cond
   7558         CalloutStr $abc$ 7 12 3
   7559         Assert
   7560         abc
   7561         Ket
   7562         abcd
   7563         Alt
   7564         xyz
   7565         Ket
   7566         Ket
   7567         End
   7568 ------------------------------------------------------------------
   7569     abcdefg
   7570 Callout (7): $abc$
   7571 --->abcdefg
   7572     ^           (?=
   7573  0: abcd
   7574     xyz123 
   7575 Callout (7): $abc$
   7576 --->xyz123
   7577     ^          (?=
   7578  0: xyz
   7579 
   7580 /^ab(?C'first')cd(?C"second")ef/
   7581     abcdefg
   7582 Callout (7): 'first'
   7583 --->abcdefg
   7584     ^ ^         c
   7585 Callout (20): "second"
   7586 --->abcdefg
   7587     ^   ^       e
   7588  0: abcdef
   7589 
   7590 /(?:a(?C`code`)){3}X/
   7591     aaaXY
   7592 Callout (8): `code`
   7593 --->aaaXY
   7594     ^^        ){3}
   7595 Callout (8): `code`
   7596 --->aaaXY
   7597     ^ ^       ){3}
   7598 Callout (8): `code`
   7599 --->aaaXY
   7600     ^  ^      ){3}
   7601  0: aaaX
   7602 
   7603 # Binary zero in callout string
   7604 /"a(?C'x" 00 "z')b"/hex
   7605     abcdefgh
   7606 Callout (5): 'x\x00z'
   7607 --->abcdefgh
   7608     ^^           b
   7609  0: ab
   7610 
   7611 /(?(?!)a|b)/
   7612     bbb
   7613  0: b
   7614 \= Expect no match
   7615     aaa 
   7616 No match
   7617 
   7618 /^/gm
   7619     \n\n\n
   7620  0: 
   7621  0: 
   7622  0: 
   7623 
   7624 /^/gm,alt_circumflex
   7625     \n\n\n
   7626  0: 
   7627  0: 
   7628  0: 
   7629  0: 
   7630 
   7631 /abc/use_offset_limit
   7632     1234abcde\=offset_limit=100
   7633  0: abc
   7634     1234abcde\=offset_limit=9
   7635  0: abc
   7636     1234abcde\=offset_limit=4
   7637  0: abc
   7638     1234abcde\=offset_limit=4,offset=4
   7639  0: abc
   7640 \= Expect no match
   7641     1234abcde\=offset_limit=4,offset=5
   7642 No match
   7643     1234abcde\=offset_limit=3
   7644 No match
   7645 
   7646 /(?<=abc)/use_offset_limit
   7647     1234abc\=offset_limit=7
   7648  0: 
   7649 \= Expect no match
   7650     1234abc\=offset_limit=6
   7651 No match
   7652 
   7653 /abcd/null_context
   7654     abcd\=null_context
   7655  0: abcd
   7656 
   7657 /()()a+/no_auto_possess
   7658     aaa\=allcaptures
   7659 ** Ignored after DFA matching: allcaptures
   7660  0: aaa
   7661  1: aa
   7662  2: a
   7663     a\=allcaptures
   7664 ** Ignored after DFA matching: allcaptures
   7665  0: a
   7666 
   7667 /(*LIMIT_DEPTH=100)^((.)(?1)|.)$/
   7668 \= Expect depth limit exceeded
   7669     a[00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]
   7670 Failed: error -53: matching depth limit exceeded
   7671 
   7672 /(*LIMIT_HEAP=0)^((.)(?1)|.)$/
   7673 \= Expect heap limit exceeded
   7674     a[00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]
   7675 Failed: error -63: heap limit exceeded
   7676 
   7677 /(*LIMIT_HEAP=50000)^((.)(?1)|.)$/
   7678 \= Expect success
   7679     a[00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]
   7680  0: a[00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]
   7681 
   7682 /(02-)?[0-9]{3}-[0-9]{3}/
   7683     02-123-123
   7684  0: 02-123-123
   7685 
   7686 /^(a(?2))(b)(?1)/
   7687     abbab\=find_limits 
   7688 Minimum heap limit = 0
   7689 Minimum match limit = 4
   7690 Minimum depth limit = 2
   7691  0: abbab
   7692 
   7693 /abc/endanchored
   7694     xyzabc
   7695  0: abc
   7696 \= Expect no match
   7697     xyzabcdef
   7698 No match
   7699 \= Expect error
   7700     xyzabc\=ph
   7701 Failed: error -34: bad option value
   7702 
   7703 /abc/
   7704     xyzabc\=endanchored
   7705  0: abc
   7706 \= Expect no match
   7707     xyzabcdef\=endanchored
   7708 No match
   7709 \= Expect error
   7710     xyzabc\=ps,endanchored
   7711 Failed: error -34: bad option value
   7712 
   7713 /abc|bcd/endanchored
   7714     xyzabcd
   7715  0: bcd
   7716 \= Expect no match
   7717     xyzabcdef
   7718 No match
   7719 
   7720 /(*NUL)^.*/
   7721     a\nb\x00ccc
   7722  0: a\x0ab
   7723     
   7724 /(*NUL)^.*/s
   7725     a\nb\x00ccc
   7726  0: a\x0ab\x00ccc
   7727     
   7728 /^x/m,newline=nul
   7729     ab\x00xy
   7730  0: x
   7731     
   7732 /'#comment' 0d 0a 00 '^x\' 0a 'y'/x,newline=nul,hex
   7733     x\nyz 
   7734  0: x\x0ay
   7735  
   7736 /(*NUL)^X\NY/
   7737     X\nY
   7738  0: X\x0aY
   7739     X\rY
   7740  0: X\x0dY
   7741 \= Expect no match
   7742     X\x00Y      
   7743 No match
   7744 
   7745 /(?<=abc|)/
   7746     abcde\=aftertext
   7747  0: 
   7748  0+ abcde
   7749     
   7750 /(?<=|abc)/ 
   7751     abcde\=aftertext
   7752  0: 
   7753  0+ abcde
   7754 
   7755 /(?<=abc|)/endanchored
   7756     abcde\=aftertext
   7757  0: 
   7758  0+ 
   7759     
   7760 /(?<=|abc)/endanchored
   7761     abcde\=aftertext
   7762  0: 
   7763  0+ 
   7764 
   7765 /(*LIMIT_MATCH=100).*(?![|H]?.*(?![|H]?););.*(?![|H]?.*(?![|H]?););\x00\x00\x00\x00\x00\x00\x00(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?![|);)?.*(![|H]?);)?.*(?![|H]?);)?.*(?![|H]?);)?.*(?![|H]););![|H]?););[|H]?);|H]?);)\x00\x00\x00\x00\x00\x00H]?););?![|H]?);)?.*(?![|H]?););[||H]?);)?.*(?![|H]?););[|H]?);(?![|H]?););![|H]?););[|H]?);|H]?);)?.*(?![|H]?););;[\x00\x00\x00\x00\x00\x00\x00![|H]?););![|H]?););[|H]?);|H]?);)?.*(?![|H]?););/no_dotstar_anchor
   7767 \= Expect limit exceeded
   7768 .*(?![|H]?.*(?![|H]?););.*(?![|H]?.*(?![|H]?););\x00\x00\x00\x00\x00\x00\x00(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?!(?![|);)?.*(![|H]?);)?.*(?![|H]?);)?.*(?![|H]?);)?.*(?![|H]););![|H]?););[|H]?);|H]?);)\x00\x00\x00\x00\x00\x00H]?););?![|H]?);)?.*(?![|H]?););[||H]?);)?.*(?![|H]?););[|H]?);(?![|H]?););![|H]?););[|H]?);|H]?);)?.*(?![|H]?););;[\x00\x00\x00\x00\x00\x00\x00![|H]?););![|H]?););[|H]?);|H]?);)?.*(?![|H]?););
   7770 Failed: error -47: match limit exceeded
   7771 
   7772 /\n/firstline
   7773     xyz\nabc
   7774  0: \x0a
   7775 
   7776 /\nabc/firstline
   7777     xyz\nabc
   7778  0: \x0aabc
   7779 
   7780 /\x{0a}abc/firstline,newline=crlf
   7781 \= Expect no match
   7782     xyz\r\nabc
   7783 No match
   7784 
   7785 /[abc]/firstline
   7786 \= Expect no match
   7787     \na
   7788 No match
   7789     
   7790 # End of testinput6
   7791