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

Diff of /code/trunk/testdata/testoutput2

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

revision 427 by ph10, Fri Aug 28 09:55:54 2009 UTC revision 454 by ph10, Tue Sep 22 09:42:11 2009 UTC
# Line 1  Line 1 
1    /-- This set of tests is not Perl-compatible. It checks on special features
2        of PCRE's API, error diagnostics, and the compiled code of some patterns.
3        It also checks the non-Perl syntax the PCRE supports (Python, .NET,
4        Oniguruma). Finally, there are some tests where PCRE and Perl differ,
5        either because PCRE can't be compatible, or there is potential Perl
6        bug. --/
7    
8    /-- Originally, the Perl 5.10 things were in here too, but now I have separated
9        many (most?) of them out into test 11. However, there may still be some
10        that were overlooked. --/
11    
12  /(a)b|/I  /(a)b|/I
13  Capturing subpattern count = 1  Capturing subpattern count = 1
14  No options  No options
# Line 331  No need char Line 342  No need char
342   2: <unset>   2: <unset>
343   3: def   3: def
344    
345  /abc/IP  /abc/P
346      abc      abc
347   0: abc   0: abc
348      *** Failers      *** Failers
349  No match: POSIX code 17: match failed  No match: POSIX code 17: match failed
350    
351  /^abc|def/IP  /^abc|def/P
352      abcdef      abcdef
353   0: abc   0: abc
354      abcdef\B      abcdef\B
355   0: def   0: def
356    
357  /.*((abc)$|(def))/IP  /.*((abc)$|(def))/P
358      defabc      defabc
359   0: defabc   0: defabc
360   1: abc   1: abc
# Line 353  No match: POSIX code 17: match failed Line 364  No match: POSIX code 17: match failed
364   1: def   1: def
365   3: def   3: def
366    
367  /the quick brown fox/IP  /the quick brown fox/P
368      the quick brown fox      the quick brown fox
369   0: the quick brown fox   0: the quick brown fox
370      *** Failers      *** Failers
# Line 361  No match: POSIX code 17: match failed Line 372  No match: POSIX code 17: match failed
372      The Quick Brown Fox      The Quick Brown Fox
373  No match: POSIX code 17: match failed  No match: POSIX code 17: match failed
374    
375  /the quick brown fox/IPi  /the quick brown fox/Pi
376      the quick brown fox      the quick brown fox
377   0: the quick brown fox   0: the quick brown fox
378      The Quick Brown Fox      The Quick Brown Fox
379   0: The Quick Brown Fox   0: The Quick Brown Fox
380    
381  /abc.def/IP  /abc.def/P
382      *** Failers      *** Failers
383  No match: POSIX code 17: match failed  No match: POSIX code 17: match failed
384      abc\ndef      abc\ndef
385  No match: POSIX code 17: match failed  No match: POSIX code 17: match failed
386    
387  /abc$/IP  /abc$/P
388      abc      abc
389   0: abc   0: abc
390      abc\n      abc\n
391   0: abc   0: abc
392    
393  /(abc)\2/IP  /(abc)\2/P
394  Failed: POSIX code 15: bad back reference at offset 7  Failed: POSIX code 15: bad back reference at offset 7
395    
396  /(abc\1)/IP  /(abc\1)/P
397      abc      abc
398  No match: POSIX code 17: match failed  No match: POSIX code 17: match failed
399    
# Line 1615  No need char Line 1626  No need char
1626      \Nabc      \Nabc
1627  No match  No match
1628    
1629  /a*(b+)(z)(z)/IP  /a*(b+)(z)(z)/P
1630      aaaabbbbzzzz      aaaabbbbzzzz
1631   0: aaaabbbbzz   0: aaaabbbbzz
1632   1: bbbb   1: bbbb
# Line 1805  Need char = ')' Line 1816  Need char = ')'
1816   0: (abcd(xyz<p>qrs)123)   0: (abcd(xyz<p>qrs)123)
1817   1: abcd(xyz<p>qrs)123   1: abcd(xyz<p>qrs)123
1818   2: 123   2: 123
  3: <unset>  
