/[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 426 by ph10, Wed Aug 26 15:38:32 2009 UTC revision 450 by ph10, Wed Sep 16 10:56:40 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 5548  No match Line 5558  No match
5558      line one\nthis is a line\nbreak in the second line      line one\nthis is a line\nbreak in the second line
5559  No match  No match
5560    
5561  /ab.cd/IP  /ab.cd/P
5562      ab-cd      ab-cd
5563   0: ab-cd   0: ab-cd
5564      ab=cd      ab=cd
# Line 5558  No match: POSIX code 17: match failed Line 5568  No match: POSIX code 17: match failed
5568      ab\ncd      ab\ncd
5569  No match: POSIX code 17: match failed  No match: POSIX code 17: match failed
5570    
5571  /ab.cd/IPs  /ab.cd/Ps
5572      ab-cd      ab-cd
5573   0: ab-cd   0: ab-cd
5574      ab=cd      ab=cd
# Line 5858  No need char Line 5868  No need char
5868      ((this))      ((this))
5869   0: ((this))   0: ((this))
5870    
5871  /a(b)c/IPN  /a(b)c/PN
5872      abc      abc
5873  Matched with REG_NOSUB  Matched with REG_NOSUB
5874    
5875  /a(?P<name>b)c/IPN  /a(?P<name>b)c/PN
5876      abc      abc
5877  Matched with REG_NOSUB  Matched with REG_NOSUB
5878    
# Line 7572  Need char = ':' Line 7582  Need char = ':'
7582   0: abcd:   0: abcd:
7583   1: abcd   1: abcd
7584    
 /(?'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  
   
7585  /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/J  /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/J
7586      adaa      adaa
7587   0: adaa   0: adaa
# Line 7612  No match Line 7608  No match
7608      bddd      bddd
7609  No match  No match
7610    
 /^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)/x  
     abd  
  0: abd  
  1: a  
     ce  
  0: ce  
   
7611  /(?(<bc))/  /(?(<bc))/
7612  Failed: malformed number or name after (?( at offset 6  Failed: malformed number or name after (?( at offset 6
7613    
# Line 7649  Failed: reference to non-existent subpat Line 7638  Failed: reference to non-existent subpat
7638   1: abcabc1Xabc2XabcX   1: abcabc1Xabc2XabcX
7639   2: abcabc1Xabc2XabcX   2: abcabc1Xabc2XabcX
7640    
 /^(?(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>  
   
7641  /^(?(DEFINE) abc | xyz ) /x  /^(?(DEFINE) abc | xyz ) /x
7642  Failed: DEFINE group contains more than one branch at offset 22  Failed: DEFINE group contains more than one branch at offset 22
7643    
# Line 7844  Need char = 'P' Line 7815  Need char = 'P'
7815   0: PXP   0: PXP
7816   1: P   1: P
7817    
 /(?(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  
   
7818  /(?:a(?&abc)b)*(?<abc>x)/  /(?:a(?&abc)b)*(?<abc>x)/
7819      123axbaxbaxbx456      123axbaxbaxbx456
7820   0: axbaxbaxbx   0: axbaxbaxbx
# Line 7921  No match Line 7852  No match
7852     DEFabcABCXYZ     DEFabcABCXYZ
7853  No match  No match
7854    
 /^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/  
     ababababbbabZXXXX  
  0: ababababbbabZ  
  1: ab  
  2: b  
   
7855  /^(a)\g-2/  /^(a)\g-2/
7856  Failed: reference to non-existent subpattern at offset 7  Failed: reference to non-existent subpattern at offset 7
7857    
# Line 8182  Failed: reference to non-existent subpat Line 8107  Failed: reference to non-existent subpat
8107   0: Y!   0: Y!
8108   1: !   1: !
8109    
 /(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  
   
8110  /(?<A>tom|bon)-\k{A}/  /(?<A>tom|bon)-\k{A}/
8111      tom-tom      tom-tom
8112   0: tom-tom   0: tom-tom
# Line 8214  No match Line 8119  No match
8119      tom-bon      tom-bon
8120  No match  No match
8121    
 /(?<A>tom|bon)-\g{A}/  
     tom-tom  
  0: tom-tom  
  1: tom  
     bon-bon  
  0: bon-bon  
  1: bon  
   
8122  /\g{A/  /\g{A/
8123  Failed: syntax error in subpattern name (missing terminator) at offset 4  Failed: syntax error in subpattern name (missing terminator) at offset 4
8124    
# Line 8316  Failed: syntax error in subpattern name Line 8213  Failed: syntax error in subpattern name
8213   3: <unset>   3: <unset>
8214   4: x   4: x
8215    
 /(?|(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  
   
8216  /[\h]/BZ  /[\h]/BZ
8217  ------------------------------------------------------------------  ------------------------------------------------------------------
8218          Bra          Bra
# Line 8688  Failed: missing terminating ] for charac Line 8509  Failed: missing terminating ] for charac
8509          End          End
8510  ------------------------------------------------------------------  ------------------------------------------------------------------
8511    
 /^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  
   
8512  /^a+(*FAIL)/C  /^a+(*FAIL)/C
8513      aaaaaa      aaaaaa
8514  --->aaaaaa  --->aaaaaa
# Line 9240  Failed: unknown POSIX class name at offs Line 8980  Failed: unknown POSIX class name at offs
8980  /[[:a\dz:]]/  /[[:a\dz:]]/
8981  Failed: unknown POSIX class name at offset 3  Failed: unknown POSIX class name at offset 3
8982    
 /^(?<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  
   
 /^(?<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  
   
 /^(a|b\g<1>c)/  
     aaaa  
  0: a  
  1: a  
     bacxxx  
  0: bac  
  1: bac  
     bbaccxxx  
  0: bbacc  
  1: bbacc  
     bbbacccxx  
  0: bbbaccc  
  1: bbbaccc  
   
 /^(a|b\g'1'c)/  
     aaaa  
  0: a  
  1: a  
     bacxxx  
  0: bac  
  1: bac  
     bbaccxxx  
  0: bbacc  
  1: bbacc  
     bbbacccxx  
  0: bbbaccc  
  1: bbbaccc  
   
 /^(a|b\g'-1'c)/  
     aaaa  
  0: a  
  1: a  
     bacxxx  
  0: bac  
  1: bac  
     bbaccxxx  
  0: bbacc  
  1: bbacc  
     bbbacccxx  
  0: bbbaccc  
  1: bbbaccc  
   
 /(^(a|b\g<-1>c))/  
     aaaa  
  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  
   
8983  /(^(a|b\g<-1'c))/  /(^(a|b\g<-1'c))/
8984  Failed: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number at offset 15  Failed: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number at offset 15
8985    
 /(^(a|b\g{-1}))/  
     bacxxx  
 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  
   
8986  /^(?+1)(?<a>x|y){0}z/  /^(?+1)(?<a>x|y){0}z/
8987      xzxx      xzxx
8988   0: xz   0: xz
  1: <unset>  
8989      yzyy      yzyy
8990   0: yz   0: yz
  1: <unset>  
8991      ** Failers      ** Failers
8992  No match  No match
8993      xxz      xxz
# Line 9638  No match Line 9249  No match
9249   0: "ab"   0: "ab"
9250   1:   1:
9251    
 /^X(?5)(a)(?|(b)|(q))(c)(d)(Y)/  
     XYabcdY  
  0: XYabcdY  
  1: a  
  2: b  
  3: c  
  4: d  
  5: Y  
   
9252  /^X(?5)(a)(?|(b)|(q))(c)(d)Y/  /^X(?5)(a)(?|(b)|(q))(c)(d)Y/
9253  Failed: reference to non-existent subpattern at offset 5  Failed: reference to non-existent subpattern at offset 5
9254    
# Line 9659  Failed: reference to non-existent subpat Line 9261  Failed: reference to non-existent subpat
9261   4: d   4: d
9262   5: Y   5: Y
9263    
 /^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  
   
9264  /Xa{2,4}b/  /Xa{2,4}b/
9265      X\P      X\P
9266  Partial match: X  Partial match: X
# Line 9918  Partial match: 123999 Line 9487  Partial match: 123999
9487    
9488  /Z(*F)/  /Z(*F)/
9489      Z\P      Z\P
9490  Partial match: Z  No match
9491      ZA\P      ZA\P
9492  No match  No match
9493    
9494  /Z(?!)/  /Z(?!)/
9495      Z\P      Z\P
9496  Partial match: Z  No match
9497      ZA\P      ZA\P
9498  No match  No match
9499    
9500  / End of testinput2 /  /dog(sbody)?/
9501        dogs\P
9502     0: dog
9503        dogs\P\P
9504    Partial match: dogs
9505    
9506    /dog(sbody)??/
9507        dogs\P
9508     0: dog
9509        dogs\P\P
9510     0: dog
9511    
9512    /dog|dogsbody/
9513        dogs\P
9514     0: dog
9515        dogs\P\P
9516     0: dog
9517    
9518    /dogsbody|dog/
9519        dogs\P
9520     0: dog
9521        dogs\P\P
9522    Partial match: dogs
9523    
9524    /\bthe cat\b/
9525        the cat\P
9526     0: the cat
9527        the cat\P\P
9528    Partial match: the cat
9529    
9530    /abc/
9531       abc\P
9532     0: abc
9533       abc\P\P
9534     0: abc
9535    
9536    /\w+A/P
9537       CDAAAAB
9538     0: CDAAAA
9539    
9540    /\w+A/PU
9541       CDAAAAB
9542     0: CDA
9543    
9544    /abc\K123/
9545        xyzabc123pqr
9546     0: 123
9547        xyzabc12\P
9548    Partial match: abc12
9549        xyzabc12\P\P
9550    Partial match: abc12
9551    
9552    /(?<=abc)123/
9553        xyzabc123pqr
9554     0: 123
9555        xyzabc12\P
9556    Partial match: abc12
9557        xyzabc12\P\P
9558    Partial match: abc12
9559    
9560    /\babc\b/
9561        +++abc+++
9562     0: abc
9563        +++ab\P
9564    Partial match: +ab
9565        +++ab\P\P
9566    Partial match: +ab
9567    
9568    /(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/BZ
9569    ------------------------------------------------------------------
9570            Bra
9571            Once
9572            Recurse
9573            Ket
9574            Once
9575            Recurse
9576            Ket
9577            Cond
9578            Cond def
9579            CBra 1
9580            <
9581            [^m]
9582            [^>]
9583            >
9584            [^<]
9585            Ket
9586            CBra 2
9587            \w*+
9588            Ket
9589            Ket
9590            Ket
9591            End
9592    ------------------------------------------------------------------
9593    
9594    /(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/BZ
9595    ------------------------------------------------------------------
9596            Bra
9597            Once
9598            Recurse
9599            Ket
9600            Once
9601            Recurse
9602            Ket
9603            Cond
9604            Cond def
9605            CBra 1
9606            <
9607            [\x00-/:-\xff] (neg)
9608            [^>]
9609            >
9610            [^<]
9611            Ket
9612            CBra 2
9613            \w*+
9614            Ket
9615            Ket
9616            Ket
9617            End
9618    ------------------------------------------------------------------
9619    
9620    /(ab)(x(y)z(cd(*ACCEPT)))pq/BZ
9621    ------------------------------------------------------------------
9622            Bra
9623            CBra 1
9624            ab
9625            Ket
9626            CBra 2
9627            x
9628            CBra 3
9629            y
9630            Ket
9631            z
9632            CBra 4
9633            cd
9634            Close 4
9635            Close 2
9636            *ACCEPT
9637            Ket
9638            Ket
9639            pq
9640            Ket
9641            End
9642    ------------------------------------------------------------------
9643    
9644    /abc\K/+
9645        abcdef
9646     0:
9647     0+ def
9648        abcdef\N\N
9649     0:
9650     0+ def
9651        xyzabcdef\N\N
9652     0:
9653     0+ def
9654        ** Failers
9655    No match
9656        abcdef\N
9657    No match
9658        xyzabcdef\N
9659    No match
9660    
9661    /^(?:(?=abc)|abc\K)/+
9662        abcdef
9663     0:
9664     0+ abcdef
9665        abcdef\N\N
9666     0:
9667     0+ def
9668        ** Failers
9669    No match
9670        abcdef\N
9671    No match
9672    
9673    /a?b?/+
9674        xyz
9675     0:
9676     0+ xyz
9677        xyzabc
9678     0:
9679     0+ xyzabc
9680        xyzabc\N
9681     0: ab
9682     0+ c
9683        xyzabc\N\N
9684     0:
9685     0+ yzabc
9686        xyz\N\N
9687     0:
9688     0+ yz
9689        ** Failers
9690     0:
9691     0+ ** Failers
9692        xyz\N
9693    No match
9694    
9695    /^a?b?/+
9696        xyz
9697     0:
9698     0+ xyz
9699        xyzabc
9700     0:
9701     0+ xyzabc
9702        ** Failers
9703     0:
9704     0+ ** Failers
9705        xyzabc\N
9706    No match
9707        xyzabc\N\N
9708    No match
9709        xyz\N\N
9710    No match
9711        xyz\N
9712    No match
9713    
9714    /^(?<name>a|b\g<name>c)/
9715        aaaa
9716     0: a
9717     1: a
9718        bacxxx
9719     0: bac
9720     1: bac
9721        bbaccxxx
9722     0: bbacc
9723     1: bbacc
9724        bbbacccxx
9725     0: bbbaccc
9726     1: bbbaccc
9727    
9728    /^(?<name>a|b\g'name'c)/
9729        aaaa
9730     0: a
9731     1: a
9732        bacxxx
9733     0: bac
9734     1: bac
9735        bbaccxxx
9736     0: bbacc
9737     1: bbacc
9738        bbbacccxx
9739     0: bbbaccc
9740     1: bbbaccc
9741    
9742    /^(a|b\g<1>c)/
9743        aaaa
9744     0: a
9745     1: a
9746        bacxxx
9747     0: bac
9748     1: bac
9749        bbaccxxx
9750     0: bbacc
9751     1: bbacc
9752        bbbacccxx
9753     0: bbbaccc
9754     1: bbbaccc
9755    
9756    /^(a|b\g'1'c)/
9757        aaaa
9758     0: a
9759     1: a
9760        bacxxx
9761     0: bac
9762     1: bac
9763        bbaccxxx
9764     0: bbacc
9765     1: bbacc
9766        bbbacccxx
9767     0: bbbaccc
9768     1: bbbaccc
9769    
9770    /^(a|b\g'-1'c)/
9771        aaaa
9772     0: a
9773     1: a
9774        bacxxx
9775     0: bac
9776     1: bac
9777        bbaccxxx
9778     0: bbacc
9779     1: bbacc
9780        bbbacccxx
9781     0: bbbaccc
9782     1: bbbaccc
9783    
9784    /(^(a|b\g<-1>c))/
9785        aaaa
9786     0: a
9787     1: a
9788     2: a
9789        bacxxx
9790     0: bac
9791     1: bac
9792     2: bac
9793        bbaccxxx
9794     0: bbacc
9795     1: bbacc
9796     2: bbacc
9797        bbbacccxx
9798     0: bbbaccc
9799     1: bbbaccc
9800     2: bbbaccc
9801    
9802    /(?-i:\g<name>)(?i:(?<name>a))/
9803        XaaX
9804     0: aa
9805     1: a
9806        XAAX
9807     0: AA
9808     1: A
9809    
9810    /(?i:\g<name>)(?-i:(?<name>a))/
9811        XaaX
9812     0: aa
9813     1: a
9814        ** Failers
9815    No match
9816        XAAX
9817    No match
9818    
9819    /(?-i:\g<+1>)(?i:(a))/
9820        XaaX
9821     0: aa
9822     1: a
9823        XAAX
9824     0: AA
9825     1: A
9826    
9827    /(?=(?<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>\})\}))\{/
9828    
9829    /(?<n>a|b|c)\g<n>*/
9830       abc
9831     0: abc
9832     1: a
9833       accccbbb
9834     0: accccbbb
9835     1: a
9836    
9837    /^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/
9838        XYabcdY
9839     0: XYabcdY
9840     1: a
9841     2: b
9842     3: <unset>
9843     4: <unset>
9844     5: c
9845     6: d
9846     7: Y
9847    
9848    /-- End of testinput2 --/

Legend:
Removed from v.426  
changed lines
  Added in v.450

  ViewVC Help
Powered by ViewVC 1.1.5