/[pcre]/code/trunk/testdata/testinput2
ViewVC logotype

Diff of /code/trunk/testdata/testinput2

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 729 by ph10, Mon Oct 10 16:02:20 2011 UTC revision 888 by ph10, Tue Jan 17 14:43:23 2012 UTC
# Line 3  Line 3 
3      It also checks the non-Perl syntax the PCRE supports (Python, .NET,      It also checks the non-Perl syntax the PCRE supports (Python, .NET,
4      Oniguruma). Finally, there are some tests where PCRE and Perl differ,      Oniguruma). Finally, there are some tests where PCRE and Perl differ,
5      either because PCRE can't be compatible, or there is a possible Perl      either because PCRE can't be compatible, or there is a possible Perl
6      bug. --/      bug.
7    
8        NOTE: This is a non-UTF set of tests. When UTF support is needed, use
9        test 5, and if Unicode Property Support is needed, use test 7. --/
10    
 /-- Originally, the Perl >= 5.10 things were in here too, but now I have  
     separated many (most?) of them out into test 11. However, there may still  
     be some that were overlooked. --/  
   
11  /(a)b|/I  /(a)b|/I
12    
13  /abc/I  /abc/I
# Line 144  Line 143 
143      defabc      defabc
144      \Zdefabc      \Zdefabc
145    
 /abc/P  
     abc  
     *** Failers  
   
 /^abc|def/P  
     abcdef  
     abcdef\B  
   
 /.*((abc)$|(def))/P  
     defabc  
     \Zdefabc  
   
 /the quick brown fox/P  
     the quick brown fox  
     *** Failers  
     The Quick Brown Fox  
   
 /the quick brown fox/Pi  
     the quick brown fox  
     The Quick Brown Fox  
   
 /abc.def/P  
     *** Failers  
     abc\ndef  
   
 /abc$/P  
     abc  
     abc\n  
   
 /(abc)\2/P  
   
 /(abc\1)/P  
     abc  
   
146  /)/  /)/
147    
148  /a[]b/  /a[]b/
# Line 442  Line 407 
407    
408  /abc/\  /abc/\
409    
 /abc/\P  
   
410  /abc/\i  /abc/\i
411    
412  /(a)bc(d)/I  /(a)bc(d)/I
# Line 491  Line 454 
454  /\Biss\B/I+  /\Biss\B/I+
455      Mississippi      Mississippi
456    
 /\Biss\B/I+P  
     Mississippi  
   
457  /iss/IG+  /iss/IG+
458      Mississippi      Mississippi
459    
# Line 629  Line 589 
589      *** Failers      *** Failers
590      \Nabc      \Nabc
591    
 /a*(b+)(z)(z)/P  
     aaaabbbbzzzz  
     aaaabbbbzzzz\O0  
     aaaabbbbzzzz\O1  
     aaaabbbbzzzz\O2  
     aaaabbbbzzzz\O3  
     aaaabbbbzzzz\O4  
     aaaabbbbzzzz\O5  
   