1819    
1820  /\( ( ( (?>[^()]+) | ((?R)) )* ) \) /Ix  /\( ( ( (?>[^()]+) | ((?R)) )* ) \) /Ix
1821  Capturing subpattern count = 3  Capturing subpattern count = 3
# Line 3939  No options Line 3949  No options
3949  First char = 'a'  First char = 'a'
3950  Need char = 'b'  Need char = 'b'
3951    
 /^\W*(?:((.)\W*(?1)\W*\2|)|((.)\W*(?3)\W*\4|\W*.\W*))\W*$/Ii  
 Capturing subpattern count = 4  
 Max back reference = 4  
 Options: anchored caseless  
 No first char  
 No need char  
     1221  
  0: 1221  
  1: 1221  
  2: 1  
     Satan, oscillate my metallic sonatas!  
  0: Satan, oscillate my metallic sonatas!  
  1: <unset>  
  2: <unset>  
  3: Satan, oscillate my metallic sonatas  
  4: S  
     A man, a plan, a canal: Panama!  
  0: A man, a plan, a canal: Panama!  
  1: <unset>  
  2: <unset>  
  3: A man, a plan, a canal: Panama  
  4: A  
     Able was I ere I saw Elba.  
  0: Able was I ere I saw Elba.  
  1: <unset>  
  2: <unset>  
  3: Able was I ere I saw Elba  
  4: A  
     *** Failers  
 No match  
     The quick brown fox  
 No match  
   
3952  /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I  /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I
3953  Capturing subpattern count = 2  Capturing subpattern count = 2
3954  Options: anchored  Options: anchored
# Line 5548  No match Line 5525  No match
5525      line one\nthis is a line\nbreak in the second line      line one\nthis is a line\nbreak in the second line
5526  No match  No match
5527    
5528  /ab.cd/IP  /ab.cd/P
5529      ab-cd      ab-cd
5530   0: ab-cd   0: ab-cd
5531      ab=cd      ab=cd
# Line 5558  No match: POSIX code 17: match failed Line 5535  No match: POSIX code 17: match failed
5535      ab\ncd      ab\ncd
5536  No match: POSIX code 17: match failed  No match: POSIX code 17: match failed
5537    
5538  /ab.cd/IPs  /ab.cd/Ps
5539      ab-cd      ab-cd
5540   0: ab-cd   0: ab-cd
5541      ab=cd      ab=cd
# Line 5858  No need char Line 5835  No need char
5835      ((this))      ((this))
5836   0: ((this))   0: ((this))
5837    
5838  /a(b)c/IPN  /a(b)c/PN
5839      abc      abc
5840  Matched with REG_NOSUB  Matched with REG_NOSUB
5841    
5842  /a(?P<name>b)c/IPN  /a(?P<name>b)c/PN
5843      abc      abc
5844  Matched with REG_NOSUB  Matched with REG_NOSUB
5845    
# Line 7572  Need char = ':' Line 7549  Need char = ':'
7549   0: abcd:   0: abcd:
7550   1: abcd   1: abcd
7551    
 /(?'abc'\w+):\k<abc>{2}/  
     a:aaxyz  
  0: a:aa  
  1: a  
     ab:ababxyz  
  0: ab:abab  
  1: ab  
     ** Failers  
 No match  
     a:axyz  
 No match  
     ab:abxyz  
 No match  
   
7552  /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/J  /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/J
7553      adaa      adaa
7554   0: adaa   0: adaa
# Line 7612  No match Line 7575  No match
7575      bddd      bddd
7576  No match  No match
7577    
 /^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)/x  
     abd  
  0: abd  
  1: a  
     ce  
  0: ce  
   
