"Fossies" - the Fresh Open Source Software Archive

Member "vfu-4.18/vslib/pcre2/pcre2-10.20/testdata/testinput1" (16 May 2015, 99697 Bytes) of package /linux/privat/vfu-4.18.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 # This set of tests is for features that are compatible with all versions of
    2 # Perl >= 5.10, in non-UTF mode. It should run clean for the 8-bit, 16-bit, and
    3 # 32-bit PCRE libraries, and also using the perltest.pl script.
    4     
    5 #forbid_utf
    6 #perltest
    7 
    8 /the quick brown fox/
    9     the quick brown fox
   10     The quick brown FOX
   11     What do you know about the quick brown fox?
   12     What do you know about THE QUICK BROWN FOX?
   13 
   14 /The quick brown fox/i
   15     the quick brown fox
   16     The quick brown FOX
   17     What do you know about the quick brown fox?
   18     What do you know about THE QUICK BROWN FOX?
   19 
   20 /abcd\t\n\r\f\a\e\071\x3b\$\\\?caxyz/
   21     abcd\t\n\r\f\a\e9;\$\\?caxyz
   22 
   23 /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/
   24     abxyzpqrrrabbxyyyypqAzz
   25     abxyzpqrrrabbxyyyypqAzz
   26     aabxyzpqrrrabbxyyyypqAzz
   27     aaabxyzpqrrrabbxyyyypqAzz
   28     aaaabxyzpqrrrabbxyyyypqAzz
   29     abcxyzpqrrrabbxyyyypqAzz
   30     aabcxyzpqrrrabbxyyyypqAzz
   31     aaabcxyzpqrrrabbxyyyypAzz
   32     aaabcxyzpqrrrabbxyyyypqAzz
   33     aaabcxyzpqrrrabbxyyyypqqAzz
   34     aaabcxyzpqrrrabbxyyyypqqqAzz
   35     aaabcxyzpqrrrabbxyyyypqqqqAzz
   36     aaabcxyzpqrrrabbxyyyypqqqqqAzz
   37     aaabcxyzpqrrrabbxyyyypqqqqqqAzz
   38     aaaabcxyzpqrrrabbxyyyypqAzz
   39     abxyzzpqrrrabbxyyyypqAzz
   40     aabxyzzzpqrrrabbxyyyypqAzz
   41     aaabxyzzzzpqrrrabbxyyyypqAzz
   42     aaaabxyzzzzpqrrrabbxyyyypqAzz
   43     abcxyzzpqrrrabbxyyyypqAzz
   44     aabcxyzzzpqrrrabbxyyyypqAzz
   45     aaabcxyzzzzpqrrrabbxyyyypqAzz
   46     aaaabcxyzzzzpqrrrabbxyyyypqAzz
   47     aaaabcxyzzzzpqrrrabbbxyyyypqAzz
   48     aaaabcxyzzzzpqrrrabbbxyyyyypqAzz
   49     aaabcxyzpqrrrabbxyyyypABzz
   50     aaabcxyzpqrrrabbxyyyypABBzz
   51     >>>aaabxyzpqrrrabbxyyyypqAzz
   52     >aaaabxyzpqrrrabbxyyyypqAzz
   53     >>>>abcxyzpqrrrabbxyyyypqAzz
   54     *** Failers
   55     abxyzpqrrabbxyyyypqAzz
   56     abxyzpqrrrrabbxyyyypqAzz
   57     abxyzpqrrrabxyyyypqAzz
   58     aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz
   59     aaaabcxyzzzzpqrrrabbbxyyypqAzz
   60     aaabcxyzpqrrrabbxyyyypqqqqqqqAzz
   61 
   62 /^(abc){1,2}zz/
   63     abczz
   64     abcabczz
   65     *** Failers
   66     zz
   67     abcabcabczz
   68     >>abczz
   69 
   70 /^(b+?|a){1,2}?c/
   71     bc
   72     bbc
   73     bbbc
   74     bac
   75     bbac
   76     aac
   77     abbbbbbbbbbbc
   78     bbbbbbbbbbbac
   79     *** Failers
   80     aaac
   81     abbbbbbbbbbbac
   82 
   83 /^(b+|a){1,2}c/
   84     bc
   85     bbc
   86     bbbc
   87     bac
   88     bbac
   89     aac
   90     abbbbbbbbbbbc
   91     bbbbbbbbbbbac
   92     *** Failers
   93     aaac
   94     abbbbbbbbbbbac
   95 
   96 /^(b+|a){1,2}?bc/
   97     bbc
   98 
   99 /^(b*|ba){1,2}?bc/
  100     babc
  101     bbabc
  102     bababc
  103     *** Failers
  104     bababbc
  105     babababc
  106 
  107 /^(ba|b*){1,2}?bc/
  108     babc
  109     bbabc
  110     bababc
  111     *** Failers
  112     bababbc
  113     babababc
  114 
  115 /^\ca\cA\c[;\c:/
  116     \x01\x01\e;z
  117 
  118 /^[ab\]cde]/
  119     athing
  120     bthing
  121     ]thing
  122     cthing
  123     dthing
  124     ething
  125     *** Failers
  126     fthing
  127     [thing
  128     \\thing
  129 
  130 /^[]cde]/
  131     ]thing
  132     cthing
  133     dthing
  134     ething
  135     *** Failers
  136     athing
  137     fthing
  138 
  139 /^[^ab\]cde]/
  140     fthing
  141     [thing
  142     \\thing
  143     *** Failers
  144     athing
  145     bthing
  146     ]thing
  147     cthing
  148     dthing
  149     ething
  150 
  151 /^[^]cde]/
  152     athing
  153     fthing
  154     *** Failers
  155     ]thing
  156     cthing
  157     dthing
  158     ething
  159 
  160 /^\/
  161     
  162 
  163 /^/
  164     
  165 
  166 /^[0-9]+$/
  167     0
  168     1
  169     2
  170     3
  171     4
  172     5
  173     6
  174     7
  175     8
  176     9
  177     10
  178     100
  179     *** Failers
  180     abc
  181 
  182 /^.*nter/
  183     enter
  184     inter
  185     uponter
  186 
  187 /^xxx[0-9]+$/
  188     xxx0
  189     xxx1234
  190     *** Failers
  191     xxx
  192 
  193 /^.+[0-9][0-9][0-9]$/
  194     x123
  195     xx123
  196     123456
  197     *** Failers
  198     123
  199     x1234
  200 
  201 /^.+?[0-9][0-9][0-9]$/
  202     x123
  203     xx123
  204     123456
  205     *** Failers
  206     123
  207     x1234
  208 
  209 /^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/
  210     abc!pqr=apquxz.ixr.zzz.ac.uk
  211     *** Failers
  212     !pqr=apquxz.ixr.zzz.ac.uk
  213     abc!=apquxz.ixr.zzz.ac.uk
  214     abc!pqr=apquxz:ixr.zzz.ac.uk
  215     abc!pqr=apquxz.ixr.zzz.ac.ukk
  216 
  217 /:/
  218     Well, we need a colon: somewhere
  219     *** Fail if we don't
  220 
  221 /([\da-f:]+)$/i
  222     0abc
  223     abc
  224     fed
  225     E
  226     ::
  227     5f03:12C0::932e
  228     fed def
  229     Any old stuff
  230     *** Failers
  231     0zzz
  232     gzzz
  233     fed\x20
  234     Any old rubbish
  235 
  236 /^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/
  237     .1.2.3
  238     A.12.123.0
  239     *** Failers
  240     .1.2.3333
  241     1.2.3
  242     1234.2.3
  243 
  244 /^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/
  245     1 IN SOA non-sp1 non-sp2(
  246     1    IN    SOA    non-sp1    non-sp2   (
  247     *** Failers
  248     1IN SOA non-sp1 non-sp2(
  249 
  250 /^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/
  251     a.
  252     Z.
  253     2.
  254     ab-c.pq-r.
  255     sxk.zzz.ac.uk.
  256     x-.y-.
  257     *** Failers
  258     -abc.peq.
  259 
  260 /^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/
  261     *.a
  262     *.b0-a
  263     *.c3-b.c
  264     *.c-a.b-c
  265     *** Failers
  266     *.0
  267     *.a-
  268     *.a-b.c-
  269     *.c-a.0-c
  270 
  271 /^(?=ab(de))(abd)(e)/
  272     abde
  273 
  274 /^(?!(ab)de|x)(abd)(f)/
  275     abdf
  276 
  277 /^(?=(ab(cd)))(ab)/
  278     abcd
  279 
  280 /^[\da-f](\.[\da-f])*$/i
  281     a.b.c.d
  282     A.B.C.D
  283     a.b.c.1.2.3.C
  284 
  285 /^\".*\"\s*(;.*)?$/
  286     \"1234\"
  287     \"abcd\" ;
  288     \"\" ; rhubarb
  289     *** Failers
  290     \"1234\" : things
  291 
  292 /^$/
  293     \
  294     *** Failers
  295 
  296 /   ^    a   (?# begins with a)  b\sc (?# then b c) $ (?# then end)/x
  297     ab c
  298     *** Failers
  299     abc
  300     ab cde
  301 
  302 /(?x)   ^    a   (?# begins with a)  b\sc (?# then b c) $ (?# then end)/
  303     ab c
  304     *** Failers
  305     abc
  306     ab cde
  307 
  308 /^   a\ b[c ]d       $/x
  309     a bcd
  310     a b d
  311     *** Failers
  312     abcd
  313     ab d
  314 
  315 /^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/
  316     abcdefhijklm
  317 
  318 /^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/
  319     abcdefhijklm
  320 
  321 /^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/
  322     a+ Z0+\x08\n\x1d\x12
  323 
  324 /^[.^$|()*+?{,}]+/
  325     .^\$(*+)|{?,?}
  326 
  327 /^a*\w/
  328     z
  329     az
  330     aaaz
  331     a
  332     aa
  333     aaaa
  334     a+
  335     aa+
  336 
  337 /^a*?\w/
  338     z
  339     az
  340     aaaz
  341     a
  342     aa
  343     aaaa
  344     a+
  345     aa+
  346 
  347 /^a+\w/
  348     az
  349     aaaz
  350     aa
  351     aaaa
  352     aa+
  353 
  354 /^a+?\w/
  355     az
  356     aaaz
  357     aa
  358     aaaa
  359     aa+
  360 
  361 /^\d{8}\w{2,}/
  362     1234567890
  363     12345678ab
  364     12345678__
  365     *** Failers
  366     1234567
  367 
  368 /^[aeiou\d]{4,5}$/
  369     uoie
  370     1234
  371     12345
  372     aaaaa
  373     *** Failers
  374     123456
  375 
  376 /^[aeiou\d]{4,5}?/
  377     uoie
  378     1234
  379     12345
  380     aaaaa
  381     123456
  382 
  383 /\A(abc|def)=(\1){2,3}\Z/
  384     abc=abcabc
  385     def=defdefdef
  386     *** Failers
  387     abc=defdef
  388 
  389 /^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\11*(\3\4)\1(?#)2$/
  390     abcdefghijkcda2
  391     abcdefghijkkkkcda2
  392 
  393 /(cat(a(ract|tonic)|erpillar)) \1()2(3)/
  394     cataract cataract23
  395     catatonic catatonic23
  396     caterpillar caterpillar23
  397 
  398 
  399 /^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]/
  400     From abcd  Mon Sep 01 12:33:02 1997
  401 
  402 /^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/
  403     From abcd  Mon Sep 01 12:33:02 1997
  404     From abcd  Mon Sep  1 12:33:02 1997
  405     *** Failers
  406     From abcd  Sep 01 12:33:02 1997
  407 
  408 /^12.34/s
  409     12\n34
  410     12\r34
  411 
  412 /\w+(?=\t)/
  413     the quick brown\t fox
  414 
  415 /foo(?!bar)(.*)/
  416     foobar is foolish see?
  417 
  418 /(?:(?!foo)...|^.{0,2})bar(.*)/
  419     foobar crowbar etc
  420     barrel
  421     2barrel
  422     A barrel
  423 
  424 /^(\D*)(?=\d)(?!123)/
  425     abc456
  426     *** Failers
  427     abc123
  428 
  429 /^1234(?# test newlines
  430   inside)/
  431     1234
  432 
  433 /^1234 #comment in extended re
  434   /x
  435     1234
  436 
  437 /#rhubarb
  438   abcd/x
  439     abcd
  440 
  441 /^abcd#rhubarb/x
  442     abcd
  443 
  444 /^(a)\1{2,3}(.)/
  445     aaab
  446     aaaab
  447     aaaaab
  448     aaaaaab
  449 
  450 /(?!^)abc/
  451     the abc
  452     *** Failers
  453     abc
  454 
  455 /(?=^)abc/
  456     abc
  457     *** Failers
  458     the abc
  459 
  460 /^[ab]{1,3}(ab*|b)/
  461     aabbbbb
  462 
  463 /^[ab]{1,3}?(ab*|b)/
  464     aabbbbb
  465 
  466 /^[ab]{1,3}?(ab*?|b)/
  467     aabbbbb
  468 
  469 /^[ab]{1,3}(ab*?|b)/
  470     aabbbbb
  471 
  472 /  (?: [\040\t] |  \(
  473 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  474 \)  )*                          # optional leading comment
  475 (?:    (?:
  476 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
  477 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  478 |
  479 " (?:                      # opening quote...
  480 [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
  481 |                     #    or
  482 \\ [^\x80-\xff]           #   Escaped something (something != CR)
  483 )* "  # closing quote
  484 )                    # initial word
  485 (?:  (?: [\040\t] |  \(
  486 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  487 \)  )*  \.  (?: [\040\t] |  \(
  488 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  489 \)  )*   (?:
  490 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
  491 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  492 |
  493 " (?:                      # opening quote...
  494 [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
  495 |                     #    or
  496 \\ [^\x80-\xff]           #   Escaped something (something != CR)
  497 )* "  # closing quote
  498 )  )* # further okay, if led by a period
  499 (?: [\040\t] |  \(
  500 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  501 \)  )*  @  (?: [\040\t] |  \(
  502 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  503 \)  )*    (?:
  504 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
  505 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  506 |   \[                         # [
  507 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
  508 \]                        #           ]
  509 )                           # initial subdomain
  510 (?:                                  #
  511 (?: [\040\t] |  \(
  512 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  513 \)  )*  \.                        # if led by a period...
  514 (?: [\040\t] |  \(
  515 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  516 \)  )*   (?:
  517 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
  518 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  519 |   \[                         # [
  520 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
  521 \]                        #           ]
  522 )                     #   ...further okay
  523 )*
  524 # address
  525 |                     #  or
  526 (?:
  527 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
  528 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  529 |
  530 " (?:                      # opening quote...
  531 [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
  532 |                     #    or
  533 \\ [^\x80-\xff]           #   Escaped something (something != CR)
  534 )* "  # closing quote
  535 )             # one word, optionally followed by....
  536 (?:
  537 [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037]  |  # atom and space parts, or...
  538 \(
  539 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  540 \)       |  # comments, or...
  541 
  542 " (?:                      # opening quote...
  543 [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
  544 |                     #    or
  545 \\ [^\x80-\xff]           #   Escaped something (something != CR)
  546 )* "  # closing quote
  547 # quoted strings
  548 )*
  549 <  (?: [\040\t] |  \(
  550 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  551 \)  )*                     # leading <
  552 (?:  @  (?: [\040\t] |  \(
  553 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  554 \)  )*    (?:
  555 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
  556 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  557 |   \[                         # [
  558 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
  559 \]                        #           ]
  560 )                           # initial subdomain
  561 (?:                                  #
  562 (?: [\040\t] |  \(
  563 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  564 \)  )*  \.                        # if led by a period...
  565 (?: [\040\t] |  \(
  566 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  567 \)  )*   (?:
  568 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
  569 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  570 |   \[                         # [
  571 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
  572 \]                        #           ]
  573 )                     #   ...further okay
  574 )*
  575 
  576 (?:  (?: [\040\t] |  \(
  577 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  578 \)  )*  ,  (?: [\040\t] |  \(
  579 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  580 \)  )*  @  (?: [\040\t] |  \(
  581 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  582 \)  )*    (?:
  583 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
  584 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  585 |   \[                         # [
  586 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
  587 \]                        #           ]
  588 )                           # initial subdomain
  589 (?:                                  #
  590 (?: [\040\t] |  \(
  591 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  592 \)  )*  \.                        # if led by a period...
  593 (?: [\040\t] |  \(
  594 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  595 \)  )*   (?:
  596 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
  597 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  598 |   \[                         # [
  599 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
  600 \]                        #           ]
  601 )                     #   ...further okay
  602 )*
  603 )* # further okay, if led by comma
  604 :                                # closing colon
  605 (?: [\040\t] |  \(
  606 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  607 \)  )*  )? #       optional route
  608 (?:
  609 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
  610 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  611 |
  612 " (?:                      # opening quote...
  613 [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
  614 |                     #    or
  615 \\ [^\x80-\xff]           #   Escaped something (something != CR)
  616 )* "  # closing quote
  617 )                    # initial word
  618 (?:  (?: [\040\t] |  \(
  619 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  620 \)  )*  \.  (?: [\040\t] |  \(
  621 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  622 \)  )*   (?:
  623 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
  624 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  625 |
  626 " (?:                      # opening quote...
  627 [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
  628 |                     #    or
  629 \\ [^\x80-\xff]           #   Escaped something (something != CR)
  630 )* "  # closing quote
  631 )  )* # further okay, if led by a period
  632 (?: [\040\t] |  \(
  633 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  634 \)  )*  @  (?: [\040\t] |  \(
  635 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  636 \)  )*    (?:
  637 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
  638 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  639 |   \[                         # [
  640 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
  641 \]                        #           ]
  642 )                           # initial subdomain
  643 (?:                                  #
  644 (?: [\040\t] |  \(
  645 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  646 \)  )*  \.                        # if led by a period...
  647 (?: [\040\t] |  \(
  648 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  649 \)  )*   (?:
  650 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
  651 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  652 |   \[                         # [
  653 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
  654 \]                        #           ]
  655 )                     #   ...further okay
  656 )*
  657 #       address spec
  658 (?: [\040\t] |  \(
  659 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  660 \)  )*  > #                  trailing >
  661 # name and address
  662 )  (?: [\040\t] |  \(
  663 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
  664 \)  )*                       # optional trailing comment
  665 /x
  666     Alan Other <user\@dom.ain>
  667     <user\@dom.ain>
  668     user\@dom.ain
  669     \"A. Other\" <user.1234\@dom.ain> (a comment)
  670     A. Other <user.1234\@dom.ain> (a comment)
  671     \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay
  672     A missing angle <user\@some.where
  673     *** Failers
  674     The quick brown fox
  675 
  676 /[\040\t]*                    # Nab whitespace.
  677 (?:
  678 \(                              #  (
  679 [^\\\x80-\xff\n\015()] *                             #     normal*
  680 (?:                                 #       (
  681 (?:  \\ [^\x80-\xff]  |
  682 \(                            #  (
  683 [^\\\x80-\xff\n\015()] *                            #     normal*
  684 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
  685 \)                           #                       )
  686 )    #         special
  687 [^\\\x80-\xff\n\015()] *                         #         normal*
  688 )*                                  #            )*
  689 \)                             #                )
  690 [\040\t]* )*    # If comment found, allow more spaces.
  691 # optional leading comment
  692 (?:
  693 (?:
  694 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
  695 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  696 # Atom
  697 |                       #  or
  698 "                                     # "
  699 [^\\\x80-\xff\n\015"] *                            #   normal
  700 (?:  \\ [^\x80-\xff]  [^\\\x80-\xff\n\015"] * )*        #   ( special normal* )*
  701 "                                     #        "
  702 # Quoted string
  703 )
  704 [\040\t]*                    # Nab whitespace.
  705 (?:
  706 \(                              #  (
  707 [^\\\x80-\xff\n\015()] *                             #     normal*
  708 (?:                                 #       (
  709 (?:  \\ [^\x80-\xff]  |
  710 \(                            #  (
  711 [^\\\x80-\xff\n\015()] *                            #     normal*
  712 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
  713 \)                           #                       )
  714 )    #         special
  715 [^\\\x80-\xff\n\015()] *                         #         normal*
  716 )*                                  #            )*
  717 \)                             #                )
  718 [\040\t]* )*    # If comment found, allow more spaces.
  719 (?:
  720 \.
  721 [\040\t]*                    # Nab whitespace.
  722 (?:
  723 \(                              #  (
  724 [^\\\x80-\xff\n\015()] *                             #     normal*
  725 (?:                                 #       (
  726 (?:  \\ [^\x80-\xff]  |
  727 \(                            #  (
  728 [^\\\x80-\xff\n\015()] *                            #     normal*
  729 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
  730 \)                           #                       )
  731 )    #         special
  732 [^\\\x80-\xff\n\015()] *                         #         normal*
  733 )*                                  #            )*
  734 \)                             #                )
  735 [\040\t]* )*    # If comment found, allow more spaces.
  736 (?:
  737 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
  738 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  739 # Atom
  740 |                       #  or
  741 "                                     # "
  742 [^\\\x80-\xff\n\015"] *                            #   normal
  743 (?:  \\ [^\x80-\xff]  [^\\\x80-\xff\n\015"] * )*        #   ( special normal* )*
  744 "                                     #        "
  745 # Quoted string
  746 )
  747 [\040\t]*                    # Nab whitespace.
  748 (?:
  749 \(                              #  (
  750 [^\\\x80-\xff\n\015()] *                             #     normal*
  751 (?:                                 #       (
  752 (?:  \\ [^\x80-\xff]  |
  753 \(                            #  (
  754 [^\\\x80-\xff\n\015()] *                            #     normal*
  755 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
  756 \)                           #                       )
  757 )    #         special
  758 [^\\\x80-\xff\n\015()] *                         #         normal*
  759 )*                                  #            )*
  760 \)                             #                )
  761 [\040\t]* )*    # If comment found, allow more spaces.
  762 # additional words
  763 )*
  764 @
  765 [\040\t]*                    # Nab whitespace.
  766 (?:
  767 \(                              #  (
  768 [^\\\x80-\xff\n\015()] *                             #     normal*
  769 (?:                                 #       (
  770 (?:  \\ [^\x80-\xff]  |
  771 \(                            #  (
  772 [^\\\x80-\xff\n\015()] *                            #     normal*
  773 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
  774 \)                           #                       )
  775 )    #         special
  776 [^\\\x80-\xff\n\015()] *                         #         normal*
  777 )*                                  #            )*
  778 \)                             #                )
  779 [\040\t]* )*    # If comment found, allow more spaces.
  780 (?:
  781 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
  782 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  783 |
  784 \[                            # [
  785 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*     #    stuff
  786 \]                           #           ]
  787 )
  788 [\040\t]*                    # Nab whitespace.
  789 (?:
  790 \(                              #  (
  791 [^\\\x80-\xff\n\015()] *                             #     normal*
  792 (?:                                 #       (
  793 (?:  \\ [^\x80-\xff]  |
  794 \(                            #  (
  795 [^\\\x80-\xff\n\015()] *                            #     normal*
  796 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
  797 \)                           #                       )
  798 )    #         special
  799 [^\\\x80-\xff\n\015()] *                         #         normal*
  800 )*                                  #            )*
  801 \)                             #                )
  802 [\040\t]* )*    # If comment found, allow more spaces.
  803 # optional trailing comments
  804 (?:
  805 \.
  806 [\040\t]*                    # Nab whitespace.
  807 (?:
  808 \(                              #  (
  809 [^\\\x80-\xff\n\015()] *                             #     normal*
  810 (?:                                 #       (
  811 (?:  \\ [^\x80-\xff]  |
  812 \(                            #  (
  813 [^\\\x80-\xff\n\015()] *                            #     normal*
  814 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
  815 \)                           #                       )
  816 )    #         special
  817 [^\\\x80-\xff\n\015()] *                         #         normal*
  818 )*                                  #            )*
  819 \)                             #                )
  820 [\040\t]* )*    # If comment found, allow more spaces.
  821 (?:
  822 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
  823 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  824 |
  825 \[                            # [
  826 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*     #    stuff
  827 \]                           #           ]
  828 )
  829 [\040\t]*                    # Nab whitespace.
  830 (?:
  831 \(                              #  (
  832 [^\\\x80-\xff\n\015()] *                             #     normal*
  833 (?:                                 #       (
  834 (?:  \\ [^\x80-\xff]  |
  835 \(                            #  (
  836 [^\\\x80-\xff\n\015()] *                            #     normal*
  837 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
  838 \)                           #                       )
  839 )    #         special
  840 [^\\\x80-\xff\n\015()] *                         #         normal*
  841 )*                                  #            )*
  842 \)                             #                )
  843 [\040\t]* )*    # If comment found, allow more spaces.
  844 # optional trailing comments
  845 )*
  846 # address
  847 |                             #  or
  848 (?:
  849 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
  850 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  851 # Atom
  852 |                       #  or
  853 "                                     # "
  854 [^\\\x80-\xff\n\015"] *                            #   normal
  855 (?:  \\ [^\x80-\xff]  [^\\\x80-\xff\n\015"] * )*        #   ( special normal* )*
  856 "                                     #        "
  857 # Quoted string
  858 )
  859 # leading word
  860 [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] *               # "normal" atoms and or spaces
  861 (?:
  862 (?:
  863 \(                              #  (
  864 [^\\\x80-\xff\n\015()] *                             #     normal*
  865 (?:                                 #       (
  866 (?:  \\ [^\x80-\xff]  |
  867 \(                            #  (
  868 [^\\\x80-\xff\n\015()] *                            #     normal*
  869 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
  870 \)                           #                       )
  871 )    #         special
  872 [^\\\x80-\xff\n\015()] *                         #         normal*
  873 )*                                  #            )*
  874 \)                             #                )
  875 |
  876 "                                     # "
  877 [^\\\x80-\xff\n\015"] *                            #   normal
  878 (?:  \\ [^\x80-\xff]  [^\\\x80-\xff\n\015"] * )*        #   ( special normal* )*
  879 "                                     #        "
  880 ) # "special" comment or quoted string
  881 [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] *            #  more "normal"
  882 )*
  883 <
  884 [\040\t]*                    # Nab whitespace.
  885 (?:
  886 \(                              #  (
  887 [^\\\x80-\xff\n\015()] *                             #     normal*
  888 (?:                                 #       (
  889 (?:  \\ [^\x80-\xff]  |
  890 \(                            #  (
  891 [^\\\x80-\xff\n\015()] *                            #     normal*
  892 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
  893 \)                           #                       )
  894 )    #         special
  895 [^\\\x80-\xff\n\015()] *                         #         normal*
  896 )*                                  #            )*
  897 \)                             #                )
  898 [\040\t]* )*    # If comment found, allow more spaces.
  899 # <
  900 (?:
  901 @
  902 [\040\t]*                    # Nab whitespace.
  903 (?:
  904 \(                              #  (
  905 [^\\\x80-\xff\n\015()] *                             #     normal*
  906 (?:                                 #       (
  907 (?:  \\ [^\x80-\xff]  |
  908 \(                            #  (
  909 [^\\\x80-\xff\n\015()] *                            #     normal*
  910 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
  911 \)                           #                       )
  912 )    #         special
  913 [^\\\x80-\xff\n\015()] *                         #         normal*
  914 )*                                  #            )*
  915 \)                             #                )
  916 [\040\t]* )*    # If comment found, allow more spaces.
  917 (?:
  918 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
  919 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  920 |
  921 \[                            # [
  922 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*     #    stuff
  923 \]                           #           ]
  924 )
  925 [\040\t]*                    # Nab whitespace.
  926 (?:
  927 \(                              #  (
  928 [^\\\x80-\xff\n\015()] *                             #     normal*
  929 (?:                                 #       (
  930 (?:  \\ [^\x80-\xff]  |
  931 \(                            #  (
  932 [^\\\x80-\xff\n\015()] *                            #     normal*
  933 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
  934 \)                           #                       )
  935 )    #         special
  936 [^\\\x80-\xff\n\015()] *                         #         normal*
  937 )*                                  #            )*
  938 \)                             #                )
  939 [\040\t]* )*    # If comment found, allow more spaces.
  940 # optional trailing comments
  941 (?:
  942 \.
  943 [\040\t]*                    # Nab whitespace.
  944 (?:
  945 \(                              #  (
  946 [^\\\x80-\xff\n\015()] *                             #     normal*
  947 (?:                                 #       (
  948 (?:  \\ [^\x80-\xff]  |
  949 \(                            #  (
  950 [^\\\x80-\xff\n\015()] *                            #     normal*
  951 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
  952 \)                           #                       )
  953 )    #         special
  954 [^\\\x80-\xff\n\015()] *                         #         normal*
  955 )*                                  #            )*
  956 \)                             #                )
  957 [\040\t]* )*    # If comment found, allow more spaces.
  958 (?:
  959 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
  960 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
  961 |
  962 \[                            # [
  963 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*     #    stuff
  964 \]                           #           ]
  965 )
  966 [\040\t]*                    # Nab whitespace.
  967 (?:
  968 \(                              #  (
  969 [^\\\x80-\xff\n\015()] *                             #     normal*
  970 (?:                                 #       (
  971 (?:  \\ [^\x80-\xff]  |
  972 \(                            #  (
  973 [^\\\x80-\xff\n\015()] *                            #     normal*
  974 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
  975 \)                           #                       )
  976 )    #         special
  977 [^\\\x80-\xff\n\015()] *                         #         normal*
  978 )*                                  #            )*
  979 \)                             #                )
  980 [\040\t]* )*    # If comment found, allow more spaces.
  981 # optional trailing comments
  982 )*
  983 (?: ,
  984 [\040\t]*                    # Nab whitespace.
  985 (?:
  986 \(                              #  (
  987 [^\\\x80-\xff\n\015()] *                             #     normal*
  988 (?:                                 #       (
  989 (?:  \\ [^\x80-\xff]  |
  990 \(                            #  (
  991 [^\\\x80-\xff\n\015()] *                            #     normal*
  992 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
  993 \)                           #                       )
  994 )    #         special
  995 [^\\\x80-\xff\n\015()] *                         #         normal*
  996 )*                                  #            )*
  997 \)                             #                )
  998 [\040\t]* )*    # If comment found, allow more spaces.
  999 @
 1000 [\040\t]*                    # Nab whitespace.
 1001 (?:
 1002 \(                              #  (
 1003 [^\\\x80-\xff\n\015()] *                             #     normal*
 1004 (?:                                 #       (
 1005 (?:  \\ [^\x80-\xff]  |
 1006 \(                            #  (
 1007 [^\\\x80-\xff\n\015()] *                            #     normal*
 1008 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
 1009 \)                           #                       )
 1010 )    #         special
 1011 [^\\\x80-\xff\n\015()] *                         #         normal*
 1012 )*                                  #            )*
 1013 \)                             #                )
 1014 [\040\t]* )*    # If comment found, allow more spaces.
 1015 (?:
 1016 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
 1017 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
 1018 |
 1019 \[                            # [
 1020 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*     #    stuff
 1021 \]                           #           ]
 1022 )
 1023 [\040\t]*                    # Nab whitespace.
 1024 (?:
 1025 \(                              #  (
 1026 [^\\\x80-\xff\n\015()] *                             #     normal*
 1027 (?:                                 #       (
 1028 (?:  \\ [^\x80-\xff]  |
 1029 \(                            #  (
 1030 [^\\\x80-\xff\n\015()] *                            #     normal*
 1031 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
 1032 \)                           #                       )
 1033 )    #         special
 1034 [^\\\x80-\xff\n\015()] *                         #         normal*
 1035 )*                                  #            )*
 1036 \)                             #                )
 1037 [\040\t]* )*    # If comment found, allow more spaces.
 1038 # optional trailing comments
 1039 (?:
 1040 \.
 1041 [\040\t]*                    # Nab whitespace.
 1042 (?:
 1043 \(                              #  (
 1044 [^\\\x80-\xff\n\015()] *                             #     normal*
 1045 (?:                                 #       (
 1046 (?:  \\ [^\x80-\xff]  |
 1047 \(                            #  (
 1048 [^\\\x80-\xff\n\015()] *                            #     normal*
 1049 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
 1050 \)                           #                       )
 1051 )    #         special
 1052 [^\\\x80-\xff\n\015()] *                         #         normal*
 1053 )*                                  #            )*
 1054 \)                             #                )
 1055 [\040\t]* )*    # If comment found, allow more spaces.
 1056 (?:
 1057 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
 1058 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
 1059 |
 1060 \[                            # [
 1061 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*     #    stuff
 1062 \]                           #           ]
 1063 )
 1064 [\040\t]*                    # Nab whitespace.
 1065 (?:
 1066 \(                              #  (
 1067 [^\\\x80-\xff\n\015()] *                             #     normal*
 1068 (?:                                 #       (
 1069 (?:  \\ [^\x80-\xff]  |
 1070 \(                            #  (
 1071 [^\\\x80-\xff\n\015()] *                            #     normal*
 1072 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
 1073 \)                           #                       )
 1074 )    #         special
 1075 [^\\\x80-\xff\n\015()] *                         #         normal*
 1076 )*                                  #            )*
 1077 \)                             #                )
 1078 [\040\t]* )*    # If comment found, allow more spaces.
 1079 # optional trailing comments
 1080 )*
 1081 )*  # additional domains
 1082 :
 1083 [\040\t]*                    # Nab whitespace.
 1084 (?:
 1085 \(                              #  (
 1086 [^\\\x80-\xff\n\015()] *                             #     normal*
 1087 (?:                                 #       (
 1088 (?:  \\ [^\x80-\xff]  |
 1089 \(                            #  (
 1090 [^\\\x80-\xff\n\015()] *                            #     normal*
 1091 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
 1092 \)                           #                       )
 1093 )    #         special
 1094 [^\\\x80-\xff\n\015()] *                         #         normal*
 1095 )*                                  #            )*
 1096 \)                             #                )
 1097 [\040\t]* )*    # If comment found, allow more spaces.
 1098 # optional trailing comments
 1099 )?     #       optional route
 1100 (?:
 1101 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
 1102 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
 1103 # Atom
 1104 |                       #  or
 1105 "                                     # "
 1106 [^\\\x80-\xff\n\015"] *                            #   normal
 1107 (?:  \\ [^\x80-\xff]  [^\\\x80-\xff\n\015"] * )*        #   ( special normal* )*
 1108 "                                     #        "
 1109 # Quoted string
 1110 )
 1111 [\040\t]*                    # Nab whitespace.
 1112 (?:
 1113 \(                              #  (
 1114 [^\\\x80-\xff\n\015()] *                             #     normal*
 1115 (?:                                 #       (
 1116 (?:  \\ [^\x80-\xff]  |
 1117 \(                            #  (
 1118 [^\\\x80-\xff\n\015()] *                            #     normal*
 1119 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
 1120 \)                           #                       )
 1121 )    #         special
 1122 [^\\\x80-\xff\n\015()] *                         #         normal*
 1123 )*                                  #            )*
 1124 \)                             #                )
 1125 [\040\t]* )*    # If comment found, allow more spaces.
 1126 (?:
 1127 \.
 1128 [\040\t]*                    # Nab whitespace.
 1129 (?:
 1130 \(                              #  (
 1131 [^\\\x80-\xff\n\015()] *                             #     normal*
 1132 (?:                                 #       (
 1133 (?:  \\ [^\x80-\xff]  |
 1134 \(                            #  (
 1135 [^\\\x80-\xff\n\015()] *                            #     normal*
 1136 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
 1137 \)                           #                       )
 1138 )    #         special
 1139 [^\\\x80-\xff\n\015()] *                         #         normal*
 1140 )*                                  #            )*
 1141 \)                             #                )
 1142 [\040\t]* )*    # If comment found, allow more spaces.
 1143 (?:
 1144 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
 1145 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
 1146 # Atom
 1147 |                       #  or
 1148 "                                     # "
 1149 [^\\\x80-\xff\n\015"] *                            #   normal
 1150 (?:  \\ [^\x80-\xff]  [^\\\x80-\xff\n\015"] * )*        #   ( special normal* )*
 1151 "                                     #        "
 1152 # Quoted string
 1153 )
 1154 [\040\t]*                    # Nab whitespace.
 1155 (?:
 1156 \(                              #  (
 1157 [^\\\x80-\xff\n\015()] *                             #     normal*
 1158 (?:                                 #       (
 1159 (?:  \\ [^\x80-\xff]  |
 1160 \(                            #  (
 1161 [^\\\x80-\xff\n\015()] *                            #     normal*
 1162 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
 1163 \)                           #                       )
 1164 )    #         special
 1165 [^\\\x80-\xff\n\015()] *                         #         normal*
 1166 )*                                  #            )*
 1167 \)                             #                )
 1168 [\040\t]* )*    # If comment found, allow more spaces.
 1169 # additional words
 1170 )*
 1171 @
 1172 [\040\t]*                    # Nab whitespace.
 1173 (?:
 1174 \(                              #  (
 1175 [^\\\x80-\xff\n\015()] *                             #     normal*
 1176 (?:                                 #       (
 1177 (?:  \\ [^\x80-\xff]  |
 1178 \(                            #  (
 1179 [^\\\x80-\xff\n\015()] *                            #     normal*
 1180 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
 1181 \)                           #                       )
 1182 )    #         special
 1183 [^\\\x80-\xff\n\015()] *                         #         normal*
 1184 )*                                  #            )*
 1185 \)                             #                )
 1186 [\040\t]* )*    # If comment found, allow more spaces.
 1187 (?:
 1188 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
 1189 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
 1190 |
 1191 \[                            # [
 1192 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*     #    stuff
 1193 \]                           #           ]
 1194 )
 1195 [\040\t]*                    # Nab whitespace.
 1196 (?:
 1197 \(                              #  (
 1198 [^\\\x80-\xff\n\015()] *                             #     normal*
 1199 (?:                                 #       (
 1200 (?:  \\ [^\x80-\xff]  |
 1201 \(                            #  (
 1202 [^\\\x80-\xff\n\015()] *                            #     normal*
 1203 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
 1204 \)                           #                       )
 1205 )    #         special
 1206 [^\\\x80-\xff\n\015()] *                         #         normal*
 1207 )*                                  #            )*
 1208 \)                             #                )
 1209 [\040\t]* )*    # If comment found, allow more spaces.
 1210 # optional trailing comments
 1211 (?:
 1212 \.
 1213 [\040\t]*                    # Nab whitespace.
 1214 (?:
 1215 \(                              #  (
 1216 [^\\\x80-\xff\n\015()] *                             #     normal*
 1217 (?:                                 #       (
 1218 (?:  \\ [^\x80-\xff]  |
 1219 \(                            #  (
 1220 [^\\\x80-\xff\n\015()] *                            #     normal*
 1221 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
 1222 \)                           #                       )
 1223 )    #         special
 1224 [^\\\x80-\xff\n\015()] *                         #         normal*
 1225 )*                                  #            )*
 1226 \)                             #                )
 1227 [\040\t]* )*    # If comment found, allow more spaces.
 1228 (?:
 1229 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
 1230 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
 1231 |
 1232 \[                            # [
 1233 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*     #    stuff
 1234 \]                           #           ]
 1235 )
 1236 [\040\t]*                    # Nab whitespace.
 1237 (?:
 1238 \(                              #  (
 1239 [^\\\x80-\xff\n\015()] *                             #     normal*
 1240 (?:                                 #       (
 1241 (?:  \\ [^\x80-\xff]  |
 1242 \(                            #  (
 1243 [^\\\x80-\xff\n\015()] *                            #     normal*
 1244 (?:  \\ [^\x80-\xff]   [^\\\x80-\xff\n\015()] * )*        #     (special normal*)*
 1245 \)                           #                       )
 1246 )    #         special
 1247 [^\\\x80-\xff\n\015()] *                         #         normal*
 1248 )*                                  #            )*
 1249 \)                             #                )
 1250 [\040\t]* )*    # If comment found, allow more spaces.
 1251 # optional trailing comments
 1252 )*
 1253 #       address spec
 1254 >                    #                 >
 1255 # name and address
 1256 )
 1257 /x
 1258     Alan Other <user\@dom.ain>
 1259     <user\@dom.ain>
 1260     user\@dom.ain
 1261     \"A. Other\" <user.1234\@dom.ain> (a comment)
 1262     A. Other <user.1234\@dom.ain> (a comment)
 1263     \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay
 1264     A missing angle <user\@some.where
 1265     *** Failers
 1266     The quick brown fox
 1267 
 1268 /abc\0def\00pqr\000xyz\0000AB/
 1269     abc\0def\00pqr\000xyz\0000AB
 1270     abc456 abc\0def\00pqr\000xyz\0000ABCDE
 1271 
 1272 /abc\x0def\x00pqr\x000xyz\x0000AB/
 1273     abc\x0def\x00pqr\x000xyz\x0000AB
 1274     abc456 abc\x0def\x00pqr\x000xyz\x0000ABCDE
 1275 
 1276 /^[\000-\037]/
 1277     \0A
 1278     \01B
 1279     \037C
 1280 
 1281 /\0*/
 1282     \0\0\0\0
 1283 
 1284 /A\x0{2,3}Z/
 1285     The A\x0\x0Z
 1286     An A\0\x0\0Z
 1287     *** Failers
 1288     A\0Z
 1289     A\0\x0\0\x0Z
 1290 
 1291 /^(cow|)\1(bell)/
 1292     cowcowbell
 1293     bell
 1294     *** Failers
 1295     cowbell
 1296 
 1297 /^\s/
 1298     \040abc
 1299     \x0cabc
 1300     \nabc
 1301     \rabc
 1302     \tabc
 1303     *** Failers
 1304     abc
 1305 
 1306 /^a	b
 1307       c/x
 1308     abc
 1309 
 1310 /^(a|)\1*b/
 1311     ab
 1312     aaaab
 1313     b
 1314     *** Failers
 1315     acb
 1316 
 1317 /^(a|)\1+b/
 1318     aab
 1319     aaaab
 1320     b
 1321     *** Failers
 1322     ab
 1323 
 1324 /^(a|)\1?b/
 1325     ab
 1326     aab
 1327     b
 1328     *** Failers
 1329     acb
 1330 
 1331 /^(a|)\1{2}b/
 1332     aaab
 1333     b
 1334     *** Failers
 1335     ab
 1336     aab
 1337     aaaab
 1338 
 1339 /^(a|)\1{2,3}b/
 1340     aaab
 1341     aaaab
 1342     b
 1343     *** Failers
 1344     ab
 1345     aab
 1346     aaaaab
 1347 
 1348 /ab{1,3}bc/
 1349     abbbbc
 1350     abbbc
 1351     abbc
 1352     *** Failers
 1353     abc
 1354     abbbbbc
 1355 
 1356 /([^.]*)\.([^:]*):[T ]+(.*)/
 1357     track1.title:TBlah blah blah
 1358 
 1359 /([^.]*)\.([^:]*):[T ]+(.*)/i
 1360     track1.title:TBlah blah blah
 1361 
 1362 /([^.]*)\.([^:]*):[t ]+(.*)/i
 1363     track1.title:TBlah blah blah
 1364 
 1365 /^[W-c]+$/
 1366     WXY_^abc
 1367     *** Failers
 1368     wxy
 1369 
 1370 /^[W-c]+$/i
 1371     WXY_^abc
 1372     wxy_^ABC
 1373 
 1374 /^[\x3f-\x5F]+$/i
 1375     WXY_^abc
 1376     wxy_^ABC
 1377 
 1378 /^abc$/m
 1379     abc
 1380     qqq\nabc
 1381     abc\nzzz
 1382     qqq\nabc\nzzz
 1383 
 1384 /^abc$/
 1385     abc
 1386     *** Failers
 1387     qqq\nabc
 1388     abc\nzzz
 1389     qqq\nabc\nzzz
 1390 
 1391 /\Aabc\Z/m
 1392     abc
 1393     abc\n 
 1394     *** Failers
 1395     qqq\nabc
 1396     abc\nzzz
 1397     qqq\nabc\nzzz
 1398     
 1399 /\A(.)*\Z/s
 1400     abc\ndef
 1401 
 1402 /\A(.)*\Z/m
 1403     *** Failers
 1404     abc\ndef
 1405 
 1406 /(?:b)|(?::+)/
 1407     b::c
 1408     c::b
 1409 
 1410 /[-az]+/
 1411     az-
 1412     *** Failers
 1413     b
 1414 
 1415 /[az-]+/
 1416     za-
 1417     *** Failers
 1418     b
 1419 
 1420 /[a\-z]+/
 1421     a-z
 1422     *** Failers
 1423     b
 1424 
 1425 /[a-z]+/
 1426     abcdxyz
 1427 
 1428 /[\d-]+/
 1429     12-34
 1430     *** Failers
 1431     aaa
 1432 
 1433 /[\d-z]+/
 1434     12-34z
 1435     *** Failers
 1436     aaa
 1437 
 1438 /\x5c/
 1439     \\
 1440 
 1441 /\x20Z/
 1442     the Zoo
 1443     *** Failers
 1444     Zulu
 1445 
 1446 /(abc)\1/i
 1447     abcabc
 1448     ABCabc
 1449     abcABC
 1450 
 1451 /ab{3cd/
 1452     ab{3cd
 1453 
 1454 /ab{3,cd/
 1455     ab{3,cd
 1456 
 1457 /ab{3,4a}cd/
 1458     ab{3,4a}cd
 1459 
 1460 /{4,5a}bc/
 1461     {4,5a}bc
 1462 
 1463 /abc$/
 1464     abc
 1465     abc\n
 1466     *** Failers
 1467     abc\ndef
 1468 
 1469 /(abc)\123/
 1470     abc\x53
 1471 
 1472 /(abc)\223/
 1473     abc\x93
 1474 
 1475 /(abc)\323/
 1476     abc\xd3
 1477 
 1478 /(abc)\100/
 1479     abc\x40
 1480     abc\100
 1481 
 1482 /(abc)\1000/
 1483     abc\x400
 1484     abc\x40\x30
 1485     abc\1000
 1486     abc\100\x30
 1487     abc\100\060
 1488     abc\100\60
 1489     
 1490 /^(A)(B)(C)(D)(E)(F)(G)(H)(I)\8\9$/
 1491     ABCDEFGHIHI 
 1492 
 1493 /^[A\8B\9C]+$/
 1494     A8B9C
 1495     *** Failers 
 1496     A8B9C\x00
 1497 
 1498 /(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)\12\123/
 1499     abcdefghijkllS
 1500 
 1501 /(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\123/
 1502     abcdefghijk\12S
 1503 
 1504 /a{0}bc/
 1505     bc
 1506 
 1507 /(a|(bc)){0,0}?xyz/
 1508     xyz
 1509 
 1510 /abc[\10]de/
 1511     abc\010de
 1512 
 1513 /abc[\1]de/
 1514     abc\1de
 1515 
 1516 /(abc)[\1]de/
 1517     abc\1de
 1518 
 1519 /(?s)a.b/
 1520     a\nb
 1521 
 1522 /^([^a])([^\b])([^c]*)([^d]{3,4})/
 1523     baNOTccccd
 1524     baNOTcccd
 1525     baNOTccd
 1526     bacccd
 1527     *** Failers
 1528     anything
 1529     b\bc   
 1530     baccd
 1531 
 1532 /[^a]/
 1533     Abc
 1534   
 1535 /[^a]/i
 1536     Abc 
 1537 
 1538 /[^a]+/
 1539     AAAaAbc
 1540   
 1541 /[^a]+/i
 1542     AAAaAbc 
 1543 
 1544 /[^a]+/
 1545     bbb\nccc
 1546    
 1547 /[^k]$/
 1548     abc
 1549     *** Failers
 1550     abk   
 1551    
 1552 /[^k]{2,3}$/
 1553     abc
 1554     kbc
 1555     kabc 
 1556     *** Failers
 1557     abk
 1558     akb
 1559     akk 
 1560 
 1561 /^\d{8,}\@.+[^k]$/
 1562     12345678\@a.b.c.d
 1563     123456789\@x.y.z
 1564     *** Failers
 1565     12345678\@x.y.uk
 1566     1234567\@a.b.c.d       
 1567 
 1568 /(a)\1{8,}/
 1569     aaaaaaaaa
 1570     aaaaaaaaaa
 1571     *** Failers
 1572     aaaaaaa   
 1573 
 1574 /[^a]/
 1575     aaaabcd
 1576     aaAabcd 
 1577 
 1578 /[^a]/i
 1579     aaaabcd
 1580     aaAabcd 
 1581 
 1582 /[^az]/
 1583     aaaabcd
 1584     aaAabcd 
 1585 
 1586 /[^az]/i
 1587     aaaabcd
 1588     aaAabcd 
 1589 
 1590 /\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/
 1591  \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
 1592 
 1593 /P[^*]TAIRE[^*]{1,6}?LL/
 1594     xxxxxxxxxxxPSTAIREISLLxxxxxxxxx
 1595 
 1596 /P[^*]TAIRE[^*]{1,}?LL/
 1597     xxxxxxxxxxxPSTAIREISLLxxxxxxxxx
 1598 
 1599 /(\.\d\d[1-9]?)\d+/
 1600     1.230003938
 1601     1.875000282   
 1602     1.235  
 1603                   
 1604 /(\.\d\d((?=0)|\d(?=\d)))/
 1605     1.230003938      
 1606     1.875000282
 1607     *** Failers 
 1608     1.235 
 1609     
 1610 /a(?)b/
 1611     ab 
 1612  
 1613 /\b(foo)\s+(\w+)/i
 1614     Food is on the foo table
 1615     
 1616 /foo(.*)bar/
 1617     The food is under the bar in the barn.
 1618     
 1619 /foo(.*?)bar/
 1620     The food is under the bar in the barn.
 1621 
 1622 /(.*)(\d*)/
 1623     I have 2 numbers: 53147
 1624     
 1625 /(.*)(\d+)/
 1626     I have 2 numbers: 53147
 1627  
 1628 /(.*?)(\d*)/
 1629     I have 2 numbers: 53147
 1630 
 1631 /(.*?)(\d+)/
 1632     I have 2 numbers: 53147
 1633 
 1634 /(.*)(\d+)$/
 1635     I have 2 numbers: 53147
 1636 
 1637 /(.*?)(\d+)$/
 1638     I have 2 numbers: 53147
 1639 
 1640 /(.*)\b(\d+)$/
 1641     I have 2 numbers: 53147
 1642 
 1643 /(.*\D)(\d+)$/
 1644     I have 2 numbers: 53147
 1645 
 1646 /^\D*(?!123)/
 1647     ABC123
 1648      
 1649 /^(\D*)(?=\d)(?!123)/
 1650     ABC445
 1651     *** Failers
 1652     ABC123
 1653     
 1654 /^[W-]46]/
 1655     W46]789 
 1656     -46]789
 1657     *** Failers
 1658     Wall
 1659     Zebra
 1660     42
 1661     [abcd] 
 1662     ]abcd[
 1663        
 1664 /^[W-\]46]/
 1665     W46]789 
 1666     Wall
 1667     Zebra
 1668     Xylophone  
 1669     42
 1670     [abcd] 
 1671     ]abcd[
 1672     \\backslash 
 1673     *** Failers
 1674     -46]789
 1675     well
 1676     
 1677 /\d\d\/\d\d\/\d\d\d\d/
 1678     01/01/2000
 1679 
 1680 /word (?:[a-zA-Z0-9]+ ){0,10}otherword/
 1681   word cat dog elephant mussel cow horse canary baboon snake shark otherword
 1682   word cat dog elephant mussel cow horse canary baboon snake shark
 1683 
 1684 /word (?:[a-zA-Z0-9]+ ){0,300}otherword/
 1685   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
 1686 
 1687 /^(a){0,0}/
 1688     bcd
 1689     abc
 1690     aab     
 1691 
 1692 /^(a){0,1}/
 1693     bcd
 1694     abc
 1695     aab  
 1696 
 1697 /^(a){0,2}/
 1698     bcd
 1699     abc
 1700     aab  
 1701 
 1702 /^(a){0,3}/
 1703     bcd
 1704     abc
 1705     aab
 1706     aaa   
 1707 
 1708 /^(a){0,}/
 1709     bcd
 1710     abc
 1711     aab
 1712     aaa
 1713     aaaaaaaa    
 1714 
 1715 /^(a){1,1}/
 1716     bcd
 1717     abc
 1718     aab  
 1719 
 1720 /^(a){1,2}/
 1721     bcd
 1722     abc
 1723     aab  
 1724 
 1725 /^(a){1,3}/
 1726     bcd
 1727     abc
 1728     aab
 1729     aaa   
 1730 
 1731 /^(a){1,}/
 1732     bcd
 1733     abc
 1734     aab
 1735     aaa
 1736     aaaaaaaa    
 1737 
 1738 /.*\.gif/
 1739     borfle\nbib.gif\nno
 1740 
 1741 /.{0,}\.gif/
 1742     borfle\nbib.gif\nno
 1743 
 1744 /.*\.gif/m
 1745     borfle\nbib.gif\nno
 1746 
 1747 /.*\.gif/s
 1748     borfle\nbib.gif\nno
 1749 
 1750 /.*\.gif/ms
 1751     borfle\nbib.gif\nno
 1752     
 1753 /.*$/
 1754     borfle\nbib.gif\nno
 1755 
 1756 /.*$/m
 1757     borfle\nbib.gif\nno
 1758 
 1759 /.*$/s
 1760     borfle\nbib.gif\nno
 1761 
 1762 /.*$/ms
 1763     borfle\nbib.gif\nno
 1764     
 1765 /.*$/
 1766     borfle\nbib.gif\nno\n
 1767 
 1768 /.*$/m
 1769     borfle\nbib.gif\nno\n
 1770 
 1771 /.*$/s
 1772     borfle\nbib.gif\nno\n
 1773 
 1774 /.*$/ms
 1775     borfle\nbib.gif\nno\n
 1776     
 1777 /(.*X|^B)/
 1778     abcde\n1234Xyz
 1779     BarFoo 
 1780     *** Failers
 1781     abcde\nBar  
 1782 
 1783 /(.*X|^B)/m
 1784     abcde\n1234Xyz
 1785     BarFoo 
 1786     abcde\nBar  
 1787 
 1788 /(.*X|^B)/s
 1789     abcde\n1234Xyz
 1790     BarFoo 
 1791     *** Failers
 1792     abcde\nBar  
 1793 
 1794 /(.*X|^B)/ms
 1795     abcde\n1234Xyz
 1796     BarFoo 
 1797     abcde\nBar  
 1798 
 1799 /(?s)(.*X|^B)/
 1800     abcde\n1234Xyz
 1801     BarFoo 
 1802     *** Failers 
 1803     abcde\nBar  
 1804 
 1805 /(?s:.*X|^B)/
 1806     abcde\n1234Xyz
 1807     BarFoo 
 1808     *** Failers 
 1809     abcde\nBar  
 1810 
 1811 /^.*B/
 1812     **** Failers
 1813     abc\nB
 1814      
 1815 /(?s)^.*B/
 1816     abc\nB
 1817 
 1818 /(?m)^.*B/
 1819     abc\nB
 1820      
 1821 /(?ms)^.*B/
 1822     abc\nB
 1823 
 1824 /(?ms)^B/
 1825     abc\nB
 1826 
 1827 /(?s)B$/
 1828     B\n
 1829 
 1830 /^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/
 1831     123456654321
 1832   
 1833 /^\d\d\d\d\d\d\d\d\d\d\d\d/
 1834     123456654321 
 1835 
 1836 /^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/
 1837     123456654321
 1838   
 1839 /^[abc]{12}/
 1840     abcabcabcabc
 1841     
 1842 /^[a-c]{12}/
 1843     abcabcabcabc
 1844     
 1845 /^(a|b|c){12}/
 1846     abcabcabcabc 
 1847 
 1848 /^[abcdefghijklmnopqrstuvwxy0123456789]/
 1849     n
 1850     *** Failers 
 1851     z 
 1852 
 1853 /abcde{0,0}/
 1854     abcd
 1855     *** Failers
 1856     abce  
 1857 
 1858 /ab[cd]{0,0}e/
 1859     abe
 1860     *** Failers
 1861     abcde 
 1862     
 1863 /ab(c){0,0}d/
 1864     abd
 1865     *** Failers
 1866     abcd   
 1867 
 1868 /a(b*)/
 1869     a
 1870     ab
 1871     abbbb
 1872     *** Failers
 1873     bbbbb    
 1874     
 1875 /ab\d{0}e/
 1876     abe
 1877     *** Failers
 1878     ab1e   
 1879     
 1880 /"([^\\"]+|\\.)*"/
 1881     the \"quick\" brown fox
 1882     \"the \\\"quick\\\" brown fox\" 
 1883 
 1884 /.*?/g,aftertext
 1885     abc
 1886   
 1887 /\b/g,aftertext
 1888     abc 
 1889 
 1890 /\b/g,aftertext
 1891     abc 
 1892 
 1893 //g
 1894     abc
 1895 
 1896 /<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
 1897   <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>
 1898 
 1899 /a[^a]b/
 1900     acb
 1901     a\nb
 1902     
 1903 /a.b/
 1904     acb
 1905     *** Failers 
 1906     a\nb   
 1907     
 1908 /a[^a]b/s
 1909     acb
 1910     a\nb  
 1911     
 1912 /a.b/s
 1913     acb
 1914     a\nb  
 1915 
 1916 /^(b+?|a){1,2}?c/
 1917     bac
 1918     bbac
 1919     bbbac
 1920     bbbbac
 1921     bbbbbac 
 1922 
 1923 /^(b+|a){1,2}?c/
 1924     bac
 1925     bbac
 1926     bbbac
 1927     bbbbac
 1928     bbbbbac 
 1929     
 1930 /(?!\A)x/m
 1931     x\nb\n
 1932     a\bx\n  
 1933     
 1934 /\x0{ab}/
 1935     \0{ab} 
 1936 
 1937 /(A|B)*?CD/
 1938     CD 
 1939     
 1940 /(A|B)*CD/
 1941     CD 
 1942 
 1943 /(AB)*?\1/
 1944     ABABAB
 1945 
 1946 /(AB)*\1/
 1947     ABABAB
 1948     
 1949 /(?<!bar)foo/
 1950     foo
 1951     catfood
 1952     arfootle
 1953     rfoosh
 1954     *** Failers
 1955     barfoo
 1956     towbarfoo
 1957 
 1958 /\w{3}(?<!bar)foo/
 1959     catfood
 1960     *** Failers
 1961     foo
 1962     barfoo
 1963     towbarfoo
 1964 
 1965 /(?<=(foo)a)bar/
 1966     fooabar
 1967     *** Failers
 1968     bar
 1969     foobbar
 1970       
 1971 /\Aabc\z/m
 1972     abc
 1973     *** Failers
 1974     abc\n   
 1975     qqq\nabc
 1976     abc\nzzz
 1977     qqq\nabc\nzzz
 1978 
 1979 "(?>.*/)foo"
 1980     /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/
 1981 
 1982 "(?>.*/)foo"
 1983     /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo
 1984 
 1985 /(?>(\.\d\d[1-9]?))\d+/
 1986     1.230003938
 1987     1.875000282
 1988     *** Failers 
 1989     1.235 
 1990 
 1991 /^((?>\w+)|(?>\s+))*$/
 1992     now is the time for all good men to come to the aid of the party
 1993     *** Failers
 1994     this is not a line with only words and spaces!
 1995     
 1996 /(\d+)(\w)/
 1997     12345a
 1998     12345+ 
 1999 
 2000 /((?>\d+))(\w)/
 2001     12345a
 2002     *** Failers
 2003     12345+ 
 2004 
 2005 /(?>a+)b/
 2006     aaab
 2007 
 2008 /((?>a+)b)/
 2009     aaab
 2010 
 2011 /(?>(a+))b/
 2012     aaab
 2013 
 2014 /(?>b)+/
 2015     aaabbbccc
 2016 
 2017 /(?>a+|b+|c+)*c/
 2018     aaabbbbccccd
 2019 
 2020 /((?>[^()]+)|\([^()]*\))+/
 2021     ((abc(ade)ufh()()x
 2022     
 2023 /\(((?>[^()]+)|\([^()]+\))+\)/
 2024     (abc)
 2025     (abc(def)xyz)
 2026     *** Failers
 2027     ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa   
 2028 
 2029 /a(?-i)b/i
 2030     ab
 2031     Ab
 2032     *** Failers 
 2033     aB
 2034     AB
 2035         
 2036 /(a (?x)b c)d e/
 2037     a bcd e
 2038     *** Failers
 2039     a b cd e
 2040     abcd e   
 2041     a bcde 
 2042  
 2043 /(a b(?x)c d (?-x)e f)/
 2044     a bcde f
 2045     *** Failers
 2046     abcdef  
 2047 
 2048 /(a(?i)b)c/
 2049     abc
 2050     aBc
 2051     *** Failers
 2052     abC
 2053     aBC  
 2054     Abc
 2055     ABc
 2056     ABC
 2057     AbC
 2058     
 2059 /a(?i:b)c/
 2060     abc
 2061     aBc
 2062     *** Failers 
 2063     ABC
 2064     abC
 2065     aBC
 2066     
 2067 /a(?i:b)*c/
 2068     aBc
 2069     aBBc
 2070     *** Failers 
 2071     aBC
 2072     aBBC
 2073     
 2074 /a(?=b(?i)c)\w\wd/
 2075     abcd
 2076     abCd
 2077     *** Failers
 2078     aBCd
 2079     abcD     
 2080     
 2081 /(?s-i:more.*than).*million/i
 2082     more than million
 2083     more than MILLION
 2084     more \n than Million 
 2085     *** Failers
 2086     MORE THAN MILLION    
 2087     more \n than \n million 
 2088 
 2089 /(?:(?s-i)more.*than).*million/i
 2090     more than million
 2091     more than MILLION
 2092     more \n than Million 
 2093     *** Failers
 2094     MORE THAN MILLION    
 2095     more \n than \n million 
 2096     
 2097 /(?>a(?i)b+)+c/
 2098     abc
 2099     aBbc
 2100     aBBc 
 2101     *** Failers
 2102     Abc
 2103     abAb    
 2104     abbC 
 2105     
 2106 /(?=a(?i)b)\w\wc/
 2107     abc
 2108     aBc
 2109     *** Failers
 2110     Ab 
 2111     abC
 2112     aBC     
 2113     
 2114 /(?<=a(?i)b)(\w\w)c/
 2115     abxxc
 2116     aBxxc
 2117     *** Failers
 2118     Abxxc
 2119     ABxxc
 2120     abxxC      
 2121 
 2122 /(?:(a)|b)(?(1)A|B)/
 2123     aA
 2124     bB
 2125     *** Failers
 2126     aB
 2127     bA    
 2128 
 2129 /^(a)?(?(1)a|b)+$/
 2130     aa
 2131     b
 2132     bb  
 2133     *** Failers
 2134     ab   
 2135     
 2136 # Perl gets this next one wrong if the pattern ends with $; in that case it
 2137 # fails to match "12". 
 2138 
 2139 /^(?(?=abc)\w{3}:|\d\d)/
 2140     abc:
 2141     12
 2142     123
 2143     *** Failers
 2144     xyz    
 2145 
 2146 /^(?(?!abc)\d\d|\w{3}:)$/
 2147     abc:
 2148     12
 2149     *** Failers
 2150     123
 2151     xyz    
 2152     
 2153 /(?(?<=foo)bar|cat)/
 2154     foobar
 2155     cat
 2156     fcat
 2157     focat   
 2158     *** Failers
 2159     foocat  
 2160 
 2161 /(?(?<!foo)cat|bar)/
 2162     foobar
 2163     cat
 2164     fcat
 2165     focat   
 2166     *** Failers
 2167     foocat  
 2168 
 2169 /( \( )? [^()]+ (?(1) \) |) /x
 2170     abcd
 2171     (abcd)
 2172     the quick (abcd) fox
 2173     (abcd   
 2174 
 2175 /( \( )? [^()]+ (?(1) \) ) /x
 2176     abcd
 2177     (abcd)
 2178     the quick (abcd) fox
 2179     (abcd   
 2180 
 2181 /^(?(2)a|(1)(2))+$/
 2182     12
 2183     12a
 2184     12aa
 2185     *** Failers
 2186     1234    
 2187 
 2188 /((?i)blah)\s+\1/
 2189     blah blah
 2190     BLAH BLAH
 2191     Blah Blah
 2192     blaH blaH
 2193     *** Failers
 2194     blah BLAH
 2195     Blah blah      
 2196     blaH blah 
 2197 
 2198 /((?i)blah)\s+(?i:\1)/
 2199     blah blah
 2200     BLAH BLAH
 2201     Blah Blah
 2202     blaH blaH
 2203     blah BLAH
 2204     Blah blah      
 2205     blaH blah 
 2206 
 2207 /(?>a*)*/
 2208     a
 2209     aa
 2210     aaaa
 2211     
 2212 /(abc|)+/
 2213     abc
 2214     abcabc
 2215     abcabcabc
 2216     xyz      
 2217 
 2218 /([a]*)*/
 2219     a
 2220     aaaaa 
 2221  
 2222 /([ab]*)*/
 2223     a
 2224     b
 2225     ababab
 2226     aaaabcde
 2227     bbbb    
 2228  
 2229 /([^a]*)*/
 2230     b
 2231     bbbb
 2232     aaa   
 2233  
 2234 /([^ab]*)*/
 2235     cccc
 2236     abab  
 2237  
 2238 /([a]*?)*/
 2239     a
 2240     aaaa 
 2241  
 2242 /([ab]*?)*/
 2243     a
 2244     b
 2245     abab
 2246     baba   
 2247  
 2248 /([^a]*?)*/
 2249     b
 2250     bbbb
 2251     aaa   
 2252  
 2253 /([^ab]*?)*/
 2254     c
 2255     cccc
 2256     baba   
 2257  
 2258 /(?>a*)*/
 2259     a
 2260     aaabcde 
 2261  
 2262 /((?>a*))*/
 2263     aaaaa
 2264     aabbaa 
 2265  
 2266 /((?>a*?))*/
 2267     aaaaa
 2268     aabbaa 
 2269 
 2270 /(?(?=[^a-z]+[a-z])  \d{2}-[a-z]{3}-\d{2}  |  \d{2}-\d{2}-\d{2} ) /x
 2271     12-sep-98
 2272     12-09-98
 2273     *** Failers
 2274     sep-12-98
 2275         
 2276 /(?<=(foo))bar\1/
 2277     foobarfoo
 2278     foobarfootling 
 2279     *** Failers
 2280     foobar
 2281     barfoo   
 2282 
 2283 /(?i:saturday|sunday)/
 2284     saturday
 2285     sunday
 2286     Saturday
 2287     Sunday
 2288     SATURDAY
 2289     SUNDAY
 2290     SunDay
 2291     
 2292 /(a(?i)bc|BB)x/
 2293     abcx
 2294     aBCx
 2295     bbx
 2296     BBx
 2297     *** Failers
 2298     abcX
 2299     aBCX
 2300     bbX
 2301     BBX               
 2302 
 2303 /^([ab](?i)[cd]|[ef])/
 2304     ac
 2305     aC
 2306     bD
 2307     elephant
 2308     Europe 
 2309     frog
 2310     France
 2311     *** Failers
 2312     Africa     
 2313 
 2314 /^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/
 2315     ab
 2316     aBd
 2317     xy
 2318     xY
 2319     zebra
 2320     Zambesi
 2321     *** Failers
 2322     aCD  
 2323     XY  
 2324 
 2325 /(?<=foo\n)^bar/m
 2326     foo\nbar
 2327     *** Failers
 2328     bar
 2329     baz\nbar   
 2330 
 2331 /(?<=(?<!foo)bar)baz/
 2332     barbaz
 2333     barbarbaz 
 2334     koobarbaz 
 2335     *** Failers
 2336     baz
 2337     foobarbaz 
 2338 
 2339 /The cases of aaaa and aaaaaa are missed out below because Perl does things/
 2340 /differently. We know that odd, and maybe incorrect, things happen with/
 2341 /recursive references in Perl, as far as 5.11.3 - see some stuff in test #2./
 2342 
 2343 /^(a\1?){4}$/
 2344     a
 2345     aa
 2346     aaa
 2347     aaaaa
 2348     aaaaaaa
 2349     aaaaaaaa
 2350     aaaaaaaaa
 2351     aaaaaaaaaa
 2352     aaaaaaaaaaa
 2353     aaaaaaaaaaaa
 2354     aaaaaaaaaaaaa
 2355     aaaaaaaaaaaaaa
 2356     aaaaaaaaaaaaaaa
 2357     aaaaaaaaaaaaaaaa               
 2358 
 2359 /^(a\1?)(a\1?)(a\2?)(a\3?)$/
 2360     a
 2361     aa
 2362     aaa
 2363     aaaa
 2364     aaaaa
 2365     aaaaaa
 2366     aaaaaaa
 2367     aaaaaaaa
 2368     aaaaaaaaa
 2369     aaaaaaaaaa
 2370     aaaaaaaaaaa
 2371     aaaaaaaaaaaa
 2372     aaaaaaaaaaaaa
 2373     aaaaaaaaaaaaaa
 2374     aaaaaaaaaaaaaaa
 2375     aaaaaaaaaaaaaaaa               
 2376 
 2377 /The following tests are taken from the Perl 5.005 test suite; some of them/
 2378 /are compatible with 5.004, but I'd rather not have to sort them out./
 2379 
 2380 /abc/
 2381     abc
 2382     xabcy
 2383     ababc
 2384     *** Failers
 2385     xbc
 2386     axc
 2387     abx
 2388 
 2389 /ab*c/
 2390     abc
 2391 
 2392 /ab*bc/
 2393     abc
 2394     abbc
 2395     abbbbc
 2396 
 2397 /.{1}/
 2398     abbbbc
 2399 
 2400 /.{3,4}/
 2401     abbbbc
 2402 
 2403 /ab{0,}bc/
 2404     abbbbc
 2405 
 2406 /ab+bc/
 2407     abbc
 2408     *** Failers
 2409     abc
 2410     abq
 2411 
 2412 /ab{1,}bc/
 2413 
 2414 /ab+bc/
 2415     abbbbc
 2416 
 2417 /ab{1,}bc/
 2418     abbbbc
 2419 
 2420 /ab{1,3}bc/
 2421     abbbbc
 2422 
 2423 /ab{3,4}bc/
 2424     abbbbc
 2425 
 2426 /ab{4,5}bc/
 2427     *** Failers
 2428     abq
 2429     abbbbc
 2430 
 2431 /ab?bc/
 2432     abbc
 2433     abc
 2434 
 2435 /ab{0,1}bc/
 2436     abc
 2437 
 2438 /ab?bc/
 2439 
 2440 /ab?c/
 2441     abc
 2442 
 2443 /ab{0,1}c/
 2444     abc
 2445 
 2446 /^abc$/
 2447     abc
 2448     *** Failers
 2449     abbbbc
 2450     abcc
 2451 
 2452 /^abc/
 2453     abcc
 2454 
 2455 /^abc$/
 2456 
 2457 /abc$/
 2458     aabc
 2459     *** Failers
 2460     aabc
 2461     aabcd
 2462 
 2463 /^/
 2464     abc
 2465 
 2466 /$/
 2467     abc
 2468 
 2469 /a.c/
 2470     abc
 2471     axc
 2472 
 2473 /a.*c/
 2474     axyzc
 2475 
 2476 /a[bc]d/
 2477     abd
 2478     *** Failers
 2479     axyzd
 2480     abc
 2481 
 2482 /a[b-d]e/
 2483     ace
 2484 
 2485 /a[b-d]/
 2486     aac
 2487 
 2488 /a[-b]/
 2489     a-
 2490 
 2491 /a[b-]/
 2492     a-
 2493 
 2494 /a]/
 2495     a]
 2496 
 2497 /a[]]b/
 2498     a]b
 2499 
 2500 /a[^bc]d/
 2501     aed
 2502     *** Failers
 2503     abd
 2504     abd
 2505 
 2506 /a[^-b]c/
 2507     adc
 2508 
 2509 /a[^]b]c/
 2510     adc
 2511     *** Failers
 2512     a-c
 2513     a]c
 2514 
 2515 /\ba\b/
 2516     a-
 2517     -a
 2518     -a-
 2519 
 2520 /\by\b/
 2521     *** Failers
 2522     xy
 2523     yz
 2524     xyz
 2525 
 2526 /\Ba\B/
 2527     *** Failers
 2528     a-
 2529     -a
 2530     -a-
 2531 
 2532 /\By\b/
 2533     xy
 2534 
 2535 /\by\B/
 2536     yz
 2537 
 2538 /\By\B/
 2539     xyz
 2540 
 2541 /\w/
 2542     a
 2543 
 2544 /\W/
 2545     -
 2546     *** Failers
 2547     -
 2548     a
 2549 
 2550 /a\sb/
 2551     a b
 2552 
 2553 /a\Sb/
 2554     a-b
 2555     *** Failers
 2556     a-b
 2557     a b
 2558 
 2559 /\d/
 2560     1
 2561 
 2562 /\D/
 2563     -
 2564     *** Failers
 2565     -
 2566     1
 2567 
 2568 /[\w]/
 2569     a
 2570 
 2571 /[\W]/
 2572     -
 2573     *** Failers
 2574     -
 2575     a
 2576 
 2577 /a[\s]b/
 2578     a b
 2579 
 2580 /a[\S]b/
 2581     a-b
 2582     *** Failers
 2583     a-b
 2584     a b
 2585 
 2586 /[\d]/
 2587     1
 2588 
 2589 /[\D]/
 2590     -
 2591     *** Failers
 2592     -
 2593     1
 2594 
 2595 /ab|cd/
 2596     abc
 2597     abcd
 2598 
 2599 /()ef/
 2600     def
 2601 
 2602 /$b/
 2603 
 2604 /a\(b/
 2605     a(b
 2606 
 2607 /a\(*b/
 2608     ab
 2609     a((b
 2610 
 2611 /a\\b/
 2612     a\\b
 2613 
 2614 /((a))/
 2615     abc
 2616 
 2617 /(a)b(c)/
 2618     abc
 2619 
 2620 /a+b+c/
 2621     aabbabc
 2622 
 2623 /a{1,}b{1,}c/
 2624     aabbabc
 2625 
 2626 /a.+?c/
 2627     abcabc
 2628 
 2629 /(a+|b)*/
 2630     ab
 2631 
 2632 /(a+|b){0,}/
 2633     ab
 2634 
 2635 /(a+|b)+/
 2636     ab
 2637 
 2638 /(a+|b){1,}/
 2639     ab
 2640 
 2641 /(a+|b)?/
 2642     ab
 2643 
 2644 /(a+|b){0,1}/
 2645     ab
 2646 
 2647 /[^ab]*/
 2648     cde
 2649 
 2650 /abc/
 2651     *** Failers
 2652     b
 2653     
 2654 
 2655 /a*/
 2656     
 2657 
 2658 /([abc])*d/
 2659     abbbcd
 2660 
 2661 /([abc])*bcd/
 2662     abcd
 2663 
 2664 /a|b|c|d|e/
 2665     e
 2666 
 2667 /(a|b|c|d|e)f/
 2668     ef
 2669 
 2670 /abcd*efg/
 2671     abcdefg
 2672 
 2673 /ab*/
 2674     xabyabbbz
 2675     xayabbbz
 2676 
 2677 /(ab|cd)e/
 2678     abcde
 2679 
 2680 /[abhgefdc]ij/
 2681     hij
 2682 
 2683 /^(ab|cd)e/
 2684 
 2685 /(abc|)ef/
 2686     abcdef
 2687 
 2688 /(a|b)c*d/
 2689     abcd
 2690 
 2691 /(ab|ab*)bc/
 2692     abc
 2693 
 2694 /a([bc]*)c*/
 2695     abc
 2696 
 2697 /a([bc]*)(c*d)/
 2698     abcd
 2699 
 2700 /a([bc]+)(c*d)/
 2701     abcd
 2702 
 2703 /a([bc]*)(c+d)/
 2704     abcd
 2705 
 2706 /a[bcd]*dcdcde/
 2707     adcdcde
 2708 
 2709 /a[bcd]+dcdcde/
 2710     *** Failers
 2711     abcde
 2712     adcdcde
 2713 
 2714 /(ab|a)b*c/
 2715     abc
 2716 
 2717 /((a)(b)c)(d)/
 2718     abcd
 2719 
 2720 /[a-zA-Z_][a-zA-Z0-9_]*/
 2721     alpha
 2722 
 2723 /^a(bc+|b[eh])g|.h$/
 2724     abh
 2725 
 2726 /(bc+d$|ef*g.|h?i(j|k))/
 2727     effgz
 2728     ij
 2729     reffgz
 2730     *** Failers
 2731     effg
 2732     bcdd
 2733 
 2734 /((((((((((a))))))))))/
 2735     a
 2736 
 2737 /((((((((((a))))))))))\10/
 2738     aa
 2739 
 2740 /(((((((((a)))))))))/
 2741     a
 2742 
 2743 /multiple words of text/
 2744     *** Failers
 2745     aa
 2746     uh-uh
 2747 
 2748 /multiple words/
 2749     multiple words, yeah
 2750 
 2751 /(.*)c(.*)/
 2752     abcde
 2753 
 2754 /\((.*), (.*)\)/
 2755     (a, b)
 2756 
 2757 /[k]/
 2758 
 2759 /abcd/
 2760     abcd
 2761 
 2762 /a(bc)d/
 2763     abcd
 2764 
 2765 /a[-]?c/
 2766     ac
 2767 
 2768 /(abc)\1/
 2769     abcabc
 2770 
 2771 /([a-c]*)\1/
 2772     abcabc
 2773 
 2774 /(a)|\1/
 2775     a
 2776     *** Failers
 2777     ab
 2778     x
 2779 
 2780 /(([a-c])b*?\2)*/
 2781     ababbbcbc
 2782 
 2783 /(([a-c])b*?\2){3}/
 2784     ababbbcbc
 2785 
 2786 /((\3|b)\2(a)x)+/
 2787     aaaxabaxbaaxbbax
 2788 
 2789 /((\3|b)\2(a)){2,}/
 2790     bbaababbabaaaaabbaaaabba
 2791 
 2792 /abc/i
 2793     ABC
 2794     XABCY
 2795     ABABC
 2796     *** Failers
 2797     aaxabxbaxbbx
 2798     XBC
 2799     AXC
 2800     ABX
 2801 
 2802 /ab*c/i
 2803     ABC
 2804 
 2805 /ab*bc/i
 2806     ABC
 2807     ABBC
 2808 
 2809 /ab*?bc/i
 2810     ABBBBC
 2811 
 2812 /ab{0,}?bc/i
 2813     ABBBBC
 2814 
 2815 /ab+?bc/i
 2816     ABBC
 2817 
 2818 /ab+bc/i
 2819     *** Failers
 2820     ABC
 2821     ABQ
 2822 
 2823 /ab{1,}bc/i
 2824 
 2825 /ab+bc/i
 2826     ABBBBC
 2827 
 2828 /ab{1,}?bc/i
 2829     ABBBBC
 2830 
 2831 /ab{1,3}?bc/i
 2832     ABBBBC
 2833 
 2834 /ab{3,4}?bc/i
 2835     ABBBBC
 2836 
 2837 /ab{4,5}?bc/i
 2838     *** Failers
 2839     ABQ
 2840     ABBBBC
 2841 
 2842 /ab??bc/i
 2843     ABBC
 2844     ABC
 2845 
 2846 /ab{0,1}?bc/i
 2847     ABC
 2848 
 2849 /ab??bc/i
 2850 
 2851 /ab??c/i
 2852     ABC
 2853 
 2854 /ab{0,1}?c/i
 2855     ABC
 2856 
 2857 /^abc$/i
 2858     ABC
 2859     *** Failers
 2860     ABBBBC
 2861     ABCC
 2862 
 2863 /^abc/i
 2864     ABCC
 2865 
 2866 /^abc$/i
 2867 
 2868 /abc$/i
 2869     AABC
 2870 
 2871 /^/i
 2872     ABC
 2873 
 2874 /$/i
 2875     ABC
 2876 
 2877 /a.c/i
 2878     ABC
 2879     AXC
 2880 
 2881 /a.*?c/i
 2882     AXYZC
 2883 
 2884 /a.*c/i
 2885     *** Failers
 2886     AABC
 2887     AXYZD
 2888 
 2889 /a[bc]d/i
 2890     ABD
 2891 
 2892 /a[b-d]e/i
 2893     ACE
 2894     *** Failers
 2895     ABC
 2896     ABD
 2897 
 2898 /a[b-d]/i
 2899     AAC
 2900 
 2901 /a[-b]/i
 2902     A-
 2903 
 2904 /a[b-]/i
 2905     A-
 2906 
 2907 /a]/i
 2908     A]
 2909 
 2910 /a[]]b/i
 2911     A]B
 2912 
 2913 /a[^bc]d/i
 2914     AED
 2915 
 2916 /a[^-b]c/i
 2917     ADC
 2918     *** Failers
 2919     ABD
 2920     A-C
 2921 
 2922 /a[^]b]c/i
 2923     ADC
 2924 
 2925 /ab|cd/i
 2926     ABC
 2927     ABCD
 2928 
 2929 /()ef/i
 2930     DEF
 2931 
 2932 /$b/i
 2933     *** Failers
 2934     A]C
 2935     B
 2936 
 2937 /a\(b/i
 2938     A(B
 2939 
 2940 /a\(*b/i
 2941     AB
 2942     A((B
 2943 
 2944 /a\\b/i
 2945     A\\b
 2946     a\\B 
 2947 
 2948 /((a))/i
 2949     ABC
 2950 
 2951 /(a)b(c)/i
 2952     ABC
 2953 
 2954 /a+b+c/i
 2955     AABBABC
 2956 
 2957 /a{1,}b{1,}c/i
 2958     AABBABC
 2959 
 2960 /a.+?c/i
 2961     ABCABC
 2962 
 2963 /a.*?c/i
 2964     ABCABC
 2965 
 2966 /a.{0,5}?c/i
 2967     ABCABC
 2968 
 2969 /(a+|b)*/i
 2970     AB
 2971 
 2972 /(a+|b){0,}/i
 2973     AB
 2974 
 2975 /(a+|b)+/i
 2976     AB
 2977 
 2978 /(a+|b){1,}/i
 2979     AB
 2980 
 2981 /(a+|b)?/i
 2982     AB
 2983 
 2984 /(a+|b){0,1}/i
 2985     AB
 2986 
 2987 /(a+|b){0,1}?/i
 2988     AB
 2989 
 2990 /[^ab]*/i
 2991     CDE
 2992 
 2993 /abc/i
 2994 
 2995 /a*/i
 2996     
 2997 
 2998 /([abc])*d/i
 2999     ABBBCD
 3000 
 3001 /([abc])*bcd/i
 3002     ABCD
 3003 
 3004 /a|b|c|d|e/i
 3005     E
 3006 
 3007 /(a|b|c|d|e)f/i
 3008     EF
 3009 
 3010 /abcd*efg/i
 3011     ABCDEFG
 3012 
 3013 /ab*/i
 3014     XABYABBBZ
 3015     XAYABBBZ
 3016 
 3017 /(ab|cd)e/i
 3018     ABCDE
 3019 
 3020 /[abhgefdc]ij/i
 3021     HIJ
 3022 
 3023 /^(ab|cd)e/i
 3024     ABCDE
 3025 
 3026 /(abc|)ef/i
 3027     ABCDEF
 3028 
 3029 /(a|b)c*d/i
 3030     ABCD
 3031 
 3032 /(ab|ab*)bc/i
 3033     ABC
 3034 
 3035 /a([bc]*)c*/i
 3036     ABC
 3037 
 3038 /a([bc]*)(c*d)/i
 3039     ABCD
 3040 
 3041 /a([bc]+)(c*d)/i
 3042     ABCD
 3043 
 3044 /a([bc]*)(c+d)/i
 3045     ABCD
 3046 
 3047 /a[bcd]*dcdcde/i
 3048     ADCDCDE
 3049 
 3050 /a[bcd]+dcdcde/i
 3051 
 3052 /(ab|a)b*c/i
 3053     ABC
 3054 
 3055 /((a)(b)c)(d)/i
 3056     ABCD
 3057 
 3058 /[a-zA-Z_][a-zA-Z0-9_]*/i
 3059     ALPHA
 3060 
 3061 /^a(bc+|b[eh])g|.h$/i
 3062     ABH
 3063 
 3064 /(bc+d$|ef*g.|h?i(j|k))/i
 3065     EFFGZ
 3066     IJ
 3067     REFFGZ
 3068     *** Failers
 3069     ADCDCDE
 3070     EFFG
 3071     BCDD
 3072 
 3073 /((((((((((a))))))))))/i
 3074     A
 3075 
 3076 /((((((((((a))))))))))\10/i
 3077     AA
 3078 
 3079 /(((((((((a)))))))))/i
 3080     A
 3081 
 3082 /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))/i
 3083     A
 3084 
 3085 /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/i
 3086     C
 3087 
 3088 /multiple words of text/i
 3089     *** Failers
 3090     AA
 3091     UH-UH
 3092 
 3093 /multiple words/i
 3094     MULTIPLE WORDS, YEAH
 3095 
 3096 /(.*)c(.*)/i
 3097     ABCDE
 3098 
 3099 /\((.*), (.*)\)/i
 3100     (A, B)
 3101 
 3102 /[k]/i
 3103 
 3104 /abcd/i
 3105     ABCD
 3106 
 3107 /a(bc)d/i
 3108     ABCD
 3109 
 3110 /a[-]?c/i
 3111     AC
 3112 
 3113 /(abc)\1/i
 3114     ABCABC
 3115 
 3116 /([a-c]*)\1/i
 3117     ABCABC
 3118 
 3119 /a(?!b)./
 3120     abad
 3121 
 3122 /a(?=d)./
 3123     abad
 3124 
 3125 /a(?=c|d)./
 3126     abad
 3127 
 3128 /a(?:b|c|d)(.)/
 3129     ace
 3130 
 3131 /a(?:b|c|d)*(.)/
 3132     ace
 3133 
 3134 /a(?:b|c|d)+?(.)/
 3135     ace
 3136     acdbcdbe
 3137 
 3138 /a(?:b|c|d)+(.)/
 3139     acdbcdbe
 3140 
 3141 /a(?:b|c|d){2}(.)/
 3142     acdbcdbe
 3143 
 3144 /a(?:b|c|d){4,5}(.)/
 3145     acdbcdbe
 3146 
 3147 /a(?:b|c|d){4,5}?(.)/
 3148     acdbcdbe
 3149 
 3150 /((foo)|(bar))*/
 3151     foobar
 3152 
 3153 /a(?:b|c|d){6,7}(.)/
 3154     acdbcdbe
 3155 
 3156 /a(?:b|c|d){6,7}?(.)/
 3157     acdbcdbe
 3158 
 3159 /a(?:b|c|d){5,6}(.)/
 3160     acdbcdbe
 3161 
 3162 /a(?:b|c|d){5,6}?(.)/
 3163     acdbcdbe
 3164 
 3165 /a(?:b|c|d){5,7}(.)/
 3166     acdbcdbe
 3167 
 3168 /a(?:b|c|d){5,7}?(.)/
 3169     acdbcdbe
 3170 
 3171 /a(?:b|(c|e){1,2}?|d)+?(.)/
 3172     ace
 3173 
 3174 /^(.+)?B/
 3175     AB
 3176 
 3177 /^([^a-z])|(\^)$/
 3178     .
 3179 
 3180 /^[<>]&/
 3181     <&OUT
 3182 
 3183 /^(a\1?){4}$/
 3184     aaaaaaaaaa
 3185     *** Failers
 3186     AB
 3187     aaaaaaaaa
 3188     aaaaaaaaaaa
 3189 
 3190 /^(a(?(1)\1)){4}$/
 3191     aaaaaaaaaa
 3192     *** Failers
 3193     aaaaaaaaa
 3194     aaaaaaaaaaa
 3195 
 3196 /(?:(f)(o)(o)|(b)(a)(r))*/
 3197     foobar
 3198 
 3199 /(?<=a)b/
 3200     ab
 3201     *** Failers
 3202     cb
 3203     b
 3204 
 3205 /(?<!c)b/
 3206     ab
 3207     b
 3208     b
 3209 
 3210 /(?:..)*a/
 3211     aba
 3212 
 3213 /(?:..)*?a/
 3214     aba
 3215 
 3216 /^(?:b|a(?=(.)))*\1/
 3217     abc
 3218 
 3219 /^(){3,5}/
 3220     abc
 3221 
 3222 /^(a+)*ax/
 3223     aax
 3224 
 3225 /^((a|b)+)*ax/
 3226     aax
 3227 
 3228 /^((a|bc)+)*ax/
 3229     aax
 3230 
 3231 /(a|x)*ab/
 3232     cab
 3233 
 3234 /(a)*ab/
 3235     cab
 3236 
 3237 /(?:(?i)a)b/
 3238     ab
 3239 
 3240 /((?i)a)b/
 3241     ab
 3242 
 3243 /(?:(?i)a)b/
 3244     Ab
 3245 
 3246 /((?i)a)b/
 3247     Ab
 3248 
 3249 /(?:(?i)a)b/
 3250     *** Failers
 3251     cb
 3252     aB
 3253 
 3254 /((?i)a)b/
 3255 
 3256 /(?i:a)b/
 3257     ab
 3258 
 3259 /((?i:a))b/
 3260     ab
 3261 
 3262 /(?i:a)b/
 3263     Ab
 3264 
 3265 /((?i:a))b/
 3266     Ab
 3267 
 3268 /(?i:a)b/
 3269     *** Failers
 3270     aB
 3271     aB
 3272 
 3273 /((?i:a))b/
 3274 
 3275 /(?:(?-i)a)b/i
 3276     ab
 3277 
 3278 /((?-i)a)b/i
 3279     ab
 3280 
 3281 /(?:(?-i)a)b/i
 3282     aB
 3283 
 3284 /((?-i)a)b/i
 3285     aB
 3286 
 3287 /(?:(?-i)a)b/i
 3288     *** Failers
 3289     aB
 3290     Ab
 3291 
 3292 /((?-i)a)b/i
 3293 
 3294 /(?:(?-i)a)b/i
 3295     aB
 3296 
 3297 /((?-i)a)b/i
 3298     aB
 3299 
 3300 /(?:(?-i)a)b/i
 3301     *** Failers
 3302     Ab
 3303     AB
 3304 
 3305 /((?-i)a)b/i
 3306 
 3307 /(?-i:a)b/i
 3308     ab
 3309 
 3310 /((?-i:a))b/i
 3311     ab
 3312 
 3313 /(?-i:a)b/i
 3314     aB
 3315 
 3316 /((?-i:a))b/i
 3317     aB
 3318 
 3319 /(?-i:a)b/i
 3320     *** Failers
 3321     AB
 3322     Ab
 3323 
 3324 /((?-i:a))b/i
 3325 
 3326 /(?-i:a)b/i
 3327     aB
 3328 
 3329 /((?-i:a))b/i
 3330     aB
 3331 
 3332 /(?-i:a)b/i
 3333     *** Failers
 3334     Ab
 3335     AB
 3336 
 3337 /((?-i:a))b/i
 3338 
 3339 /((?-i:a.))b/i
 3340     *** Failers
 3341     AB
 3342     a\nB
 3343 
 3344 /((?s-i:a.))b/i
 3345     a\nB
 3346 
 3347 /(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))/
 3348     cabbbb
 3349 
 3350 /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/
 3351     caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
 3352 
 3353 /(ab)\d\1/i
 3354     Ab4ab
 3355     ab4Ab
 3356 
 3357 /foo\w*\d{4}baz/
 3358     foobar1234baz
 3359 
 3360 /x(~~)*(?:(?:F)?)?/
 3361     x~~
 3362 
 3363 /^a(?#xxx){3}c/
 3364     aaac
 3365 
 3366 /^a (?#xxx) (?#yyy) {3}c/x
 3367     aaac
 3368 
 3369 /(?<![cd])b/
 3370     *** Failers
 3371     B\nB
 3372     dbcb
 3373 
 3374 /(?<![cd])[ab]/
 3375     dbaacb
 3376 
 3377 /(?<!(c|d))b/
 3378 
 3379 /(?<!(c|d))[ab]/
 3380     dbaacb
 3381 
 3382 /(?<!cd)[ab]/
 3383     cdaccb
 3384 
 3385 /^(?:a?b?)*$/
 3386     \
 3387     a
 3388     ab
 3389     aaa   
 3390     *** Failers
 3391     dbcb
 3392     a--
 3393     aa-- 
 3394 
 3395 /((?s)^a(.))((?m)^b$)/
 3396     a\nb\nc\n
 3397 
 3398 /((?m)^b$)/
 3399     a\nb\nc\n
 3400 
 3401 /(?m)^b/
 3402     a\nb\n
 3403 
 3404 /(?m)^(b)/
 3405     a\nb\n
 3406 
 3407 /((?m)^b)/
 3408     a\nb\n
 3409 
 3410 /\n((?m)^b)/
 3411     a\nb\n
 3412 
 3413 /((?s).)c(?!.)/
 3414     a\nb\nc\n
 3415     a\nb\nc\n
 3416 
 3417 /((?s)b.)c(?!.)/
 3418     a\nb\nc\n
 3419     a\nb\nc\n
 3420 
 3421 /^b/
 3422 
 3423 /()^b/
 3424     *** Failers
 3425     a\nb\nc\n
 3426     a\nb\nc\n
 3427 
 3428 /((?m)^b)/
 3429     a\nb\nc\n
 3430 
 3431 /(x)?(?(1)a|b)/
 3432     *** Failers
 3433     a
 3434     a
 3435 
 3436 /(x)?(?(1)b|a)/
 3437     a
 3438 
 3439 /()?(?(1)b|a)/
 3440     a
 3441 
 3442 /()(?(1)b|a)/
 3443 
 3444 /()?(?(1)a|b)/
 3445     a
 3446 
 3447 /^(\()?blah(?(1)(\)))$/
 3448     (blah)
 3449     blah
 3450     *** Failers
 3451     a
 3452     blah)
 3453     (blah
 3454 
 3455 /^(\(+)?blah(?(1)(\)))$/
 3456     (blah)
 3457     blah
 3458     *** Failers
 3459     blah)
 3460     (blah
 3461 
 3462 /(?(?!a)a|b)/
 3463 
 3464 /(?(?!a)b|a)/
 3465     a
 3466 
 3467 /(?(?=a)b|a)/
 3468     *** Failers
 3469     a
 3470     a
 3471 
 3472 /(?(?=a)a|b)/
 3473     a
 3474 
 3475 /(?=(a+?))(\1ab)/
 3476     aaab
 3477 
 3478 /^(?=(a+?))\1ab/
 3479 
 3480 /(\w+:)+/
 3481     one:
 3482 
 3483 /$(?<=^(a))/
 3484     a
 3485 
 3486 /(?=(a+?))(\1ab)/
 3487     aaab
 3488 
 3489 /^(?=(a+?))\1ab/
 3490     *** Failers
 3491     aaab
 3492     aaab
 3493 
 3494 /([\w:]+::)?(\w+)$/
 3495     abcd
 3496     xy:z:::abcd
 3497 
 3498 /^[^bcd]*(c+)/
 3499     aexycd
 3500 
 3501 /(a*)b+/
 3502     caab
 3503 
 3504 /([\w:]+::)?(\w+)$/
 3505     abcd
 3506     xy:z:::abcd
 3507     *** Failers
 3508     abcd:
 3509     abcd:
 3510 
 3511 /^[^bcd]*(c+)/
 3512     aexycd
 3513 
 3514 /(>a+)ab/
 3515 
 3516 /(?>a+)b/
 3517     aaab
 3518 
 3519 /([[:]+)/
 3520     a:[b]:
 3521 
 3522 /([[=]+)/
 3523     a=[b]=
 3524 
 3525 /([[.]+)/
 3526     a.[b].
 3527 
 3528 /((?>a+)b)/
 3529     aaab
 3530 
 3531 /(?>(a+))b/
 3532     aaab
 3533 
 3534 /((?>[^()]+)|\([^()]*\))+/
 3535     ((abc(ade)ufh()()x
 3536 
 3537 /a\Z/
 3538     *** Failers
 3539     aaab
 3540     a\nb\n
 3541 
 3542 /b\Z/
 3543     a\nb\n
 3544 
 3545 /b\z/
 3546 
 3547 /b\Z/
 3548     a\nb
 3549 
 3550 /b\z/
 3551     a\nb
 3552     *** Failers
 3553     
 3554 /^(?>(?(1)\.|())[^\W_](?>[a-z0-9-]*[^\W_])?)+$/
 3555     a
 3556     abc
 3557     a-b
 3558     0-9 
 3559     a.b
 3560     5.6.7  
 3561     the.quick.brown.fox
 3562     a100.b200.300c  
 3563     12-ab.1245 
 3564     *** Failers
 3565     \
 3566     .a
 3567     -a
 3568     a-
 3569     a.  
 3570     a_b 
 3571     a.-
 3572     a..  
 3573     ab..bc 
 3574     the.quick.brown.fox-
 3575     the.quick.brown.fox.
 3576     the.quick.brown.fox_
 3577     the.quick.brown.fox+       
 3578 
 3579 /(?>.*)(?<=(abcd|wxyz))/
 3580     alphabetabcd
 3581     endingwxyz
 3582     *** Failers
 3583     a rather long string that doesn't end with one of them
 3584 
 3585 /word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/
 3586     word cat dog elephant mussel cow horse canary baboon snake shark otherword
 3587     word cat dog elephant mussel cow horse canary baboon snake shark
 3588   
 3589 /word (?>[a-zA-Z0-9]+ ){0,30}otherword/
 3590     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
 3591 
 3592 /(?<=\d{3}(?!999))foo/
 3593     999foo
 3594     123999foo 
 3595     *** Failers
 3596     123abcfoo
 3597     
 3598 /(?<=(?!...999)\d{3})foo/
 3599     999foo
 3600     123999foo 
 3601     *** Failers
 3602     123abcfoo
 3603 
 3604 /(?<=\d{3}(?!999)...)foo/
 3605     123abcfoo
 3606     123456foo 
 3607     *** Failers
 3608     123999foo  
 3609     
 3610 /(?<=\d{3}...)(?<!999)foo/
 3611     123abcfoo   
 3612     123456foo 
 3613     *** Failers
 3614     123999foo  
 3615 
 3616 /<a[\s]+href[\s]*=[\s]*          # find <a href=
 3617  ([\"\'])?                       # find single or double quote
 3618  (?(1) (.*?)\1 | ([^\s]+))       # if quote found, match up to next matching
 3619                                  # quote, otherwise match up to next space
 3620 /isx
 3621     <a href=abcd xyz
 3622     <a href=\"abcd xyz pqr\" cats
 3623     <a href=\'abcd xyz pqr\' cats
 3624 
 3625 /<a\s+href\s*=\s*                # find <a href=
 3626  (["'])?                         # find single or double quote
 3627  (?(1) (.*?)\1 | (\S+))          # if quote found, match up to next matching
 3628                                  # quote, otherwise match up to next space
 3629 /isx
 3630     <a href=abcd xyz
 3631     <a href=\"abcd xyz pqr\" cats
 3632     <a href       =       \'abcd xyz pqr\' cats
 3633 
 3634 /<a\s+href(?>\s*)=(?>\s*)        # find <a href=
 3635  (["'])?                         # find single or double quote
 3636  (?(1) (.*?)\1 | (\S+))          # if quote found, match up to next matching
 3637                                  # quote, otherwise match up to next space
 3638 /isx
 3639     <a href=abcd xyz
 3640     <a href=\"abcd xyz pqr\" cats
 3641     <a href       =       \'abcd xyz pqr\' cats
 3642 
 3643 /((Z)+|A)*/
 3644     ZABCDEFG
 3645 
 3646 /(Z()|A)*/
 3647     ZABCDEFG
 3648 
 3649 /(Z(())|A)*/
 3650     ZABCDEFG
 3651 
 3652 /((?>Z)+|A)*/
 3653     ZABCDEFG
 3654 
 3655 /((?>)+|A)*/
 3656     ZABCDEFG
 3657 
 3658 /a*/g
 3659     abbab
 3660 
 3661 /^[\d-a]/
 3662     abcde
 3663     -things
 3664     0digit
 3665     *** Failers
 3666     bcdef    
 3667     
 3668 /[[:space:]]+/
 3669     > \x09\x0a\x0c\x0d\x0b<
 3670      
 3671 /[[:blank:]]+/
 3672     > \x09\x0a\x0c\x0d\x0b<
 3673      
 3674 /[\s]+/
 3675     > \x09\x0a\x0c\x0d\x0b<
 3676      
 3677 /\s+/
 3678     > \x09\x0a\x0c\x0d\x0b<
 3679      
 3680 /ab/x
 3681     ab
 3682 
 3683 /(?!\A)x/m
 3684   a\nxb\n
 3685 
 3686 /(?!^)x/m
 3687   a\nxb\n
 3688 
 3689 /abc\Qabc\Eabc/
 3690     abcabcabc
 3691     
 3692 /abc\Q(*+|\Eabc/
 3693     abc(*+|abc 
 3694 
 3695 /   abc\Q abc\Eabc/x
 3696     abc abcabc
 3697     *** Failers
 3698     abcabcabc  
 3699     
 3700 /abc#comment
 3701     \Q#not comment
 3702     literal\E/x
 3703     abc#not comment\n    literal     
 3704 
 3705 /abc#comment
 3706     \Q#not comment
 3707     literal/x
 3708     abc#not comment\n    literal     
 3709 
 3710 /abc#comment
 3711     \Q#not comment
 3712     literal\E #more comment
 3713     /x
 3714     abc#not comment\n    literal     
 3715 
 3716 /abc#comment
 3717     \Q#not comment
 3718     literal\E #more comment/x
 3719     abc#not comment\n    literal     
 3720 
 3721 /\Qabc\$xyz\E/
 3722     abc\\\$xyz
 3723 
 3724 /\Qabc\E\$\Qxyz\E/
 3725     abc\$xyz
 3726 
 3727 /\Gabc/
 3728     abc
 3729     *** Failers
 3730     xyzabc  
 3731 
 3732 /\Gabc./g
 3733     abc1abc2xyzabc3
 3734 
 3735 /abc./g
 3736     abc1abc2xyzabc3 
 3737 
 3738 /a(?x: b c )d/
 3739     XabcdY
 3740     *** Failers 
 3741     Xa b c d Y 
 3742 
 3743 /((?x)x y z | a b c)/
 3744     XabcY
 3745     AxyzB 
 3746 
 3747 /(?i)AB(?-i)C/
 3748     XabCY
 3749     *** Failers
 3750     XabcY  
 3751 
 3752 /((?i)AB(?-i)C|D)E/
 3753     abCE
 3754     DE
 3755     *** Failers
 3756     abcE
 3757     abCe  
 3758     dE
 3759     De    
 3760 
 3761 /(.*)\d+\1/
 3762     abc123abc
 3763     abc123bc 
 3764 
 3765 /(.*)\d+\1/s
 3766     abc123abc
 3767     abc123bc 
 3768     
 3769 /((.*))\d+\1/
 3770     abc123abc
 3771     abc123bc  
 3772 
 3773 # This tests for an IPv6 address in the form where it can have up to
 3774 # eight components, one and only one of which is empty. This must be
 3775 # an internal component. 
 3776 
 3777 /^(?!:)                       # colon disallowed at start
 3778   (?:                         # start of item
 3779     (?: [0-9a-f]{1,4} |       # 1-4 hex digits or
 3780     (?(1)0 | () ) )           # if null previously matched, fail; else null
 3781     :                         # followed by colon
 3782   ){1,7}                      # end item; 1-7 of them required               
 3783   [0-9a-f]{1,4} $             # final hex number at end of string
 3784   (?(1)|.)                    # check that there was an empty component
 3785   /ix
 3786     a123::a123
 3787     a123:b342::abcd
 3788     a123:b342::324e:abcd
 3789     a123:ddde:b342::324e:abcd
 3790     a123:ddde:b342::324e:dcba:abcd
 3791     a123:ddde:9999:b342::324e:dcba:abcd
 3792     *** Failers
 3793     1:2:3:4:5:6:7:8
 3794     a123:bce:ddde:9999:b342::324e:dcba:abcd
 3795     a123::9999:b342::324e:dcba:abcd
 3796     abcde:2:3:4:5:6:7:8
 3797     ::1
 3798     abcd:fee0:123::   
 3799     :1
 3800     1:  
 3801 
 3802 /[z\Qa-d]\E]/
 3803     z
 3804     a
 3805     -
 3806     d
 3807     ] 
 3808     *** Failers
 3809     b     
 3810 
 3811 /(a+)*b/
 3812     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 
 3813     
 3814 /(?i)reg(?:ul(?:[a]|ae)r|ex)/
 3815     REGular
 3816     regulaer
 3817     Regex  
 3818     regulr 
 3819 
 3820 /[--]+/
 3821     
 3822     
 3823     
 3824     
 3825 
 3826 /(?<=Z)X./
 3827   \x84XAZXB
 3828 
 3829 /ab cd (?x) de fg/
 3830     ab cd defg
 3831 
 3832 /ab cd(?x) de fg/
 3833     ab cddefg
 3834     ** Failers 
 3835     abcddefg
 3836 
 3837 /(?<![^f]oo)(bar)/
 3838     foobarX 
 3839     ** Failers 
 3840     boobarX
 3841 
 3842 /(?<![^f])X/
 3843     offX
 3844     ** Failers
 3845     onyX  
 3846 
 3847 /(?<=[^f])X/
 3848     onyX
 3849     ** Failers
 3850     offX 
 3851 
 3852 /^/gm
 3853     a\nb\nc\n
 3854     \ 
 3855     
 3856 /(?<=C\n)^/gm
 3857     A\nC\nC\n 
 3858 
 3859 /(?:(?(1)a|b)(X))+/
 3860     bXaX
 3861 
 3862 /(?:(?(1)\1a|b)(X|Y))+/
 3863     bXXaYYaY
 3864     bXYaXXaX  
 3865 
 3866 /()()()()()()()()()(?:(?(10)\10a|b)(X|Y))+/
 3867     bXXaYYaY
 3868 
 3869 /[[,abc,]+]/
 3870     abc]
 3871     a,b]
 3872     [a,b,c]  
 3873 
 3874 /(?-x: )/x
 3875     A\x20B
 3876     
 3877 "(?x)(?-x: \s*#\s*)"
 3878     A # B
 3879     ** Failers
 3880     #  
 3881 
 3882 "(?x-is)(?:(?-ixs) \s*#\s*) include"
 3883     A #include
 3884     ** Failers
 3885     A#include  
 3886     A #Include
 3887 
 3888 /a*b*\w/
 3889     aaabbbb
 3890     aaaa
 3891     a
 3892 
 3893 /a*b?\w/
 3894     aaabbbb
 3895     aaaa
 3896     a
 3897 
 3898 /a*b{0,4}\w/
 3899     aaabbbb
 3900     aaaa
 3901     a
 3902 
 3903 /a*b{0,}\w/
 3904     aaabbbb
 3905     aaaa
 3906     a
 3907     
 3908 /a*\d*\w/
 3909     0a
 3910     a 
 3911     
 3912 /a*b *\w/x
 3913     a 
 3914 
 3915 /a*b#comment
 3916   *\w/x
 3917     a 
 3918 
 3919 /a* b *\w/x
 3920     a 
 3921 
 3922 /^\w+=.*(\\\n.*)*/
 3923     abc=xyz\\\npqr
 3924 
 3925 /(?=(\w+))\1:/
 3926     abcd:
 3927 
 3928 /^(?=(\w+))\1:/
 3929     abcd:
 3930 
 3931 /^\Eabc/
 3932     abc
 3933     
 3934 /^[\Eabc]/
 3935     a
 3936     ** Failers 
 3937     E 
 3938     
 3939 /^[a-\Ec]/
 3940     b
 3941     ** Failers
 3942     -
 3943     E    
 3944 
 3945 /^[a\E\E-\Ec]/
 3946     b
 3947     ** Failers
 3948     -
 3949     E    
 3950 
 3951 /^[\E\Qa\E-\Qz\E]+/
 3952     b
 3953     ** Failers
 3954     -  
 3955     
 3956 /^[a\Q]bc\E]/
 3957     a
 3958     ]
 3959     c
 3960     
 3961 /^[a-\Q\E]/
 3962     a
 3963     -     
 3964 
 3965 /^(a()*)*/
 3966     aaaa
 3967 
 3968 /^(?:a(?:(?:))*)*/
 3969     aaaa
 3970 
 3971 /^(a()+)+/
 3972     aaaa
 3973 
 3974 /^(?:a(?:(?:))+)+/
 3975     aaaa
 3976 
 3977 /(a){0,3}(?(1)b|(c|))*D/
 3978     abbD
 3979     ccccD
 3980     D  
 3981 
 3982 /(a|)*\d/
 3983   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 3984   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
 3985 
 3986 /(?>a|)*\d/
 3987   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 3988   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
 3989 
 3990 /(?:a|)*\d/
 3991   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 3992   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
 3993 
 3994 /\Z/g
 3995   abc\n
 3996   
 3997 /^(?s)(?>.*)(?<!\n)/
 3998   abc
 3999   abc\n  
 4000 
 4001 /^(?![^\n]*\n\z)/
 4002   abc
 4003   abc\n 
 4004   
 4005 /\z(?<!\n)/
 4006   abc
 4007   abc\n  
 4008 
 4009 /(.*(.)?)*/
 4010     abcd
 4011 
 4012 /( (A | (?(1)0|) )*   )/x
 4013     abcd
 4014 
 4015 /( ( (?(1)0|) )*   )/x
 4016     abcd
 4017 
 4018 /(  (?(1)0|)*   )/x
 4019     abcd
 4020 
 4021 /[[:abcd:xyz]]/
 4022     a]
 4023     :] 
 4024     
 4025 /[abc[:x\]pqr]/
 4026     a
 4027     [
 4028     :
 4029     ]
 4030     p    
 4031 
 4032 /.*[op][xyz]/
 4033     fooabcfoo
 4034 
 4035 /(?(?=.*b)b|^)/
 4036    adc
 4037    abc 
 4038 
 4039 /(?(?=^.*b)b|^)/
 4040    adc
 4041    abc 
 4042 
 4043 /(?(?=.*b)b|^)*/
 4044    adc
 4045    abc 
 4046 
 4047 /(?(?=.*b)b|^)+/
 4048    adc
 4049    abc 
 4050 
 4051 /(?(?=b).*b|^d)/
 4052     abc
 4053 
 4054 /(?(?=.*b).*b|^d)/
 4055     abc
 4056 
 4057 /^%((?(?=[a])[^%])|b)*%$/
 4058     %ab%
 4059 
 4060 /(?i)a(?-i)b|c/
 4061     XabX
 4062     XAbX
 4063     CcC 
 4064     ** Failers
 4065     XABX   
 4066 
 4067 /[\x00-\xff\s]+/
 4068     \x0a\x0b\x0c\x0d
 4069 
 4070 /(abc)\1/i
 4071    abc
 4072 
 4073 /(abc)\1/
 4074    abc
 4075 
 4076 /[^a]*/i
 4077     12abc
 4078     12ABC
 4079 
 4080 /[^a]*+/i
 4081     12abc
 4082     12ABC
 4083 
 4084 /[^a]*?X/i
 4085     ** Failers
 4086     12abc
 4087     12ABC
 4088     
 4089 /[^a]+?X/i
 4090     ** Failers
 4091     12abc
 4092     12ABC
 4093 
 4094 /[^a]?X/i
 4095     12aXbcX
 4096     12AXBCX
 4097     BCX 
 4098 
 4099 /[^a]??X/i
 4100     12aXbcX
 4101     12AXBCX
 4102     BCX
 4103     
 4104 /[^a]?+X/i
 4105     12aXbcX
 4106     12AXBCX
 4107     BCX 
 4108 
 4109 /[^a]{2,3}/i
 4110     abcdef
 4111     ABCDEF  
 4112 
 4113 /[^a]{2,3}?/i
 4114     abcdef
 4115     ABCDEF  
 4116 
 4117 /[^a]{2,3}+/i
 4118     abcdef
 4119     ABCDEF  
 4120 
 4121 /((a|)+)+Z/
 4122     Z
 4123 
 4124 /(a)b|(a)c/
 4125     ac
 4126 
 4127 /(?>(a))b|(a)c/
 4128     ac
 4129 
 4130 /(?=(a))ab|(a)c/
 4131     ac
 4132 
 4133 /((?>(a))b|(a)c)/
 4134     ac
 4135 
 4136 /((?>(a))b|(a)c)++/
 4137     ac
 4138 
 4139 /(?:(?>(a))b|(a)c)++/
 4140     ac
 4141 
 4142 /(?=(?>(a))b|(a)c)(..)/
 4143     ac
 4144 
 4145 /(?>(?>(a))b|(a)c)/
 4146     ac
 4147 
 4148 /(?:(?>([ab])))+a=/aftertext
 4149     =ba=
 4150 
 4151 /(?>([ab]))+a=/aftertext
 4152     =ba=
 4153 
 4154 /((?>(a+)b)+(aabab))/
 4155     aaaabaaabaabab
 4156 
 4157 /(?>a+|ab)+?c/
 4158     aabc
 4159 
 4160 /(?>a+|ab)+c/
 4161     aabc
 4162 
 4163 /(?:a+|ab)+c/
 4164     aabc
 4165 
 4166 /(?(?=(a))a)/
 4167     a
 4168 
 4169 /(?(?=(a))a)(b)/
 4170     ab
 4171 
 4172 /^(?:a|ab)++c/
 4173     aaaabc
 4174 
 4175 /^(?>a|ab)++c/
 4176     aaaabc
 4177 
 4178 /^(?:a|ab)+c/
 4179     aaaabc
 4180 
 4181 /(?=abc){3}abc/aftertext
 4182     abcabcabc
 4183     ** Failers
 4184     xyz  
 4185     
 4186 /(?=abc)+abc/aftertext
 4187     abcabcabc
 4188     ** Failers
 4189     xyz  
 4190     
 4191 /(?=abc)++abc/aftertext
 4192     abcabcabc
 4193     ** Failers
 4194     xyz  
 4195     
 4196 /(?=abc){0}xyz/
 4197     xyz 
 4198 
 4199 /(?=abc){1}xyz/
 4200     ** Failers
 4201     xyz 
 4202     
 4203 /(?=(a))?./
 4204     ab
 4205     bc
 4206       
 4207 /(?=(a))??./
 4208     ab
 4209     bc
 4210 
 4211 /^(?=(?1))?[az]([abc])d/
 4212     abd 
 4213     zcdxx 
 4214 
 4215 /^(?!a){0}\w+/
 4216     aaaaa
 4217 
 4218 /(?<=(abc))?xyz/
 4219     abcxyz
 4220     pqrxyz 
 4221 
 4222 /^[\g<a>]+/
 4223     ggg<<<aaa>>>
 4224     ** Failers
 4225     \\ga  
 4226     
 4227 /^[\ga]+/
 4228     gggagagaxyz 
 4229     
 4230 /^[:a[:digit:]]+/
 4231     aaaa444:::Z 
 4232 
 4233 /^[:a[:digit:]:b]+/
 4234     aaaa444:::bbbZ 
 4235 
 4236 /[:a]xxx[b:]/
 4237      :xxx:
 4238      
 4239 /(?<=a{2})b/i
 4240     xaabc
 4241     ** Failers
 4242     xabc  
 4243 
 4244 /(?<!a{2})b/i
 4245     xabc
 4246     ** Failers
 4247     xaabc  
 4248 
 4249 /(?<=a\h)c/
 4250     xa c
 4251     
 4252 /(?<=[^a]{2})b/
 4253     axxbc
 4254     aAAbc 
 4255     ** Failers
 4256     xaabc    
 4257 
 4258 /(?<=[^a]{2})b/i
 4259     axxbc  
 4260     ** Failers
 4261     aAAbc 
 4262     xaabc    
 4263 
 4264 /(?<=a\H)c/
 4265     abc
 4266 
 4267 /(?<=a\V)c/
 4268     abc
 4269     
 4270 /(?<=a\v)c/
 4271     a\nc
 4272 
 4273 /(?(?=c)c|d)++Y/
 4274     XcccddYX
 4275 
 4276 /(?(?=c)c|d)*+Y/
 4277     XcccddYX
 4278 
 4279 /^(a{2,3}){2,}+a/
 4280     aaaaaaa
 4281     ** Failers
 4282     aaaaaa
 4283     aaaaaaaaa 
 4284 
 4285 /^(a{2,3})++a/
 4286     ** Failers
 4287     aaaaaa
 4288 
 4289 /^(a{2,3})*+a/
 4290     ** Failers
 4291     aaaaaa
 4292 
 4293 /ab\Cde/
 4294     abXde
 4295     
 4296 /(?<=ab\Cde)X/
 4297     abZdeX
 4298 
 4299 /\H\h\V\v/
 4300     X X\x0a
 4301     X\x09X\x0b
 4302     ** Failers
 4303     \xa0 X\x0a   
 4304     
 4305 /\H*\h+\V?\v{3,4}/
 4306     \x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a
 4307     \x09\x20\xa0\x0a\x0b\x0c\x0d\x0a
 4308     \x09\x20\xa0\x0a\x0b\x0c
 4309     ** Failers 
 4310     \x09\x20\xa0\x0a\x0b
 4311      
 4312 /\H{3,4}/
 4313     XY  ABCDE
 4314     XY  PQR ST 
 4315     
 4316 /.\h{3,4}./
 4317     XY  AB    PQRS
 4318 
 4319 /\h*X\h?\H+Y\H?Z/
 4320     >XNNNYZ
 4321     >  X NYQZ
 4322     ** Failers
 4323     >XYZ   
 4324     >  X NY Z
 4325 
 4326 /\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/
 4327     >XY\x0aZ\x0aA\x0bNN\x0c
 4328     >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c
 4329 
 4330 /(foo)\Kbar/
 4331     foobar
 4332    
 4333 /(foo)(\Kbar|baz)/
 4334     foobar
 4335     foobaz 
 4336 
 4337 /(foo\Kbar)baz/
 4338     foobarbaz
 4339 
 4340 /abc\K|def\K/g,aftertext
 4341     Xabcdefghi
 4342 
 4343 /ab\Kc|de\Kf/g,aftertext
 4344     Xabcdefghi
 4345     
 4346 /(?=C)/g,aftertext
 4347     ABCDECBA
 4348     
 4349 /^abc\K/aftertext
 4350     abcdef
 4351     ** Failers
 4352     defabcxyz   
 4353 
 4354 /^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/
 4355     ababababbbabZXXXX
 4356 
 4357 /(?<A>tom|bon)-\g{A}/
 4358     tom-tom
 4359     bon-bon 
 4360     
 4361 /(^(a|b\g{-1}))/
 4362     bacxxx
 4363 
 4364 /(?|(abc)|(xyz))\1/
 4365     abcabc
 4366     xyzxyz 
 4367     ** Failers
 4368     abcxyz
 4369     xyzabc   
 4370     
 4371 /(?|(abc)|(xyz))(?1)/
 4372     abcabc
 4373     xyzabc 
 4374     ** Failers 
 4375     xyzxyz 
 4376  
 4377 /^X(?5)(a)(?|(b)|(q))(c)(d)(Y)/
 4378     XYabcdY
 4379 
 4380 /^X(?7)(a)(?|(b|(r)(s))|(q))(c)(d)(Y)/
 4381     XYabcdY
 4382 
 4383 /^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)/
 4384     XYabcdY
 4385 
 4386 /(?'abc'\w+):\k<abc>{2}/
 4387     a:aaxyz
 4388     ab:ababxyz
 4389     ** Failers
 4390     a:axyz
 4391     ab:abxyz
 4392 
 4393 /(?'abc'\w+):\g{abc}{2}/
 4394     a:aaxyz
 4395     ab:ababxyz
 4396     ** Failers
 4397     a:axyz
 4398     ab:abxyz
 4399 
 4400 /^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)/x
 4401     abd
 4402     ce
 4403 
 4404 /^(a.)\g-1Z/
 4405     aXaXZ
 4406 
 4407 /^(a.)\g{-1}Z/
 4408     aXaXZ
 4409 
 4410 /^(?(DEFINE) (?<A> a) (?<B> b) )  (?&A) (?&B) /x
 4411     abcd
 4412 
 4413 /(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT))
 4414   (?(DEFINE)
 4415   (?<NAME_PAT>[a-z]+)
 4416   (?<ADDRESS_PAT>\d+)
 4417   )/x
 4418     metcalfe 33
 4419 
 4420 /(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))\b(?&byte)(\.(?&byte)){3}/
 4421     1.2.3.4
 4422     131.111.10.206
 4423     10.0.0.0
 4424     ** Failers
 4425     10.6
 4426     455.3.4.5
 4427 
 4428 /\b(?&byte)(\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))/
 4429     1.2.3.4
 4430     131.111.10.206
 4431     10.0.0.0
 4432     ** Failers
 4433     10.6
 4434     455.3.4.5
 4435 
 4436 /^(\w++|\s++)*$/
 4437     now is the time for all good men to come to the aid of the party
 4438     *** Failers
 4439     this is not a line with only words and spaces!
 4440 
 4441 /(\d++)(\w)/
 4442     12345a
 4443     *** Failers
 4444     12345+
 4445 
 4446 /a++b/
 4447     aaab
 4448 
 4449 /(a++b)/
 4450     aaab
 4451 
 4452 /(a++)b/
 4453     aaab
 4454 
 4455 /([^()]++|\([^()]*\))+/
 4456     ((abc(ade)ufh()()x
 4457 
 4458 /\(([^()]++|\([^()]+\))+\)/
 4459     (abc)
 4460     (abc(def)xyz)
 4461     *** Failers
 4462     ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 4463 
 4464 /^([^()]|\((?1)*\))*$/
 4465     abc
 4466     a(b)c
 4467     a(b(c))d
 4468     *** Failers)
 4469     a(b(c)d
 4470 
 4471 /^>abc>([^()]|\((?1)*\))*<xyz<$/
 4472    >abc>123<xyz<
 4473    >abc>1(2)3<xyz<
 4474    >abc>(1(2)3)<xyz<
 4475 
 4476 /^(?:((.)(?1)\2|)|((.)(?3)\4|.))$/i
 4477     1221
 4478     Satanoscillatemymetallicsonatas
 4479     AmanaplanacanalPanama
 4480     AblewasIereIsawElba
 4481     *** Failers
 4482     Thequickbrownfox
 4483 
 4484 /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/
 4485     12
 4486     (((2+2)*-3)-7)
 4487     -12
 4488     *** Failers
 4489     ((2+2)*-3)-7)
 4490 
 4491 /^(x(y|(?1){2})z)/
 4492     xyz
 4493     xxyzxyzz
 4494     *** Failers
 4495     xxyzz
 4496     xxyzxyzxyzz
 4497 
 4498 /((< (?: (?(R) \d++  | [^<>]*+) | (?2)) * >))/x
 4499     <>
 4500     <abcd>
 4501     <abc <123> hij>
 4502     <abc <def> hij>
 4503     <abc<>def>
 4504     <abc<>
 4505     *** Failers
 4506     <abc
 4507 
 4508 /^a+(*FAIL)/
 4509     aaaaaa
 4510     
 4511 /a+b?c+(*FAIL)/
 4512     aaabccc
 4513 
 4514 /a+b?(*PRUNE)c+(*FAIL)/
 4515     aaabccc
 4516 
 4517 /a+b?(*COMMIT)c+(*FAIL)/
 4518     aaabccc
 4519     
 4520 /a+b?(*SKIP)c+(*FAIL)/
 4521     aaabcccaaabccc
 4522 
 4523 /^(?:aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/
 4524     aaaxxxxxx
 4525     aaa++++++ 
 4526     bbbxxxxx
 4527     bbb+++++ 
 4528     cccxxxx
 4529     ccc++++ 
 4530     dddddddd   
 4531 
 4532 /^(aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/
 4533     aaaxxxxxx
 4534     aaa++++++ 
 4535     bbbxxxxx
 4536     bbb+++++ 
 4537     cccxxxx
 4538     ccc++++ 
 4539     dddddddd   
 4540 
 4541 /a+b?(*THEN)c+(*FAIL)/
 4542     aaabccc
 4543 
 4544 /(A (A|B(*ACCEPT)|C) D)(E)/x
 4545     AB
 4546     ABX
 4547     AADE
 4548     ACDE
 4549     ** Failers
 4550     AD 
 4551         
 4552 /^\W*+(?:((.)\W*+(?1)\W*+\2|)|((.)\W*+(?3)\W*+\4|\W*+.\W*+))\W*+$/i
 4553     1221
 4554     Satan, oscillate my metallic sonatas!
 4555     A man, a plan, a canal: Panama!
 4556     Able was I ere I saw Elba.
 4557     *** Failers
 4558     The quick brown fox
 4559 
 4560 /^((.)(?1)\2|.)$/
 4561     a
 4562     aba
 4563     aabaa  
 4564     abcdcba 
 4565     pqaabaaqp  
 4566     ablewasiereisawelba
 4567     rhubarb
 4568     the quick brown fox  
 4569 
 4570 /(a)(?<=b(?1))/
 4571     baz
 4572     ** Failers
 4573     caz  
 4574     
 4575 /(?<=b(?1))(a)/
 4576     zbaaz
 4577     ** Failers
 4578     aaa  
 4579     
 4580 /(?<X>a)(?<=b(?&X))/
 4581     baz
 4582 
 4583 /^(?|(abc)|(def))\1/
 4584     abcabc
 4585     defdef 
 4586     ** Failers
 4587     abcdef
 4588     defabc   
 4589     
 4590 /^(?|(abc)|(def))(?1)/
 4591     abcabc
 4592     defabc
 4593     ** Failers
 4594     defdef
 4595     abcdef    
 4596 
 4597 /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |b(?<quote> (?<apostrophe>')|(?<realquote>")) ) (?('quote')[a-z]+|[0-9]+)/x,dupnames
 4598     a\"aaaaa
 4599     b\"aaaaa 
 4600     ** Failers 
 4601     b\"11111
 4602 
 4603 /(?:(?1)|B)(A(*F)|C)/
 4604     ABCD
 4605     CCD
 4606     ** Failers
 4607     CAD   
 4608 
 4609 /^(?:(?1)|B)(A(*F)|C)/
 4610     CCD
 4611     BCD 
 4612     ** Failers
 4613     ABCD
 4614     CAD
 4615     BAD    
 4616 
 4617 /(?:(?1)|B)(A(*ACCEPT)XX|C)D/
 4618     AAD
 4619     ACD
 4620     BAD
 4621     BCD
 4622     BAX  
 4623     ** Failers
 4624     ACX
 4625     ABC   
 4626 
 4627 /(?(DEFINE)(A))B(?1)C/
 4628     BAC
 4629 
 4630 /(?(DEFINE)((A)\2))B(?1)C/
 4631     BAAC
 4632 
 4633 /(?<pn> \( ( [^()]++ | (?&pn) )* \) )/x
 4634     (ab(cd)ef)
 4635 
 4636 /^(?=a(*SKIP)b|ac)/
 4637     ** Failers
 4638     ac
 4639     
 4640 /^(?=a(*PRUNE)b)/
 4641     ab  
 4642     ** Failers 
 4643     ac
 4644 
 4645 /^(?=a(*ACCEPT)b)/
 4646     ac
 4647 
 4648 /(?>a\Kb)/
 4649     ab
 4650 
 4651 /((?>a\Kb))/
 4652     ab
 4653 
 4654 /(a\Kb)/
 4655     ab
 4656     
 4657 /^a\Kcz|ac/
 4658     ac
 4659     
 4660 /(?>a\Kbz|ab)/
 4661     ab 
 4662 
 4663 /^(?&t)(?(DEFINE)(?<t>a\Kb))$/
 4664     ab
 4665 
 4666 /^([^()]|\((?1)*\))*$/
 4667     a(b)c
 4668     a(b(c)d)e 
 4669 
 4670 /(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))/
 4671     0
 4672     00
 4673     0000  
 4674 
 4675 /(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))/
 4676     0
 4677     00
 4678     0000  
 4679 
 4680 # This one does fail, as expected, in Perl. It needs the complex item at the
 4681 # end of the pattern. A single letter instead of (B|D) makes it not fail, which
 4682 # I think is a Perl bug.
 4683 
 4684 /A(*COMMIT)(B|D)/
 4685     ACABX
 4686 
 4687 # Check the use of names for failure
 4688 
 4689 /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/mark
 4690     ** Failers
 4691     AC
 4692     CB    
 4693     
 4694 /(*MARK:A)(*SKIP:B)(C|X)/mark
 4695     C
 4696     D
 4697      
 4698 /^(A(*THEN:A)B|C(*THEN:B)D)/mark
 4699     ** Failers
 4700     CB    
 4701 
 4702 /^(?:A(*THEN:A)B|C(*THEN:B)D)/mark
 4703     CB    
 4704     
 4705 /^(?>A(*THEN:A)B|C(*THEN:B)D)/mark
 4706     CB    
 4707     
 4708 # This should succeed, as the skip causes bump to offset 1 (the mark). Note
 4709 # that we have to have something complicated such as (B|Z) at the end because,
 4710 # for Perl, a simple character somehow causes an unwanted optimization to mess
 4711 # with the handling of backtracking verbs.
 4712 
 4713 /A(*MARK:A)A+(*SKIP:A)(B|Z) | AC/x,mark
 4714     AAAC
 4715     
 4716 # Test skipping over a non-matching mark.
 4717 
 4718 /A(*MARK:A)A+(*MARK:B)(*SKIP:A)(B|Z) | AC/x,mark
 4719     AAAC
 4720     
 4721 # Check shorthand for MARK.
 4722 
 4723 /A(*:A)A+(*SKIP:A)(B|Z) | AC/x,mark
 4724     AAAC
 4725 
 4726 /(*:A)A+(*SKIP:A)(B|Z)/mark
 4727     AAAC
 4728 
 4729 # This should succeed, as a non-existent skip name disables the skip.
 4730 
 4731 /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/x,mark
 4732     AAAC
 4733 
 4734 /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC(*:B)/x,mark
 4735     AAAC
 4736 
 4737 # COMMIT at the start of a pattern should act like an anchor. Again, however,
 4738 # we need the complication for Perl.
 4739 
 4740 /(*COMMIT)(A|P)(B|P)(C|P)/
 4741     ABCDEFG
 4742     ** Failers
 4743     DEFGABC  
 4744 
 4745 # COMMIT inside an atomic group can't stop backtracking over the group.
 4746 
 4747 /(\w+)(?>b(*COMMIT))\w{2}/
 4748     abbb
 4749 
 4750 /(\w+)b(*COMMIT)\w{2}/
 4751     abbb
 4752 
 4753 # Check opening parens in comment when seeking forward reference.
 4754 
 4755 /(?&t)(?#()(?(DEFINE)(?<t>a))/
 4756     bac
 4757 
 4758 # COMMIT should override THEN.
 4759 
 4760 /(?>(*COMMIT)(?>yes|no)(*THEN)(*F))?/
 4761   yes
 4762 
 4763 /(?>(*COMMIT)(yes|no)(*THEN)(*F))?/
 4764   yes
 4765 
 4766 /b?(*SKIP)c/
 4767     bc
 4768     abc
 4769    
 4770 /(*SKIP)bc/
 4771     a
 4772 
 4773 /(*SKIP)b/
 4774     a 
 4775 
 4776 /(?P<abn>(?P=abn)xxx|)+/
 4777     xxx
 4778 
 4779 /(?i:([^b]))(?1)/
 4780     aa
 4781     aA     
 4782     ** Failers
 4783     ab
 4784     aB
 4785     Ba
 4786     ba
 4787 
 4788 /^(?&t)*+(?(DEFINE)(?<t>a))\w$/
 4789     aaaaaaX
 4790     ** Failers 
 4791     aaaaaa 
 4792 
 4793 /^(?&t)*(?(DEFINE)(?<t>a))\w$/
 4794     aaaaaaX
 4795     aaaaaa 
 4796 
 4797 /^(a)*+(\w)/
 4798     aaaaX
 4799     YZ 
 4800     ** Failers 
 4801     aaaa
 4802 
 4803 /^(?:a)*+(\w)/
 4804     aaaaX
 4805     YZ 
 4806     ** Failers 
 4807     aaaa
 4808 
 4809 /^(a)++(\w)/
 4810     aaaaX
 4811     ** Failers 
 4812     aaaa
 4813     YZ 
 4814 
 4815 /^(?:a)++(\w)/
 4816     aaaaX
 4817     ** Failers 
 4818     aaaa
 4819     YZ 
 4820 
 4821 /^(a)?+(\w)/
 4822     aaaaX
 4823     YZ 
 4824 
 4825 /^(?:a)?+(\w)/
 4826     aaaaX
 4827     YZ 
 4828 
 4829 /^(a){2,}+(\w)/
 4830     aaaaX
 4831     ** Failers
 4832     aaa
 4833     YZ 
 4834 
 4835 /^(?:a){2,}+(\w)/
 4836     aaaaX
 4837     ** Failers
 4838     aaa
 4839     YZ 
 4840 
 4841 /(a|)*(?1)b/
 4842     b
 4843     ab
 4844     aab  
 4845 
 4846 /(a)++(?1)b/
 4847     ** Failers
 4848     ab 
 4849     aab
 4850 
 4851 /(a)*+(?1)b/
 4852     ** Failers
 4853     ab
 4854     aab  
 4855 
 4856 /(?1)(?:(b)){0}/
 4857     b
 4858 
 4859 /(foo ( \( ((?:(?> [^()]+ )|(?2))*) \) ) )/x
 4860     foo(bar(baz)+baz(bop))
 4861 
 4862 /(A (A|B(*ACCEPT)|C) D)(E)/x
 4863     AB
 4864 
 4865 /\A.*?(a|bc)/
 4866     ba
 4867 
 4868 /\A.*?(?:a|bc)++/
 4869     ba
 4870 
 4871 /\A.*?(a|bc)++/
 4872     ba
 4873 
 4874 /\A.*?(?:a|bc|d)/
 4875     ba
 4876 
 4877 /(?:(b))++/
 4878     beetle
 4879 
 4880 /(?(?=(a(*ACCEPT)z))a)/
 4881     a
 4882 
 4883 /^(a)(?1)+ab/
 4884     aaaab
 4885     
 4886 /^(a)(?1)++ab/
 4887     aaaab
 4888 
 4889 /^(?=a(*:M))aZ/mark
 4890     aZbc
 4891 
 4892 /^(?!(*:M)b)aZ/mark
 4893     aZbc
 4894 
 4895 /(?(DEFINE)(a))?b(?1)/
 4896     backgammon
 4897 
 4898 /^\N+/
 4899     abc\ndef
 4900     
 4901 /^\N{1,}/
 4902     abc\ndef 
 4903 
 4904 /(?(R)a+|(?R)b)/
 4905     aaaabcde
 4906 
 4907 /(?(R)a+|((?R))b)/
 4908     aaaabcde
 4909 
 4910 /((?(R)a+|(?1)b))/
 4911     aaaabcde
 4912 
 4913 /((?(R1)a+|(?1)b))/
 4914     aaaabcde
 4915     
 4916 /((?(R)a|(?1)))*/
 4917     aaa
 4918 
 4919 /((?(R)a|(?1)))+/
 4920     aaa 
 4921 
 4922 /a(*:any 
 4923 name)/mark
 4924     abc
 4925     
 4926 /(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))/
 4927     a
 4928     ba
 4929     bba 
 4930     
 4931 # Checking revised (*THEN) handling.
 4932 
 4933 # Capture
 4934 
 4935 /^.*? (a(*THEN)b) c/x
 4936     aabc
 4937 
 4938 /^.*? (a(*THEN)b|(*F)) c/x
 4939     aabc
 4940 
 4941 /^.*? ( (a(*THEN)b) | (*F) ) c/x
 4942     aabc
 4943 
 4944 /^.*? ( (a(*THEN)b) ) c/x
 4945     aabc
 4946 
 4947 # Non-capture
 4948 
 4949 /^.*? (?:a(*THEN)b) c/x
 4950     aabc
 4951 
 4952 /^.*? (?:a(*THEN)b|(*F)) c/x
 4953     aabc
 4954 
 4955 /^.*? (?: (?:a(*THEN)b) | (*F) ) c/x
 4956     aabc
 4957 
 4958 /^.*? (?: (?:a(*THEN)b) ) c/x
 4959     aabc
 4960 
 4961 # Atomic
 4962 
 4963 /^.*? (?>a(*THEN)b) c/x
 4964     aabc
 4965 
 4966 /^.*? (?>a(*THEN)b|(*F)) c/x
 4967     aabc
 4968 
 4969 /^.*? (?> (?>a(*THEN)b) | (*F) ) c/x
 4970     aabc
 4971 
 4972 /^.*? (?> (?>a(*THEN)b) ) c/x
 4973     aabc
 4974 
 4975 # Possessive capture
 4976 
 4977 /^.*? (a(*THEN)b)++ c/x
 4978     aabc
 4979 
 4980 /^.*? (a(*THEN)b|(*F))++ c/x
 4981     aabc
 4982 
 4983 /^.*? ( (a(*THEN)b)++ | (*F) )++ c/x
 4984     aabc
 4985 
 4986 /^.*? ( (a(*THEN)b)++ )++ c/x
 4987     aabc
 4988 
 4989 # Possessive non-capture
 4990 
 4991 /^.*? (?:a(*THEN)b)++ c/x
 4992     aabc
 4993 
 4994 /^.*? (?:a(*THEN)b|(*F))++ c/x
 4995     aabc
 4996 
 4997 /^.*? (?: (?:a(*THEN)b)++ | (*F) )++ c/x
 4998     aabc
 4999 
 5000 /^.*? (?: (?:a(*THEN)b)++ )++ c/x
 5001     aabc
 5002     
 5003 # Condition assertion
 5004 
 5005 /^(?(?=a(*THEN)b)ab|ac)/
 5006     ac
 5007  
 5008 # Condition
 5009 
 5010 /^.*?(?(?=a)a|b(*THEN)c)/
 5011     ba
 5012 
 5013 /^.*?(?:(?(?=a)a|b(*THEN)c)|d)/
 5014     ba
 5015 
 5016 /^.*?(?(?=a)a(*THEN)b|c)/
 5017     ac
 5018 
 5019 # Assertion
 5020 
 5021 /^.*(?=a(*THEN)b)/
 5022     aabc
 5023 
 5024 # --------------------------
 5025 
 5026 /(?>a(*:m))/imsx,mark
 5027     a
 5028 
 5029 /(?>(a)(*:m))/imsx,mark
 5030     a
 5031 
 5032 /(?<=a(*ACCEPT)b)c/
 5033     xacd
 5034 
 5035 /(?<=(a(*ACCEPT)b))c/
 5036     xacd
 5037 
 5038 /(?<=(a(*COMMIT)b))c/
 5039     xabcd
 5040     ** Failers 
 5041     xacd
 5042     
 5043 /(?<!a(*FAIL)b)c/
 5044     xcd
 5045     acd 
 5046 
 5047 /(?<=a(*:N)b)c/mark
 5048     xabcd
 5049     
 5050 /(?<=a(*PRUNE)b)c/
 5051     xabcd 
 5052 
 5053 /(?<=a(*SKIP)b)c/
 5054     xabcd 
 5055 
 5056 /(?<=a(*THEN)b)c/
 5057     xabcd 
 5058 
 5059 /(a)(?2){2}(.)/
 5060     abcd
 5061 
 5062 /(*MARK:A)(*PRUNE:B)(C|X)/mark
 5063     C
 5064     D 
 5065 
 5066 /(*MARK:A)(*PRUNE:B)(C|X)/mark
 5067     C
 5068     D 
 5069 
 5070 /(*MARK:A)(*THEN:B)(C|X)/mark
 5071     C
 5072     D 
 5073 
 5074 /(*MARK:A)(*THEN:B)(C|X)/mark,no_start_optimize
 5075     C
 5076     D 
 5077 
 5078 /(*MARK:A)(*THEN:B)(C|X)/mark
 5079     C
 5080     D 
 5081 
 5082 # This should fail, as the skip causes a bump to offset 3 (the skip).
 5083 
 5084 /A(*MARK:A)A+(*SKIP)(B|Z) | AC/x,mark
 5085     AAAC
 5086 
 5087 # Same 
 5088 
 5089 /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/x,mark
 5090     AAAC
 5091 
 5092 /A(*:A)A+(*SKIP)(B|Z) | AC/x,mark
 5093     AAAC
 5094 
 5095 # This should fail, as a null name is the same as no name.
 5096 
 5097 /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/x,mark
 5098     AAAC
 5099 
 5100 # A check on what happens after hitting a mark and them bumping along to
 5101 # something that does not even start. Perl reports tags after the failures
 5102 # here, though it does not when the individual letters are made into something
 5103 # more complicated.
 5104 
 5105 /A(*:A)B|XX(*:B)Y/mark
 5106     AABC
 5107     XXYZ 
 5108     ** Failers
 5109     XAQQ  
 5110     XAQQXZZ  
 5111     AXQQQ 
 5112     AXXQQQ 
 5113     
 5114 /^(A(*THEN:A)B|C(*THEN:B)D)/mark
 5115     AB
 5116     CD
 5117     ** Failers
 5118     AC
 5119     CB    
 5120     
 5121 /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/mark
 5122     AB
 5123     CD
 5124     ** Failers
 5125     AC
 5126     CB    
 5127     
 5128 # An empty name does not pass back an empty string. It is the same as if no
 5129 # name were given.
 5130 
 5131 /^(A(*PRUNE:)B|C(*PRUNE:B)D)/mark
 5132     AB
 5133     CD 
 5134 
 5135 # PRUNE goes to next bumpalong; COMMIT does not.
 5136     
 5137 /A(*PRUNE:A)B/mark
 5138     ACAB
 5139 
 5140 # Mark names can be duplicated.
 5141 
 5142 /A(*:A)B|X(*:A)Y/mark
 5143     AABC
 5144     XXYZ 
 5145     
 5146 /b(*:m)f|a(*:n)w/mark
 5147     aw 
 5148     ** Failers 
 5149     abc
 5150 
 5151 /b(*:m)f|aw/mark
 5152     abaw
 5153     ** Failers 
 5154     abc
 5155     abax 
 5156 
 5157 /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/x,mark
 5158     AAAC
 5159 
 5160 /a(*PRUNE:X)bc|qq/mark,no_start_optimize
 5161     ** Failers
 5162     axy
 5163 
 5164 /a(*THEN:X)bc|qq/mark,no_start_optimize
 5165     ** Failers
 5166     axy
 5167 
 5168 /(?=a(*MARK:A)b)..x/mark
 5169     abxy
 5170     ** Failers
 5171     abpq  
 5172 
 5173 /(?=a(*MARK:A)b)..(*:Y)x/mark
 5174     abxy
 5175     ** Failers
 5176     abpq  
 5177 
 5178 /(?=a(*PRUNE:A)b)..x/mark
 5179     abxy
 5180     ** Failers
 5181     abpq  
 5182 
 5183 /(?=a(*PRUNE:A)b)..(*:Y)x/mark
 5184     abxy
 5185     ** Failers
 5186     abpq  
 5187 
 5188 /(?=a(*THEN:A)b)..x/mark
 5189     abxy
 5190     ** Failers
 5191     abpq  
 5192 
 5193 /(?=a(*THEN:A)b)..(*:Y)x/mark
 5194     abxy
 5195     ** Failers
 5196     abpq  
 5197 
 5198 /(another)?(\1?)test/
 5199     hello world test
 5200 
 5201 /(another)?(\1+)test/
 5202     hello world test
 5203 
 5204 /(a(*COMMIT)b){0}a(?1)|aac/
 5205     aac
 5206 
 5207 /((?:a?)*)*c/
 5208     aac   
 5209 
 5210 /((?>a?)*)*c/
 5211     aac   
 5212 
 5213 /(?>.*?a)(?<=ba)/
 5214     aba
 5215 
 5216 /(?:.*?a)(?<=ba)/
 5217     aba
 5218 
 5219 /.*?a(*PRUNE)b/
 5220     aab
 5221 
 5222 /.*?a(*PRUNE)b/s
 5223     aab
 5224 
 5225 /^a(*PRUNE)b/s
 5226     aab
 5227 
 5228 /.*?a(*SKIP)b/
 5229     aab
 5230 
 5231 /(?>.*?a)b/s
 5232     aab
 5233 
 5234 /(?>.*?a)b/
 5235     aab
 5236 
 5237 /(?>^a)b/s
 5238     aab
 5239 
 5240 /(?>.*?)(?<=(abcd)|(wxyz))/
 5241     alphabetabcd
 5242     endingwxyz 
 5243 
 5244 /(?>.*)(?<=(abcd)|(wxyz))/
 5245     alphabetabcd
 5246     endingwxyz 
 5247 
 5248 "(?>.*)foo"
 5249     abcdfooxyz
 5250     
 5251 "(?>.*?)foo"
 5252     abcdfooxyz
 5253 
 5254 /(?:(a(*PRUNE)b)){0}(?:(?1)|ac)/
 5255     ac
 5256     
 5257 /(?:(a(*SKIP)b)){0}(?:(?1)|ac)/
 5258     ac 
 5259 
 5260 /(?<=(*SKIP)ac)a/
 5261     aa
 5262 
 5263 /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/x,mark
 5264     AAAC
 5265 
 5266 /a(*SKIP:m)x|ac(*:n)(*SKIP:n)d|ac/mark
 5267     acacd
 5268 
 5269 /A(*SKIP:m)x|A(*SKIP:n)x|AB/mark
 5270     AB
 5271 
 5272 /((*SKIP:r)d){0}a(*SKIP:m)x|ac(*:n)|ac/mark
 5273     acacd
 5274 
 5275 # Tests that try to figure out how Perl works. My hypothesis is that the first
 5276 # verb that is backtracked onto is the one that acts. This seems to be the case
 5277 # almost all the time, but there is one exception that is perhaps a bug.
 5278 
 5279 # This matches "aaaac"; each PRUNE advances one character until the subject no
 5280 # longer starts with 5 'a's.
 5281 
 5282 /aaaaa(*PRUNE)b|a+c/
 5283     aaaaaac
 5284 
 5285 # Putting SKIP in front of PRUNE makes no difference, as it is never
 5286 # backtracked onto, whether or not it has a label.
 5287 
 5288 /aaaaa(*SKIP)(*PRUNE)b|a+c/
 5289     aaaaaac
 5290 
 5291 /aaaaa(*SKIP:N)(*PRUNE)b|a+c/
 5292     aaaaaac
 5293 
 5294 /aaaa(*:N)a(*SKIP:N)(*PRUNE)b|a+c/
 5295     aaaaaac
 5296 
 5297 # Putting THEN in front makes no difference.
 5298     
 5299 /aaaaa(*THEN)(*PRUNE)b|a+c/
 5300     aaaaaac
 5301  
 5302 # However, putting COMMIT in front of the prune changes it to "no match". I 
 5303 # think this is inconsistent and possibly a bug. For the moment, running this
 5304 # test is moved out of the Perl-compatible file. 
 5305 
 5306 /aaaaa(*COMMIT)(*PRUNE)b|a+c/
 5307     
 5308 # OK, lets play the same game again using SKIP instead of PRUNE.
 5309 
 5310 # This matches "ac" because SKIP forces the next match to start on the
 5311 # sixth "a". 
 5312 
 5313 /aaaaa(*SKIP)b|a+c/
 5314     aaaaaac
 5315  
 5316 # Putting PRUNE in front makes no difference. 
 5317 
 5318 /aaaaa(*PRUNE)(*SKIP)b|a+c/
 5319     aaaaaac
 5320 
 5321 # Putting THEN in front makes no difference. 
 5322 
 5323 /aaaaa(*THEN)(*SKIP)b|a+c/
 5324     aaaaaac
 5325 
 5326 # In this case, neither does COMMIT. This still matches "ac". 
 5327 
 5328 /aaaaa(*COMMIT)(*SKIP)b|a+c/
 5329     aaaaaac
 5330     
 5331 # This gives "no match", as expected. 
 5332 
 5333 /aaaaa(*COMMIT)b|a+c/
 5334     aaaaaac
 5335 
 5336 # ---- Tests using THEN ----
 5337 
 5338 # This matches "aaaaaac", as expected. 
 5339 
 5340 /aaaaa(*THEN)b|a+c/
 5341     aaaaaac
 5342 
 5343 # Putting SKIP in front makes no difference. 
 5344 
 5345 /aaaaa(*SKIP)(*THEN)b|a+c/
 5346     aaaaaac
 5347     
 5348 # Putting PRUNE in front makes no difference. 
 5349 
 5350 /aaaaa(*PRUNE)(*THEN)b|a+c/
 5351     aaaaaac
 5352     
 5353 # Putting COMMIT in front makes no difference. 
 5354 
 5355 /aaaaa(*COMMIT)(*THEN)b|a+c/
 5356     aaaaaac
 5357     
 5358 # End of "priority" tests  
 5359 
 5360 /aaaaa(*:m)(*PRUNE:m)(*SKIP:m)m|a+/
 5361     aaaaaa
 5362 
 5363 /aaaaa(*:m)(*MARK:m)(*PRUNE)(*SKIP:m)m|a+/
 5364     aaaaaa
 5365 
 5366 /aaaaa(*:n)(*PRUNE:m)(*SKIP:m)m|a+/
 5367     aaaaaa
 5368 
 5369 /aaaaa(*:n)(*MARK:m)(*PRUNE)(*SKIP:m)m|a+/
 5370     aaaaaa
 5371 
 5372 /a(*MARK:A)aa(*PRUNE:A)a(*SKIP:A)b|a+c/
 5373     aaaac
 5374 
 5375 /a(*MARK:A)aa(*MARK:A)a(*SKIP:A)b|a+c/
 5376     aaaac
 5377 
 5378 /aaa(*PRUNE:A)a(*SKIP:A)b|a+c/
 5379     aaaac
 5380 
 5381 /aaa(*MARK:A)a(*SKIP:A)b|a+c/
 5382     aaaac
 5383 
 5384 /a(*:m)a(*COMMIT)(*SKIP:m)b|a+c/mark
 5385     aaaaaac
 5386 
 5387 /.?(a|b(*THEN)c)/
 5388     ba
 5389 
 5390 /(a(*COMMIT)b)c|abd/
 5391     abc
 5392     abd
 5393 
 5394 /(?=a(*COMMIT)b)abc|abd/
 5395     abc
 5396     abd
 5397 
 5398 /(?>a(*COMMIT)b)c|abd/
 5399     abc
 5400     abd
 5401 
 5402 /a(?=b(*COMMIT)c)[^d]|abd/
 5403     abd
 5404     abc 
 5405 
 5406 /a(?=bc).|abd/
 5407     abd
 5408     abc 
 5409     
 5410 /a(?>b(*COMMIT)c)d|abd/
 5411     abceabd 
 5412 
 5413 /a(?>bc)d|abd/
 5414     abceabd 
 5415 
 5416 /(?>a(*COMMIT)b)c|abd/
 5417     abd
 5418 
 5419 /(?>a(*COMMIT)c)d|abd/
 5420     abd
 5421 
 5422 /((?=a(*COMMIT)b)ab|ac){0}(?:(?1)|a(c))/
 5423     ac 
 5424     
 5425 # These tests were formerly in test 2, but changes in PCRE and Perl have
 5426 # made them compatible. 
 5427     
 5428 /^(a)?(?(1)a|b)+$/
 5429     *** Failers
 5430     a
 5431 
 5432 /(?=a\Kb)ab/
 5433     ab 
 5434 
 5435 /(?!a\Kb)ac/
 5436     ac 
 5437     
 5438 /^abc(?<=b\Kc)d/
 5439     abcd
 5440 
 5441 /^abc(?<!b\Kq)d/
 5442     abcd
 5443 
 5444 
 5445 /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/x,mark
 5446     AAAC
 5447 
 5448 /^((abc|abcx)(*THEN)y|abcd)/
 5449     abcd
 5450     *** Failers 
 5451     abcxy 
 5452     
 5453 /^((yes|no)(*THEN)(*F))?/
 5454     yes
 5455 
 5456 /(A (.*)   C? (*THEN)  | A D) (*FAIL)/x
 5457     AbcdCBefgBhiBqz
 5458 
 5459 /(A (.*)   C? (*THEN)  | A D) z/x
 5460     AbcdCBefgBhiBqz
 5461 
 5462 /(A (.*)   C? (*THEN)  | A D) \s* (*FAIL)/x
 5463     AbcdCBefgBhiBqz
 5464 
 5465 /(A (.*)   C? (*THEN)  | A D) \s* z/x
 5466     AbcdCBefgBhiBqz
 5467 
 5468 /(A (.*)   (?:C|) (*THEN)  | A D) (*FAIL)/x
 5469     AbcdCBefgBhiBqz
 5470 
 5471 /(A (.*)   (?:C|) (*THEN)  | A D) z/x
 5472     AbcdCBefgBhiBqz
 5473 
 5474 /(A (.*)   C{0,6} (*THEN)  | A D) (*FAIL)/x
 5475     AbcdCBefgBhiBqz
 5476 
 5477 /(A (.*)   C{0,6} (*THEN)  | A D) z/x
 5478     AbcdCBefgBhiBqz
 5479 
 5480 /(A (.*)   (CE){0,6} (*THEN)  | A D) (*FAIL)/x
 5481     AbcdCEBefgBhiBqz
 5482 
 5483 /(A (.*)   (CE){0,6} (*THEN)  | A D) z/x
 5484     AbcdCEBefgBhiBqz
 5485 
 5486 /(A (.*)   (CE*){0,6} (*THEN)  | A D) (*FAIL)/x
 5487     AbcdCBefgBhiBqz
 5488 
 5489 /(A (.*)   (CE*){0,6} (*THEN)  | A D) z/x
 5490     AbcdCBefgBhiBqz
 5491 
 5492 /(?=a(*COMMIT)b|ac)ac|ac/
 5493     ac
 5494 
 5495 /(?=a(*COMMIT)b|(ac)) ac | (a)c/x
 5496     ac
 5497 
 5498 # ----
 5499 
 5500 /(?(?!b(*THEN)a)bn|bnn)/
 5501     bnn 
 5502 
 5503 /(?!b(*SKIP)a)bn|bnn/
 5504     bnn
 5505     
 5506 /(?(?!b(*SKIP)a)bn|bnn)/
 5507     bnn 
 5508 
 5509 /(?!b(*PRUNE)a)bn|bnn/
 5510     bnn
 5511     
 5512 /(?(?!b(*PRUNE)a)bn|bnn)/
 5513     bnn 
 5514    
 5515 /(?!b(*COMMIT)a)bn|bnn/
 5516     bnn
 5517     
 5518 /(?(?!b(*COMMIT)a)bn|bnn)/
 5519    bnn 
 5520 
 5521 /(?=b(*SKIP)a)bn|bnn/
 5522     bnn
 5523 
 5524 /(?=b(*THEN)a)bn|bnn/
 5525     bnn
 5526     
 5527 /^(?!a(*SKIP)b)/
 5528     ac
 5529 
 5530 /^(?!a(*SKIP)b)../
 5531     acd
 5532 
 5533 /(?!a(*SKIP)b)../
 5534     acd
 5535 
 5536 /^(?(?!a(*SKIP)b))/
 5537     ac
 5538 
 5539 /^(?!a(*PRUNE)b)../
 5540     acd
 5541 
 5542 /(?!a(*PRUNE)b)../
 5543     acd
 5544 
 5545 /(?!a(*COMMIT)b)ac|cd/
 5546     ac
 5547 
 5548 /\A.*?(?:a|bc)/
 5549     ba
 5550 
 5551 /^(A(*THEN)B|C(*THEN)D)/
 5552     CD           
 5553 
 5554 /(*:m(m)(?&y)(?(DEFINE)(?<y>b))/mark
 5555     abc
 5556 
 5557 /(*PRUNE:m(m)(?&y)(?(DEFINE)(?<y>b))/mark
 5558     abc
 5559 
 5560 /(*SKIP:m(m)(?&y)(?(DEFINE)(?<y>b))/mark
 5561     abc
 5562 
 5563 /(*THEN:m(m)(?&y)(?(DEFINE)(?<y>b))/mark
 5564     abc
 5565 
 5566 /^\d*\w{4}/
 5567     1234
 5568     123 
 5569 
 5570 /^[^b]*\w{4}/
 5571     aaaa
 5572     aaa     
 5573 
 5574 /^[^b]*\w{4}/i
 5575     aaaa
 5576     aaa     
 5577 
 5578 /^a*\w{4}/
 5579     aaaa
 5580     aaa     
 5581 
 5582 /^a*\w{4}/i
 5583     aaaa
 5584     aaa     
 5585 
 5586 /(?:(?<n>foo)|(?<n>bar))\k<n>/dupnames
 5587     foofoo
 5588     barbar
 5589 
 5590 /(?<n>A)(?:(?<n>foo)|(?<n>bar))\k<n>/dupnames
 5591     AfooA
 5592     AbarA  
 5593     ** Failers 
 5594     Afoofoo
 5595     Abarbar
 5596 
 5597 /^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/
 5598     1 IN SOA non-sp1 non-sp2(
 5599 
 5600 /^ (?:(?<A>A)|(?'B'B)(?<A>A)) (?('A')x) (?(<B>)y)$/x,dupnames
 5601     Ax
 5602     BAxy 
 5603     
 5604 /^A\xZ/
 5605     A\0Z 
 5606 
 5607 /^A\o{123}B/
 5608     A\123B
 5609 
 5610 / ^ a + + b $ /x
 5611     aaaab
 5612     
 5613 / ^ a + #comment
 5614   + b $ /x
 5615     aaaab
 5616     
 5617 / ^ a + #comment
 5618   #comment
 5619   + b $ /x
 5620     aaaab
 5621     
 5622 / ^ (?> a + ) b $ /x
 5623     aaaab 
 5624 
 5625 / ^ ( a + ) + + \w $ /x
 5626     aaaab 
 5627 
 5628 /(?:a\Kb)*+/aftertext
 5629     ababc
 5630 
 5631 /(?>a\Kb)*/aftertext
 5632     ababc
 5633 
 5634 /(?:a\Kb)*/aftertext
 5635     ababc
 5636 
 5637 /(a\Kb)*+/aftertext
 5638     ababc
 5639 
 5640 /(a\Kb)*/aftertext
 5641     ababc
 5642 
 5643 /(?:x|(?:(xx|yy)+|x|x|x|x|x)|a|a|a)bc/
 5644     acb
 5645 
 5646 '\A(?:[^\"]++|\"(?:[^\"]*+|\"\")*+\")++'
 5647     NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
 5648 
 5649 '\A(?:[^\"]++|\"(?:[^\"]++|\"\")*+\")++'
 5650     NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
 5651 
 5652 '\A(?:[^\"]++|\"(?:[^\"]++|\"\")++\")++'
 5653     NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
 5654 
 5655 '\A([^\"1]++|[\"2]([^\"3]*+|[\"4][\"5])*+[\"6])++'
 5656     NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
 5657 
 5658 /^\w+(?>\s*)(?<=\w)/
 5659     test test
 5660 
 5661 /(?P<same>a)(?P<same>b)/g,dupnames
 5662     abbaba
 5663 
 5664 /(?P<same>a)(?P<same>b)(?P=same)/g,dupnames
 5665     abbaba
 5666 
 5667 /(?P=same)?(?P<same>a)(?P<same>b)/g,dupnames
 5668     abbaba
 5669 
 5670 /(?:(?P=same)?(?:(?P<same>a)|(?P<same>b))(?P=same))+/g,dupnames
 5671     bbbaaabaabb
 5672 
 5673 /(?:(?P=same)?(?:(?P=same)(?P<same>a)(?P=same)|(?P=same)?(?P<same>b)(?P=same)){2}(?P=same)(?P<same>c)(?P=same)){2}(?P<same>z)?/g,dupnames
 5674     bbbaaaccccaaabbbcc
 5675 
 5676 /(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l/
 5677     acl
 5678     bdl
 5679     adl
 5680     bcl    
 5681 
 5682 /\sabc/
 5683     \x{0b}abc
 5684 
 5685 /[\Qa]\E]+/
 5686     aa]]
 5687 
 5688 /[\Q]a\E]+/
 5689     aa]]
 5690 
 5691 /A((((((((a))))))))\8B/ 
 5692     AaaB
 5693 
 5694 /A(((((((((a)))))))))\9B/ 
 5695     AaaB
 5696     
 5697 /A[\8\9]B/
 5698     A8B
 5699     A9B  
 5700 
 5701 /(|ab)*?d/
 5702    abd
 5703    xyd 
 5704 
 5705 /(?:((abcd))|(((?:(?:(?:(?:abc|(?:abcdef))))b)abcdefghi)abc)|((*ACCEPT)))/
 5706     1234abcd
 5707 
 5708 /(\2|a)(\1)/
 5709     aaa
 5710 
 5711 /(\2)(\1)/
 5712 
 5713 "Z*(|d*){216}"
 5714 
 5715 "(?1)(?#?'){8}(a)"
 5716     baaaaaaaaac
 5717 
 5718 /((((((((((((x))))))))))))\12/
 5719     xx
 5720 
 5721 /A[\8]B[\9]C/
 5722     A8B9C
 5723 
 5724 /(?1)()((((((\1++))\x85)+)|))/
 5725     \x85\x85
 5726 
 5727 "(?|(\k'Pm')|(?'Pm'))"
 5728     abcd
 5729 
 5730 # End of testinput1