592  /^.?abcd/IS  /^.?abcd/IS
593    
594  /\(             # ( at start  /\(             # ( at start
# Line 1491  Line 1442 
1442      ** Failers      ** Failers
1443      line one\nthis is a line\nbreak in the second line      line one\nthis is a line\nbreak in the second line
1444    
 /ab.cd/P  
     ab-cd  
     ab=cd  
     ** Failers  
     ab\ncd  
   
 /ab.cd/Ps  
     ab-cd  
     ab=cd  
     ab\ncd  
   
1445  /(?i)(?-i)AbCd/I  /(?i)(?-i)AbCd/I
1446      AbCd      AbCd
1447      ** Failers      ** Failers
# Line 1552  Line 1492 
1492      (this)      (this)
1493      ((this))      ((this))
1494    
 /a(b)c/PN  
     abc  
   
 /a(?P<name>b)c/PN  
     abc  
   
 /\x{100}/I  
   
1495  /\x{0000ff}/I  /\x{0000ff}/I
1496    
1497  /^((?P<A>a1)|(?P<A>a2)b)/I  /^((?P<A>a1)|(?P<A>a2)b)/I
# Line 1637  a random value. /Ix Line 1569  a random value. /Ix
1569  /()()()()()()()()()(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I  /()()()()()()()()()(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
1570      bXXaYYaY      bXXaYYaY
1571    
 /\777/I  
   
1572  /\s*,\s*/IS  /\s*,\s*/IS
1573      \x0b,\x0b      \x0b,\x0b
1574      \x0c,\x0d      \x0c,\x0d
# Line 2241  a random value. /Ix Line 2171  a random value. /Ix
2171      xabcpqrx      xabcpqrx
2172      xxyzx      xxyzx
2173    
 /[\h]/BZ  
     >\x09<  
   
 /[\h]+/BZ  
     >\x09\x20\xa0<  
   
 /[\v]/BZ  
   
 /[\H]/BZ  
   
 /[^\h]/BZ  
   
 /[\V]/BZ  
   
 /[\x0a\V]/BZ  
   
2174  /\H++X/BZ  /\H++X/BZ
2175      ** Failers      ** Failers
2176      XXXX      XXXX
# Line 2616  a random value. /Ix Line 2530  a random value. /Ix
2530    
2531  /(?(?=.*b).*b|^d)/I  /(?(?=.*b).*b|^d)/I
2532    
 /a?|b?/P  
     abc  
     ** Failers  
     ddd\N  
   
2533  /xyz/C  /xyz/C
2534    xyz    xyz
2535    abcxyz    abcxyz
# Line 2812  a random value. /Ix Line 2721  a random value. /Ix
2721     abc\P     abc\P
2722     abc\P\P     abc\P\P
2723    
 /\w+A/P  
    CDAAAAB  
   
 /\w+A/PU  
    CDAAAAB  
   
2724  /abc\K123/  /abc\K123/
2725      xyzabc123pqr      xyzabc123pqr
2726      xyzabc12\P      xyzabc12\P
# Line 2961  a random value. /Ix Line 2864  a random value. /Ix
2864    
2865  /^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]/SI  /^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]/SI
2866    
 /  (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*                          # optional leading comment  
 (?:    (?:  
 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...  
 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom  
 |  
 " (?:                      # opening quote...  
 [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote  
 |                     #    or  
 \\ [^\x80-\xff]           #   Escaped something (something != CR)  
 )* "  # closing quote  
 )                    # initial word  
 (?:  (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*  \.  (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*   (?:  
 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...  
 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom  
 |  
 " (?:                      # opening quote...  
 [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote  
 |                     #    or  
 \\ [^\x80-\xff]           #   Escaped something (something != CR)  
 )* "  # closing quote  
 )  )* # further okay, if led by a period  
 (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*  @  (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*    (?:  
 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...  
 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom  
 |   \[                         # [  
 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff  
 \]                        #           ]  
 )                           # initial subdomain  
 (?:                                  #  
 (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*  \.                        # if led by a period...  
 (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*   (?:  
 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...  
 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom  
 |   \[                         # [  
 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff  
 \]                        #           ]  
 )                     #   ...further okay  
 )*  
 # address  
 |                     #  or  
 (?:  
 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...  
 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom  
 |  
 " (?:                      # opening quote...  
 [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote  
 |                     #    or  
 \\ [^\x80-\xff]           #   Escaped something (something != CR)  
 )* "  # closing quote  
 )             # one word, optionally followed by....  
 (?:  
 [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037]  |  # atom and space parts, or...  
 \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)       |  # comments, or...  
   
 " (?:                      # opening quote...  
 [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote  
 |                     #    or  
 \\ [^\x80-\xff]           #   Escaped something (something != CR)  
 )* "  # closing quote  
 # quoted strings  
 )*  
 <  (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*                     # leading <  
 (?:  @  (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*    (?:  
 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...  
 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom  
 |   \[                         # [  
 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff  
 \]                        #           ]  
 )                           # initial subdomain  
 (?:                                  #  
 (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*  \.                        # if led by a period...  
 (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*   (?:  
 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...  
 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom  
 |   \[                         # [  
 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff  
 \]                        #           ]  
 )                     #   ...further okay  
 )*  
   
 (?:  (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*  ,  (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*  @  (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*    (?:  
 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...  
 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom  
 |   \[                         # [  
 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff  
 \]                        #           ]  
 )                           # initial subdomain  
 (?:                                  #  
 (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*  \.                        # if led by a period...  
 (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*   (?:  
 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...  
 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom  
 |   \[                         # [  
 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff  
 \]                        #           ]  
 )                     #   ...further okay  
 )*  
 )* # further okay, if led by comma  
 :                                # closing colon  
 (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*  )? #       optional route  
 (?:  
 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...  
 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom  
 |  
 " (?:                      # opening quote...  
 [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote  
 |                     #    or  
 \\ [^\x80-\xff]           #   Escaped something (something != CR)  
 )* "  # closing quote  
 )                    # initial word  
 (?:  (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*  \.  (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*   (?:  
 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...  
 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom  
 |  
 " (?:                      # opening quote...  
 [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote  
 |                     #    or  
 \\ [^\x80-\xff]           #   Escaped something (something != CR)  
 )* "  # closing quote  
 )  )* # further okay, if led by a period  
 (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*  @  (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*    (?:  
 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...  
 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom  
 |   \[                         # [  
 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff  
 \]                        #           ]  
 )                           # initial subdomain  
 (?:                                  #  
 (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*  \.                        # if led by a period...  
 (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*   (?:  
 [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...  
 (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom  
 |   \[                         # [  
 (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff  
 \]                        #           ]  
 )                     #   ...further okay  
 )*  
 #       address spec  
 (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*  > #                  trailing >  
 # name and address  
 )  (?: [\040\t] |  \(  
 (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*  
 \)  )*                       # optional trailing comment  
 /xSI  
   
2867  /<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>/isIS  /<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>/isIS
2868    
2869  "(?>.*/)foo"SI  "(?>.*/)foo"SI
# Line 3322  a random value. /Ix Line 3030  a random value. /Ix
3030  /A(*PRUNE)B|A(*PRUNE)C/K  /A(*PRUNE)B|A(*PRUNE)C/K
3031      AC      AC
3032    
 /--- A whole lot of tests of verbs with arguments are here rather than in test  
      11 because Perl doesn't seem to follow its specification entirely  
      correctly. ---/  
   
 /--- Perl 5.11 sets $REGERROR on the AC failure case here; PCRE does not. It is  
      not clear how Perl defines "involved in the failure of the match". ---/  
   
 /^(A(*THEN:A)B|C(*THEN:B)D)/K  
     AB  
     CD  
     ** Failers  
     AC  
     CB  
   
 /--- Check the use of names for success and failure. PCRE doesn't show these  
 names for success, though Perl does, contrary to its spec. ---/  
   
 /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K  
     AB  
     CD  
     ** Failers  
     AC  
     CB  
   
 /--- An empty name does not pass back an empty string. It is the same as if no  
 name were given. ---/  
   
 /^(A(*PRUNE:)B|C(*PRUNE:B)D)/K  
     AB  
     CD  
   
 /--- PRUNE goes to next bumpalong; COMMIT does not. ---/  
   
 /A(*PRUNE:A)B/K  
     ACAB  
   
 /(*MARK:A)(*PRUNE:B)(C|X)/KS  
     C  
     D  
   
 /(*MARK:A)(*PRUNE:B)(C|X)/KSS  
     C  
     D  
   
 /(*MARK:A)(*THEN:B)(C|X)/KS  
     C  
     D  
   
 /(*MARK:A)(*THEN:B)(C|X)/KSY  
     C  
     D  
   
 /(*MARK:A)(*THEN:B)(C|X)/KSS  
     C  
     D  
   
 /--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/  
   
 /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK  
     AAAC  
   
 /--- Same --/  
   
 /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK  
     AAAC  
   
3033  /--- This should fail; the SKIP advances by one, but when we get to AC, the  /--- This should fail; the SKIP advances by one, but when we get to AC, the
3034       PRUNE kills it. ---/       PRUNE kills it. Perl behaves differently. ---/
3035    
3036  /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK  /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
3037      AAAC      AAAC
3038    
3039  /A(*:A)A+(*SKIP)(B|Z) | AC/xK  /--- Mark names can be duplicated. Perl doesn't give a mark for this one,
3040      AAAC  though PCRE does. ---/
   
 /--- This should fail, as a null name is the same as no name ---/  
   
 /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK  
     AAAC  
   
 /--- This fails in PCRE, and I think that is in accordance with Perl's  
      documentation, though in Perl it succeeds. ---/  
   
 /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK  
     AAAC  
   
 /--- Mark names can be duplicated ---/  
3041    
 /A(*:A)B|X(*:A)Y/K  
     AABC  
     XXYZ  
   
3042  /^A(*:A)B|^X(*:A)Y/K  /^A(*:A)B|^X(*:A)Y/K
3043      ** Failers      ** Failers
3044      XAQQ      XAQQ
3045    
 /--- A check on what happens after hitting a mark and them bumping along to  
 something that does not even start. Perl reports tags after the failures here,  
 though it does not when the individual letters are made into something  
 more complicated. ---/  
   
 /A(*:A)B|XX(*:B)Y/K  
     AABC  
     XXYZ  
     ** Failers  
     XAQQ  
     XAQQXZZ  
     AXQQQ  
     AXXQQQ  
   
3046  /--- COMMIT at the start of a pattern should be the same as an anchor. Perl  /--- COMMIT at the start of a pattern should be the same as an anchor. Perl
3047  optimizations defeat this. So does the PCRE optimization unless we disable it  optimizations defeat this. So does the PCRE optimization unless we disable it
3048  with \Y. ---/  with \Y. ---/
# Line 3441  with \Y. ---/ Line 3052  with \Y. ---/
3052      ** Failers      ** Failers
3053      DEFGABC\Y      DEFGABC\Y
3054    
 /--- Repeat some tests with added studying. ---/  
   
 /A(*COMMIT)B/+KS  
     ACABX  
   
 /A(*THEN)B|A(*THEN)C/KS  
     AC  
   
 /A(*PRUNE)B|A(*PRUNE)C/KS  
     AC  
   
 /^(A(*THEN:A)B|C(*THEN:B)D)/KS  
     AB  
     CD  
     ** Failers  
     AC  
     CB  
   
 /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/KS  
     AB  
     CD  
     ** Failers  
     AC  
     CB  
   
 /^(A(*PRUNE:)B|C(*PRUNE:B)D)/KS  
     AB  
     CD  
   
 /A(*PRUNE:A)B/KS  
     ACAB  
   
 /(*MARK:A)(*PRUNE:B)(C|X)/KS  
     C  
     D  
   
 /(*MARK:A)(*THEN:B)(C|X)/KS  
     C  
     D  
   
 /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xKS  
     AAAC  
   
 /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xKS  
     AAAC  
   
 /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xKS  
     AAAC  
   
 /A(*:A)A+(*SKIP)(B|Z) | AC/xKS  
     AAAC  
   
 /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xKS  
     AAAC  
   
 /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xKS  
     AAAC  
   
 /A(*:A)B|XX(*:B)Y/KS  
     AABC  
     XXYZ  
     ** Failers  
     XAQQ  
     XAQQXZZ  
     AXQQQ  
     AXXQQQ  
   
 /(*COMMIT)ABC/  
     ABCDEFG  
     ** Failers  
     DEFGABC\Y  
   
3055  /^(ab (c+(*THEN)cd) | xyz)/x  /^(ab (c+(*THEN)cd) | xyz)/x
3056      abcccd      abcccd
3057    
# Line 3850  with \Y. ---/ Line 3389  with \Y. ---/
3389  /((?2))((?1))/SS  /((?2))((?1))/SS
3390      abc      abc
3391    
3392  /((?(R2)a+|(?1)b))/  /((?(R2)a+|(?1)b))/SS
3393      aaaabcde      aaaabcde
3394    
3395  /(?(R)a*(?1)|((?R))b)/  /(?(R)a*(?1)|((?R))b)/SS
3396      aaaabcde      aaaabcde
3397    
3398  /(a+|(?R)b)/  /(a+|(?R)b)/
# Line 3969  AbcdCBefgBhiBqz Line 3508  AbcdCBefgBhiBqz
3508  /^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/  /^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/
3509       \Maabbccddee       \Maabbccddee
3510    
3511    /^a\x41z/<JS>
3512        aAz
3513        *** Failers
3514        ax41z
3515    
3516    /^a[m\x41]z/<JS>
3517        aAz
3518    
3519    /^a\x1z/<JS>
3520        ax1z
3521    
3522    /^a\u0041z/<JS>
3523        aAz
3524        *** Failers
3525        au0041z
3526    
3527    /^a[m\u0041]z/<JS>
3528        aAz
3529    
3530    /^a\u041z/<JS>
3531        au041z
3532        *** Failers
3533        aAz
3534    
3535    /^a\U0041z/<JS>
3536        aU0041z
3537        *** Failers
3538        aAz
3539    
3540    /(?(?=c)c|d)++Y/BZ
3541    
3542    /(?(?=c)c|d)*+Y/BZ
3543    
3544    /a[\NB]c/
3545        aNc
3546    
3547    /a[B-\Nc]/
3548    
3549    /(a)(?2){0,1999}?(b)/
3550    
3551    /(a)(?(DEFINE)(b))(?2){0,1999}?(?2)/
3552    
3553    /--- This test, with something more complicated than individual letters, causes
3554    different behaviour in Perl. Perhaps it disables some optimization; no tag is
3555    passed back for the failures, whereas in PCRE there is a tag. ---/
3556    
3557    /(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/xK
3558        AABC
3559        XXYZ
3560        ** Failers
3561        XAQQ
3562        XAQQXZZ
3563        AXQQQ
3564        AXXQQQ
3565    
3566    /-- Perl doesn't give marks for these, though it does if the alternatives are
3567    replaced by single letters. --/
3568    
3569    /(b|q)(*:m)f|a(*:n)w/K
3570        aw
3571        ** Failers
3572        abc
3573    
3574    /(q|b)(*:m)f|a(*:n)w/K
3575        aw
3576        ** Failers
3577        abc
3578    
3579    /-- After a partial match, the behaviour is as for a failure. --/
3580    
3581    /^a(*:X)bcde/K
3582       abc\P
3583    
3584    /-- These are here because Perl doesn't return a mark, except for the first --/
3585    
3586    /(?=(*:x))(q|)/K+
3587        abc
3588    
3589    /(?=(*:x))((*:y)q|)/K+
3590        abc
3591    
3592    /(?=(*:x))(?:(*:y)q|)/K+
3593        abc
3594    
3595    /(?=(*:x))(?>(*:y)q|)/K+
3596        abc
3597    
3598    /(?=a(*:x))(?!a(*:y)c)/K+
3599        ab
3600    
3601    /(?=a(*:x))(?=a(*:y)c|)/K+
3602        ab
3603    
3604  /-- End of testinput2 --/  /-- End of testinput2 --/

Legend:
Removed from v.729  
changed lines
  Added in v.888

  ViewVC Help
Powered by ViewVC 1.1.5