7578  /(?(<bc))/  /(?(<bc))/
7579  Failed: malformed number or name after (?( at offset 6  Failed: malformed number or name after (?( at offset 6
7580    
# Line 7649  Failed: reference to non-existent subpat Line 7605  Failed: reference to non-existent subpat
7605   1: abcabc1Xabc2XabcX   1: abcabc1Xabc2XabcX
7606   2: abcabc1Xabc2XabcX   2: abcabc1Xabc2XabcX
7607    
 /^(?(DEFINE) (?<A> a) (?<B> b) )  (?&A) (?&B) /x  
     abcd  
  0: ab  
  1: <unset>  
  2: <unset>  
   
 /(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT))  
   (?(DEFINE)  
   (?<NAME_PAT>[a-z]+)  
   (?<ADDRESS_PAT>\d+)  
   )/x  
     metcalfe 33  
  0: metcalfe 33  
  1: metcalfe  
  2: 33  
  3: <unset>  
  4: <unset>  
   
7608  /^(?(DEFINE) abc | xyz ) /x  /^(?(DEFINE) abc | xyz ) /x
7609  Failed: DEFINE group contains more than one branch at offset 22  Failed: DEFINE group contains more than one branch at offset 22
7610    
# Line 7844  Need char = 'P' Line 7782  Need char = 'P'
7782   0: PXP   0: PXP
7783   1: P   1: P
7784    
 /(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))\b(?&byte)(\.(?&byte)){3}/  
     1.2.3.4  
  0: 1.2.3.4  
  1: <unset>  
  2: .4  
     131.111.10.206  
  0: 131.111.10.206  
  1: <unset>  
  2: .206  
     10.0.0.0  
  0: 10.0.0.0  
  1: <unset>  
  2: .0  
     ** Failers  
 No match  
     10.6  
 No match  
     455.3.4.5  
 No match  
   
 /\b(?&byte)(\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))/  
     1.2.3.4  
  0: 1.2.3.4  
  1: .4  
  2: <unset>  
     131.111.10.206  
  0: 131.111.10.206  
  1: .206  
  2: <unset>  
     10.0.0.0  
  0: 10.0.0.0  
  1: .0  
  2: <unset>  
     ** Failers  
 No match  
     10.6  
 No match  
     455.3.4.5  
 No match  
   
7785  /(?:a(?&abc)b)*(?<abc>x)/  /(?:a(?&abc)b)*(?<abc>x)/
7786      123axbaxbaxbx456      123axbaxbaxbx456
7787   0: axbaxbaxbx   0: axbaxbaxbx
# Line 7921  No match Line 7819  No match
7819     DEFabcABCXYZ     DEFabcABCXYZ
7820  No match  No match
7821    
 /^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/  
     ababababbbabZXXXX  
  0: ababababbbabZ  
  1: ab  
  2: b  
   
7822  /^(a)\g-2/  /^(a)\g-2/
7823  Failed: reference to non-existent subpattern at offset 7  Failed: reference to non-existent subpattern at offset 7
7824    
# Line 8182  Failed: reference to non-existent subpat Line 8074  Failed: reference to non-existent subpat
8074   0: Y!   0: Y!
8075   1: !   1: !
8076    
 /(foo)\Kbar/  
     foobar  
  0: bar  
  1: foo  
   
 /(foo)(\Kbar|baz)/  
     foobar  
  0: bar  
  1: foo  
  2: bar  
     foobaz  
  0: foobaz  
  1: foo  
  2: baz  
   
 /(foo\Kbar)baz/  
     foobarbaz  
  0: barbaz  
  1: foobar  
   
8077  /(?<A>tom|bon)-\k{A}/  /(?<A>tom|bon)-\k{A}/
8078      tom-tom      tom-tom
8079   0: tom-tom   0: tom-tom
# Line 8214  No match Line 8086  No match
8086      tom-bon      tom-bon
8087  No match  No match
8088    
 /(?<A>tom|bon)-\g{A}/  
     tom-tom  
  0: tom-tom  
  1: tom  
     bon-bon  
  0: bon-bon  
  1: bon  
   
8089  /\g{A/  /\g{A/
8090  Failed: syntax error in subpattern name (missing terminator) at offset 4  Failed: syntax error in subpattern name (missing terminator) at offset 4
8091    
# Line 8316  Failed: syntax error in subpattern name Line 8180  Failed: syntax error in subpattern name
8180   3: <unset>   3: <unset>
8181   4: x   4: x
8182    
 /(?|(abc)|(xyz))\1/  
     abcabc  
  0: abcabc  
  1: abc  
     xyzxyz  
  0: xyzxyz  
  1: xyz  
     ** Failers  
 No match  
     abcxyz  
 No match  
     xyzabc  
 No match  
   
 /(?|(abc)|(xyz))(?1)/  
     abcabc  
  0: abcabc  
  1: abc  
     xyzabc  
  0: xyzabc  
  1: xyz  
     ** Failers  
 No match  
     xyzxyz  
 No match  
   
 /\H\h\V\v/  
     X X\x0a  
  0: X X\x0a  
     X\x09X\x0b  
  0: X\x09X\x0b  
     ** Failers  
 No match  
     \xa0 X\x0a  
 No match  
   
 /\H*\h+\V?\v{3,4}/  
     \x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a  
  0: \x09 \xa0X\x0a\x0b\x0c\x0d  
     \x09\x20\xa0\x0a\x0b\x0c\x0d\x0a  
  0: \x09 \xa0\x0a\x0b\x0c\x0d  
     \x09\x20\xa0\x0a\x0b\x0c  
  0: \x09 \xa0\x0a\x0b\x0c  
     ** Failers  
 No match  
     \x09\x20\xa0\x0a\x0b  
 No match  
   
 /\H{3,4}/  
     XY  ABCDE  
  0: ABCD  
     XY  PQR ST  
  0: PQR  
   
 /.\h{3,4}./  
     XY  AB    PQRS  
  0: B    P  
   
 /\h*X\h?\H+Y\H?Z/  
     >XNNNYZ  
  0: XNNNYZ  
     >  X NYQZ  
  0:   X NYQZ  
     ** Failers  
 No match  
     >XYZ  
 No match  
     >  X NY Z  
 No match  
   
 /\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/  
     >XY\x0aZ\x0aA\x0bNN\x0c  
  0: XY\x0aZ\x0aA\x0bNN\x0c  
     >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c  
  0: \x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c  
   
8183  /[\h]/BZ  /[\h]/BZ
8184  ------------------------------------------------------------------  ------------------------------------------------------------------
8185          Bra          Bra
# Line 8688  Failed: missing terminating ] for charac Line 8476  Failed: missing terminating ] for charac
8476          End          End
8477  ------------------------------------------------------------------  ------------------------------------------------------------------
8478    
 /^a+(*FAIL)/  
     aaaaaa  
 No match  
   
 /a+b?c+(*FAIL)/  
     aaabccc  
 No match  
   
 /a+b?(*PRUNE)c+(*FAIL)/  
     aaabccc  
 No match  
   
 /a+b?(*COMMIT)c+(*FAIL)/  
     aaabccc  
 No match  
   
 /a+b?(*SKIP)c+(*FAIL)/  
     aaabcccaaabccc  
 No match  
   
 /^(?:aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/  
     aaaxxxxxx  
  0: aaaxxxxxx  
     aaa++++++  
  0: aaa  
     bbbxxxxx  
  0: bbbxxxxx  
     bbb+++++  
  0: bbb  
     cccxxxx  
  0: cccxxxx  
     ccc++++  
  0: ccc  
     dddddddd  
  0: ddd  
   
 /^(aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/  
     aaaxxxxxx  
  0: aaaxxxxxx  
  1: aaaxxxxxx  
     aaa++++++  
  0: aaa  
  1: aaa  
     bbbxxxxx  
  0: bbbxxxxx  
  1: bbbxxxxx  
     bbb+++++  
  0: bbb  
  1: bbb  
     cccxxxx  
  0: cccxxxx  
  1: cccxxxx  
     ccc++++  
  0: ccc  
  1: ccc  
     dddddddd  
  0: ddd  
  1: ddd  
   
 /a+b?(*THEN)c+(*FAIL)/  
     aaabccc  
 No match  
   
 /(A (A|B(*ACCEPT)|C) D)(E)/x  
     ABX  
  0: AB  
     AADE  
  0: AADE  
  1: AAD  
  2: A  
  3: E  
     ACDE  
  0: ACDE  
  1: ACD  
  2: C  
  3: E  
     ** Failers  
 No match  
     AD  
 No match  
   
8479  /^a+(*FAIL)/C  /^a+(*FAIL)/C
8480      aaaaaa      aaaaaa
8481  --->aaaaaa  --->aaaaaa
# Line 9240  Failed: unknown POSIX class name at offs Line 8947  Failed: unknown POSIX class name at offs
8947  /[[:a\dz:]]/  /[[:a\dz:]]/
8948  Failed: unknown POSIX class name at offset 3  Failed: unknown POSIX class name at offset 3
8949    
8950  /^(?<name>a|b\g<name>c)/  /(^(a|b\g<-1'c))/
8951      aaaa  Failed: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number at offset 15
  0: a  
  1: a  
     bacxxx  
  0: bac  
  1: bac  
     bbaccxxx  
  0: bbacc  
  1: bbacc  
     bbbacccxx  
  0: bbbaccc  
  1: bbbaccc  
   
 /^(?<name>a|b\g'name'c)/  
     aaaa  
  0: a  
  1: a  
     bacxxx  
  0: bac  
  1: bac  
     bbaccxxx  
  0: bbacc  
  1: bbacc  
     bbbacccxx  
  0: bbbaccc  
  1: bbbaccc  
8952    
8953  /^(a|b\g<1>c)/  /^(?+1)(?<a>x|y){0}z/
8954      aaaa      xzxx
8955   0: a   0: xz
8956   1: a      yzyy
8957      bacxxx   0: yz
8958   0: bac      ** Failers
8959   1: bac  No match
8960      bbaccxxx      xxz
8961   0: bbacc  No match
  1: bbacc  
     bbbacccxx  
  0: bbbaccc  
  1: bbbaccc  
8962    
8963  /^(a|b\g'1'c)/  /(\3)(\1)(a)/
8964      aaaa      cat
8965   0: a  No match
  1: a  
     bacxxx  
  0: bac  
  1: bac  
     bbaccxxx  
  0: bbacc  
  1: bbacc  
     bbbacccxx  
  0: bbbaccc  
  1: bbbaccc  
8966    
8967  /^(a|b\g'-1'c)/  /(\3)(\1)(a)/<JS>
8968      aaaa      cat
8969   0: a   0: a
8970   1: a   1:
8971      bacxxx   2:
8972   0: bac   3: a
8973   1: bac  
8974      bbaccxxx  /TA]/
8975   0: bbacc      The ACTA] comes
8976   1: bbacc   0: TA]
     bbbacccxx  
  0: bbbaccc  
  1: bbbaccc  
8977    
8978  /(^(a|b\g<-1>c))/  /TA]/<JS>
8979      aaaa  Failed: ] is an invalid data character in JavaScript compatibility mode at offset 2
  0: a  
  1: a  
  2: a  
     bacxxx  
  0: bac  
  1: bac  
  2: bac  
     bbaccxxx  
  0: bbacc  
  1: bbacc  
  2: bbacc  
     bbbacccxx  
  0: bbbaccc  
  1: bbbaccc  
  2: bbbaccc  
8980    
8981  /(^(a|b\g<-1'c))/  /(?2)[]a()b](abc)/
8982  Failed: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number at offset 15  Failed: reference to non-existent subpattern at offset 3
8983    
8984  /(^(a|b\g{-1}))/  /(?2)[^]a()b](abc)/
8985      bacxxx  Failed: reference to non-existent subpattern at offset 3
 No match  
   
 /(?-i:\g<name>)(?i:(?<name>a))/  
     XaaX  
  0: aa  
  1: a  
     XAAX  
  0: AA  
  1: A  
   
 /(?i:\g<name>)(?-i:(?<name>a))/  
     XaaX  
  0: aa  
  1: a  
     ** Failers  
 No match  
     XAAX  
 No match  
   
 /(?-i:\g<+1>)(?i:(a))/  
     XaaX  
  0: aa  
  1: a  
     XAAX  
  0: AA  
  1: A  
   
 /(?=(?<regex>(?#simplesyntax)\$(?<name>[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(?:\[(?<index>[a-zA-Z0-9_\x{7f}-\x{ff}]+|\$\g<name>)\]|->\g<name>(\(.*?\))?)?|(?#simple syntax withbraces)\$\{(?:\g<name>(?<indices>\[(?:\g<index>|'(?:\\.|[^'\\])*'|"(?:\g<regex>|\\.|[^"\\])*")\])?|\g<complex>|\$\{\g<complex>\})\}|(?#complexsyntax)\{(?<complex>\$(?<segment>\g<name>(\g<indices>*|\(.*?\))?)(?:->\g<segment>)*|\$\g<complex>|\$\{\g<complex>\})\}))\{/  
   
 /(?<n>a|b|c)\g<n>*/  
    abc  
  0: abc  
  1: a  
    accccbbb  
  0: accccbbb  
  1: a  
   
 /^(?+1)(?<a>x|y){0}z/  
     xzxx  
  0: xz  
  1: <unset>  
     yzyy  
  0: yz  
  1: <unset>  
     ** Failers  
 No match  
     xxz  
 No match  
   
 /(\3)(\1)(a)/  
     cat  
 No match  
   
 /(\3)(\1)(a)/<JS>  
     cat  
  0: a  
  1:  
  2:  
  3: a  
   
 /TA]/  
     The ACTA] comes  
  0: TA]  
   
 /TA]/<JS>  
 Failed: ] is an invalid data character in JavaScript compatibility mode at offset 2  
   
 /(?2)[]a()b](abc)/  
 Failed: reference to non-existent subpattern at offset 3  
   
 /(?2)[^]a()b](abc)/  
 Failed: reference to non-existent subpattern at offset 3  
8986    
8987  /(?1)[]a()b](abc)/  /(?1)[]a()b](abc)/
8988      abcbabc      abcbabc
# Line 9638  No match Line 9216  No match
9216   0: "ab"   0: "ab"
9217   1:   1:
9218    
 /^X(?5)(a)(?|(b)|(q))(c)(d)(Y)/  
     XYabcdY  
  0: XYabcdY  
  1: a  
  2: b  
  3: c  
  4: d  
  5: Y  
   
9219  /^X(?5)(a)(?|(b)|(q))(c)(d)Y/  /^X(?5)(a)(?|(b)|(q))(c)(d)Y/
9220  Failed: reference to non-existent subpattern at offset 5  Failed: reference to non-existent subpattern at offset 5
9221    
# Line 9659  Failed: reference to non-existent subpat Line 9228  Failed: reference to non-existent subpat
9228   4: d   4: d
9229   5: Y   5: Y
9230    
 /^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/  
     XYabcdY  
  0: XYabcdY  
  1: a  
  2: b  
  3: <unset>  
  4: <unset>  
  5: c  
  6: d  
  7: Y  
   
 /^X(?7)(a)(?|(b|(r)(s))|(q))(c)(d)(Y)/  
     XYabcdY  
  0: XYabcdY  
  1: a  
  2: b  
  3: <unset>  
  4: <unset>  
  5: c  
  6: d  
  7: Y  
   
 /^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)/  
     XYabcdY  
  0: XYabcdY  
  1: a  
  2: b  
  3: <unset>  
  4: <unset>  
  5: c  
  6: d  
  7: Y  
   
9231  /Xa{2,4}b/  /Xa{2,4}b/
9232      X\P      X\P
9233  Partial match: X  Partial match: X
# Line 9918  Partial match: 123999 Line 9454  Partial match: 123999
9454    
9455  /Z(*F)/  /Z(*F)/
9456      Z\P      Z\P
9457  Partial match: Z  No match
9458      ZA\P      ZA\P
9459  No match  No match
9460    
9461  /Z(?!)/  /Z(?!)/
9462      Z\P      Z\P
9463  Partial match: Z  No match
9464      ZA\P      ZA\P
9465  No match  No match
9466    
# Line 9934  No match Line 9470  No match
9470      dogs\P\P      dogs\P\P
9471  Partial match: dogs  Partial match: dogs
9472    
9473    /dog(sbody)??/
9474        dogs\P
9475     0: dog
9476        dogs\P\P
9477     0: dog
9478    
9479  /dog|dogsbody/  /dog|dogsbody/
9480      dogs\P      dogs\P
9481   0: dog   0: dog
9482      dogs\P\P      dogs\P\P
9483   0: dog   0: dog
9484    
9485  / End of testinput2 /  /dogsbody|dog/
9486        dogs\P
9487     0: dog
9488        dogs\P\P
9489    Partial match: dogs
9490    
9491    /\bthe cat\b/
9492        the cat\P
9493     0: the cat
9494        the cat\P\P
9495    Partial match: the cat
9496    
9497    /abc/
9498       abc\P
9499     0: abc
9500       abc\P\P
9501     0: abc
9502    
9503    /\w+A/P
9504       CDAAAAB
9505     0: CDAAAA
9506    
9507    /\w+A/PU
9508       CDAAAAB
9509     0: CDA
9510    
9511    /abc\K123/
9512        xyzabc123pqr
9513     0: 123
9514        xyzabc12\P
9515    Partial match: abc12
9516        xyzabc12\P\P
9517    Partial match: abc12
9518    
9519    /(?<=abc)123/
9520        xyzabc123pqr
9521     0: 123
9522        xyzabc12\P
9523    Partial match: abc12
9524        xyzabc12\P\P
9525    Partial match: abc12
9526    
9527    /\babc\b/
9528        +++abc+++
9529     0: abc
9530        +++ab\P
9531    Partial match: +ab
9532        +++ab\P\P
9533    Partial match: +ab
9534    
9535    /(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/BZ
9536    ------------------------------------------------------------------
9537            Bra
9538            Once
9539            Recurse
9540            Ket
9541            Once
9542            Recurse
9543            Ket
9544            Cond
9545            Cond def
9546            CBra 1
9547            <
9548            [^m]
9549            [^>]
9550            >
9551            [^<]
9552            Ket
9553            CBra 2
9554            \w*+
9555            Ket
9556            Ket
9557            Ket
9558            End
9559    ------------------------------------------------------------------
9560    
9561    /(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/BZ
9562    ------------------------------------------------------------------
9563            Bra
9564            Once
9565            Recurse
9566            Ket
9567            Once
9568            Recurse
9569            Ket
9570            Cond
9571            Cond def
9572            CBra 1
9573            <
9574            [\x00-/:-\xff] (neg)
9575            [^>]
9576            >
9577            [^<]
9578            Ket
9579            CBra 2
9580            \w*+
9581            Ket
9582            Ket
9583            Ket
9584            End
9585    ------------------------------------------------------------------
9586    
9587    /(ab)(x(y)z(cd(*ACCEPT)))pq/BZ
9588    ------------------------------------------------------------------
9589            Bra
9590            CBra 1
9591            ab
9592            Ket
9593            CBra 2
9594            x
9595            CBra 3
9596            y
9597            Ket
9598            z
9599            CBra 4
9600            cd
9601            Close 4
9602            Close 2
9603            *ACCEPT
9604            Ket
9605            Ket
9606            pq
9607            Ket
9608            End
9609    ------------------------------------------------------------------
9610    
9611    /abc\K/+
9612        abcdef
9613     0:
9614     0+ def
9615        abcdef\N\N
9616     0:
9617     0+ def
9618        xyzabcdef\N\N
9619     0:
9620     0+ def
9621        ** Failers
9622    No match
9623        abcdef\N
9624    No match
9625        xyzabcdef\N
9626    No match
9627    
9628    /^(?:(?=abc)|abc\K)/+
9629        abcdef
9630     0:
9631     0+ abcdef
9632        abcdef\N\N
9633     0:
9634     0+ def
9635        ** Failers
9636    No match
9637        abcdef\N
9638    No match
9639    
9640    /a?b?/+
9641        xyz
9642     0:
9643     0+ xyz
9644        xyzabc
9645     0:
9646     0+ xyzabc
9647        xyzabc\N
9648     0: ab
9649     0+ c
9650        xyzabc\N\N
9651     0:
9652     0+ yzabc
9653        xyz\N\N
9654     0:
9655     0+ yz
9656        ** Failers
9657     0:
9658     0+ ** Failers
9659        xyz\N
9660    No match
9661    
9662    /^a?b?/+
9663        xyz
9664     0:
9665     0+ xyz
9666        xyzabc
9667     0:
9668     0+ xyzabc
9669        ** Failers
9670     0:
9671     0+ ** Failers
9672        xyzabc\N
9673    No match
9674        xyzabc\N\N
9675    No match
9676        xyz\N\N
9677    No match
9678        xyz\N
9679    No match
9680    
9681    /^(?<name>a|b\g<name>c)/
9682        aaaa
9683     0: a
9684     1: a
9685        bacxxx
9686     0: bac
9687     1: bac
9688        bbaccxxx
9689     0: bbacc
9690     1: bbacc
9691        bbbacccxx
9692     0: bbbaccc
9693     1: bbbaccc
9694    
9695    /^(?<name>a|b\g'name'c)/
9696        aaaa
9697     0: a
9698     1: a
9699        bacxxx
9700     0: bac
9701     1: bac
9702        bbaccxxx
9703     0: bbacc
9704     1: bbacc
9705        bbbacccxx
9706     0: bbbaccc
9707     1: bbbaccc
9708    
9709    /^(a|b\g<1>c)/
9710        aaaa
9711     0: a
9712     1: a
9713        bacxxx
9714     0: bac
9715     1: bac
9716        bbaccxxx
9717     0: bbacc
9718     1: bbacc
9719        bbbacccxx
9720     0: bbbaccc
9721     1: bbbaccc
9722    
9723    /^(a|b\g'1'c)/
9724        aaaa
9725     0: a
9726     1: a
9727        bacxxx
9728     0: bac
9729     1: bac
9730        bbaccxxx
9731     0: bbacc
9732     1: bbacc
9733        bbbacccxx
9734     0: bbbaccc
9735     1: bbbaccc
9736    
9737    /^(a|b\g'-1'c)/
9738        aaaa
9739     0: a
9740     1: a
9741        bacxxx
9742     0: bac
9743     1: bac
9744        bbaccxxx
9745     0: bbacc
9746     1: bbacc
9747        bbbacccxx
9748     0: bbbaccc
9749     1: bbbaccc
9750    
9751    /(^(a|b\g<-1>c))/
9752        aaaa
9753     0: a
9754     1: a
9755     2: a
9756        bacxxx
9757     0: bac
9758     1: bac
9759     2: bac
9760        bbaccxxx
9761     0: bbacc
9762     1: bbacc
9763     2: bbacc
9764        bbbacccxx
9765     0: bbbaccc
9766     1: bbbaccc
9767     2: bbbaccc
9768    
9769    /(?-i:\g<name>)(?i:(?<name>a))/
9770        XaaX
9771     0: aa
9772     1: a
9773        XAAX
9774     0: AA
9775     1: A
9776    
9777    /(?i:\g<name>)(?-i:(?<name>a))/
9778        XaaX
9779     0: aa
9780     1: a
9781        ** Failers
9782    No match
9783        XAAX
9784    No match
9785    
9786    /(?-i:\g<+1>)(?i:(a))/
9787        XaaX
9788     0: aa
9789     1: a
9790        XAAX
9791     0: AA
9792     1: A
9793    
9794    /(?=(?<regex>(?#simplesyntax)\$(?<name>[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(?:\[(?<index>[a-zA-Z0-9_\x{7f}-\x{ff}]+|\$\g<name>)\]|->\g<name>(\(.*?\))?)?|(?#simple syntax withbraces)\$\{(?:\g<name>(?<indices>\[(?:\g<index>|'(?:\\.|[^'\\])*'|"(?:\g<regex>|\\.|[^"\\])*")\])?|\g<complex>|\$\{\g<complex>\})\}|(?#complexsyntax)\{(?<complex>\$(?<segment>\g<name>(\g<indices>*|\(.*?\))?)(?:->\g<segment>)*|\$\g<complex>|\$\{\g<complex>\})\}))\{/
9795    
9796    /(?<n>a|b|c)\g<n>*/
9797       abc
9798     0: abc
9799     1: a
9800       accccbbb
9801     0: accccbbb
9802     1: a
9803    
9804    /^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/
9805        XYabcdY
9806     0: XYabcdY
9807     1: a
9808     2: b
9809     3: <unset>
9810     4: <unset>
9811     5: c
9812     6: d
9813     7: Y
9814    
9815    /(?<=b(?1)|zzz)(a)/
9816        xbaax
9817     0: a
9818     1: a
9819        xzzzax
9820     0: a
9821     1: a
9822    
9823    /(a)(?<=b\1)/
9824    Failed: lookbehind assertion is not fixed length at offset 10
9825    
9826    /(a)(?<=b+(?1))/
9827    Failed: lookbehind assertion is not fixed length at offset 13
9828    
9829    /(a+)(?<=b(?1))/
9830    Failed: lookbehind assertion is not fixed length at offset 14
9831    
9832    /(a(?<=b(?1)))/
9833    Failed: lookbehind assertion is not fixed length at offset 13
9834    
9835    /(?<=b(?1))xyz/
9836    Failed: reference to non-existent subpattern at offset 8
9837    
9838    /(?<=b(?1))xyz(b+)pqrstuvew/
9839    Failed: lookbehind assertion is not fixed length at offset 26
9840    
9841    /-- End of testinput2 --/

Legend:
Removed from v.427  
changed lines
  Added in v.454

  ViewVC Help
Powered by ViewVC 1.1.5