/[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 428 by ph10, Mon Aug 31 17:10:26 2009 UTC revision 500 by ph10, Sat Mar 6 19:00:29 2010 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 134  Capturing subpattern count = 0 Line 145  Capturing subpattern count = 0
145  No options  No options
146  No first char  No first char
147  No need char  No need char
148    Subject length lower bound = 3
149  Starting byte set: c d e  Starting byte set: c d e
150      this sentence eventually mentions a cat      this sentence eventually mentions a cat
151   0: cat   0: cat
# Line 145  Capturing subpattern count = 0 Line 157  Capturing subpattern count = 0
157  Options: caseless  Options: caseless
158  No first char  No first char
159  No need char  No need char
160    Subject length lower bound = 3
161  Starting byte set: C D E c d e  Starting byte set: C D E c d e
162      this sentence eventually mentions a CAT cat      this sentence eventually mentions a CAT cat
163   0: CAT   0: CAT
# Line 156  Capturing subpattern count = 0 Line 169  Capturing subpattern count = 0
169  No options  No options
170  No first char  No first char
171  No need char  No need char
172    Subject length lower bound = 1
173  Starting byte set: a b c d  Starting byte set: a b c d
174    
175  /(a|[^\dZ])/IS  /(a|[^\dZ])/IS
# Line 163  Capturing subpattern count = 1 Line 177  Capturing subpattern count = 1
177  No options  No options
178  No first char  No first char
179  No need char  No need char
180    Subject length lower bound = 1
181  Starting byte set: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a  Starting byte set: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
182    \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19    \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
183    \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / : ; < = >    \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / : ; < = >
# Line 183  Capturing subpattern count = 1 Line 198  Capturing subpattern count = 1
198  No options  No options
199  No first char  No first char
200  No need char  No need char
201    Subject length lower bound = 1
202  Starting byte set: \x09 \x0a \x0c \x0d \x20 a b  Starting byte set: \x09 \x0a \x0c \x0d \x20 a b
203    
204  /(ab\2)/  /(ab\2)/
# Line 331  No need char Line 347  No need char
347   2: <unset>   2: <unset>
348   3: def   3: def
349    
350  /abc/IP  /abc/P
351      abc      abc
352   0: abc   0: abc
353      *** Failers      *** Failers
354  No match: POSIX code 17: match failed  No match: POSIX code 17: match failed
355    
356  /^abc|def/IP  /^abc|def/P
357      abcdef      abcdef
358   0: abc   0: abc
359      abcdef\B      abcdef\B
360   0: def   0: def
361    
362  /.*((abc)$|(def))/IP  /.*((abc)$|(def))/P
363      defabc      defabc
364   0: defabc   0: defabc
365   1: abc   1: abc
# Line 353  No match: POSIX code 17: match failed Line 369  No match: POSIX code 17: match failed
369   1: def   1: def
370   3: def   3: def
371    
372  /the quick brown fox/IP  /the quick brown fox/P
373      the quick brown fox      the quick brown fox
374   0: the quick brown fox   0: the quick brown fox
375      *** Failers      *** Failers
# Line 361  No match: POSIX code 17: match failed Line 377  No match: POSIX code 17: match failed
377      The Quick Brown Fox      The Quick Brown Fox
378  No match: POSIX code 17: match failed  No match: POSIX code 17: match failed
379    
380  /the quick brown fox/IPi  /the quick brown fox/Pi
381      the quick brown fox      the quick brown fox
382   0: the quick brown fox   0: the quick brown fox
383      The Quick Brown Fox      The Quick Brown Fox
384   0: The Quick Brown Fox   0: The Quick Brown Fox
385    
386  /abc.def/IP  /abc.def/P
387      *** Failers      *** Failers
388  No match: POSIX code 17: match failed  No match: POSIX code 17: match failed
389      abc\ndef      abc\ndef
390  No match: POSIX code 17: match failed  No match: POSIX code 17: match failed
391    
392  /abc$/IP  /abc$/P
393      abc      abc
394   0: abc   0: abc
395      abc\n      abc\n
396   0: abc   0: abc
397    
398  /(abc)\2/IP  /(abc)\2/P
399  Failed: POSIX code 15: bad back reference at offset 7  Failed: POSIX code 15: bad back reference at offset 7
400    
401  /(abc\1)/IP  /(abc\1)/P
402      abc      abc
403  No match: POSIX code 17: match failed  No match: POSIX code 17: match failed
404    
# Line 516  Capturing subpattern count = 0 Line 532  Capturing subpattern count = 0
532  No options  No options
533  No first char  No first char
534  No need char  No need char
535    Subject length lower bound = 1
536  Starting byte set: a b c d  Starting byte set: a b c d
537    
538  /(?i)[abcd]/IS  /(?i)[abcd]/IS
# Line 523  Capturing subpattern count = 0 Line 540  Capturing subpattern count = 0
540  Options: caseless  Options: caseless
541  No first char  No first char
542  No need char  No need char
543    Subject length lower bound = 1
544  Starting byte set: A B C D a b c d  Starting byte set: A B C D a b c d
545    
546  /(?m)[xy]|(b|c)/IS  /(?m)[xy]|(b|c)/IS
# Line 530  Capturing subpattern count = 1 Line 548  Capturing subpattern count = 1
548  Options: multiline  Options: multiline
549  No first char  No first char
550  No need char  No need char
551    Subject length lower bound = 1
552  Starting byte set: b c x y  Starting byte set: b c x y
553    
554  /(^a|^b)/Im  /(^a|^b)/Im
# Line 594  Capturing subpattern count = 1 Line 613  Capturing subpattern count = 1
613  No options  No options
614  First char = 'b' (caseless)  First char = 'b' (caseless)
615  No need char  No need char
616  Study returned NULL  Subject length lower bound = 1
617    No set of starting bytes
618    
619  /(a*b|(?i:c*(?-i)d))/IS  /(a*b|(?i:c*(?-i)d))/IS
620  Capturing subpattern count = 1  Capturing subpattern count = 1
621  No options  No options
622  No first char  No first char
623  No need char  No need char
624    Subject length lower bound = 1
625  Starting byte set: C a b c d  Starting byte set: C a b c d
626    
627  /a$/I  /a$/I
# Line 665  Capturing subpattern count = 0 Line 686  Capturing subpattern count = 0
686  No options  No options
687  No first char  No first char
688  No need char  No need char
689    Subject length lower bound = 1
690  Starting byte set: a b  Starting byte set: a b
691    
692  /(?<!foo)(alpha|omega)/IS  /(?<!foo)(alpha|omega)/IS
# Line 672  Capturing subpattern count = 1 Line 694  Capturing subpattern count = 1
694  No options  No options
695  No first char  No first char
696  Need char = 'a'  Need char = 'a'
697    Subject length lower bound = 5
698  Starting byte set: a o  Starting byte set: a o
699    
700  /(?!alphabet)[ab]/IS  /(?!alphabet)[ab]/IS
# Line 679  Capturing subpattern count = 0 Line 702  Capturing subpattern count = 0
702  No options  No options
703  No first char  No first char
704  No need char  No need char
705    Subject length lower bound = 1
706  Starting byte set: a b  Starting byte set: a b
707    
708  /(?<=foo\n)^bar/Im  /(?<=foo\n)^bar/Im
# Line 833  No match Line 857  No match
857      a      a
858  No match  No match
859    
860  /This one is here because I think Perl 5.005_02 gets the setting of $1 wrong/I  /This one is here because Perl behaves differently; see also the following/I
861  Capturing subpattern count = 0  Capturing subpattern count = 0
862  No options  No options
863  First char = 'T'  First char = 'T'
# Line 845  Max back reference = 1 Line 869  Max back reference = 1
869  Options: anchored  Options: anchored
870  No first char  No first char
871  No need char  No need char
872        aaaa
873    No match
874      aaaaaa      aaaaaa
875   0: aaaaaa  No match
876   1: aa  
877    /Perl does not fail these two for the final subjects. Neither did PCRE until/
878    /release 8.01. The problem is in backtracking into a subpattern that contains/
879    No match
880    /a recursive reference to itself. PCRE has now made these into atomic patterns./
881    No match
882    
883    /^(xa|=?\1a){2}$/
884        xa=xaa
885     0: xa=xaa
886     1: =xaa
887        ** Failers
888    No match
889        xa=xaaa
890    No match
891    
892    /^(xa|=?\1a)+$/
893        xa=xaa
894     0: xa=xaa
895     1: =xaa
896        ** Failers
897    No match
898        xa=xaaa
899    No match
900    
901  /These are syntax tests from Perl 5.005/I  /These are syntax tests from Perl 5.005/I
902  Capturing subpattern count = 0  Capturing subpattern count = 0
# Line 1615  No need char Line 1664  No need char
1664      \Nabc      \Nabc
1665  No match  No match
1666    
1667  /a*(b+)(z)(z)/IP  /a*(b+)(z)(z)/P
1668      aaaabbbbzzzz      aaaabbbbzzzz
1669   0: aaaabbbbzz   0: aaaabbbbzz
1670   1: bbbb   1: bbbb
# Line 1647  Capturing subpattern count = 0 Line 1696  Capturing subpattern count = 0
1696  Options: anchored  Options: anchored
1697  No first char  No first char
1698  Need char = 'd'  Need char = 'd'
1699  Study returned NULL  Subject length lower bound = 4
1700    No set of starting bytes
1701    
1702  /\(             # ( at start  /\(             # ( at start
1703    (?:           # Non-capturing bracket    (?:           # Non-capturing bracket
# Line 1805  Need char = ')' Line 1855  Need char = ')'
1855   0: (abcd(xyz<p>qrs)123)   0: (abcd(xyz<p>qrs)123)
1856   1: abcd(xyz<p>qrs)123   1: abcd(xyz<p>qrs)123
1857   2: 123   2: 123
  3: <unset>  
1858    
1859  /\( ( ( (?>[^()]+) | ((?R)) )* ) \) /Ix  /\( ( ( (?>[^()]+) | ((?R)) )* ) \) /Ix
1860  Capturing subpattern count = 3  Capturing subpattern count = 3
# Line 1880  Capturing subpattern count = 0 Line 1929  Capturing subpattern count = 0
1929  No options  No options
1930  No first char  No first char
1931  No need char  No need char
1932    Subject length lower bound = 1
1933  Starting byte set: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z  Starting byte set: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
1934    _ a b c d e f g h i j k l m n o p q r s t u v w x y z    _ a b c d e f g h i j k l m n o p q r s t u v w x y z
1935    
# Line 1941  Contains explicit CR or LF match Line 1991  Contains explicit CR or LF match
1991  No options  No options
1992  No first char  No first char
1993  No need char  No need char
1994    Subject length lower bound = 1
1995  Starting byte set: \x09 \x0a \x0b \x0c \x0d \x20  Starting byte set: \x09 \x0a \x0b \x0c \x0d \x20
1996    
1997  /^[[:cntrl:]]/DZ  /^[[:cntrl:]]/DZ
# Line 3411  Capturing subpattern count = 0 Line 3462  Capturing subpattern count = 0
3462  No options  No options
3463  No first char  No first char
3464  No need char  No need char
3465    Subject length lower bound = 1
3466  Starting byte set: a b  Starting byte set: a b
3467    
3468  /[^a]/I  /[^a]/I
# Line 3430  Capturing subpattern count = 0 Line 3482  Capturing subpattern count = 0
3482  No options  No options
3483  No first char  No first char
3484  Need char = '6'  Need char = '6'
3485    Subject length lower bound = 4
3486  Starting byte set: 0 1 2 3 4 5 6 7 8 9  Starting byte set: 0 1 2 3 4 5 6 7 8 9
3487    
3488  /a^b/I  /a^b/I
# Line 3463  Capturing subpattern count = 0 Line 3516  Capturing subpattern count = 0
3516  Options: caseless  Options: caseless
3517  No first char  No first char
3518  No need char  No need char
3519    Subject length lower bound = 1
3520  Starting byte set: A B a b  Starting byte set: A B a b
3521    
3522  /[ab](?i)cd/IS  /[ab](?i)cd/IS
# Line 3470  Capturing subpattern count = 0 Line 3524  Capturing subpattern count = 0
3524  No options  No options
3525  No first char  No first char
3526  Need char = 'd' (caseless)  Need char = 'd' (caseless)
3527    Subject length lower bound = 3
3528  Starting byte set: a b  Starting byte set: a b
3529    
3530  /abc(?C)def/I  /abc(?C)def/I
# Line 3820  Capturing subpattern count = 0 Line 3875  Capturing subpattern count = 0
3875  No options  No options
3876  No first char  No first char
3877  No need char  No need char
3878    Subject length lower bound = 1
3879  Starting byte set: a b  Starting byte set: a b
3880    
3881  /(?R)/I  /(?R)/I
# Line 3939  No options Line 3995  No options
3995  First char = 'a'  First char = 'a'
3996  Need char = 'b'  Need char = 'b'
3997    
 /^\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  
   
3998  /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I  /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I
3999  Capturing subpattern count = 2  Capturing subpattern count = 2
4000  Options: anchored  Options: anchored
# Line 4637  Capturing subpattern count = 3 Line 4660  Capturing subpattern count = 3
4660  Options: caseless  Options: caseless
4661  No first char  No first char
4662  Need char = 'g' (caseless)  Need char = 'g' (caseless)
4663  Study returned NULL  Subject length lower bound = 8
4664    No set of starting bytes
4665       Baby Bjorn Active Carrier - With free SHIPPING!!       Baby Bjorn Active Carrier - With free SHIPPING!!
4666   0: Baby Bjorn Active Carrier - With free SHIPPING!!   0: Baby Bjorn Active Carrier - With free SHIPPING!!
4667   1: Baby Bjorn Active Carrier - With free SHIPPING!!   1: Baby Bjorn Active Carrier - With free SHIPPING!!
# Line 4655  Capturing subpattern count = 0 Line 4679  Capturing subpattern count = 0
4679  No options  No options
4680  No first char  No first char
4681  Need char = 'b'  Need char = 'b'
4682  Study returned NULL  Subject length lower bound = 1
4683    No set of starting bytes
4684    
4685  /(a|b)*.?c/ISDZ  /(a|b)*.?c/ISDZ
4686  ------------------------------------------------------------------  ------------------------------------------------------------------
# Line 4675  Capturing subpattern count = 1 Line 4700  Capturing subpattern count = 1
4700  No options  No options
4701  No first char  No first char
4702  Need char = 'c'  Need char = 'c'
4703  Study returned NULL  Subject length lower bound = 1
4704    No set of starting bytes
4705    
4706  /abc(?C255)de(?C)f/DZ  /abc(?C255)de(?C)f/DZ
4707  ------------------------------------------------------------------  ------------------------------------------------------------------
# Line 5458  Capturing subpattern count = 1 Line 5484  Capturing subpattern count = 1
5484  No options  No options
5485  No first char  No first char
5486  No need char  No need char
5487    Subject length lower bound = 1
5488  Starting byte set: a b  Starting byte set: a b
5489  Compiled regex written to testsavedregex  Compiled regex written to testsavedregex
5490  Study data written to testsavedregex  Study data written to testsavedregex
# Line 5478  Capturing subpattern count = 1 Line 5505  Capturing subpattern count = 1
5505  No options  No options
5506  No first char  No first char
5507  No need char  No need char
5508    Subject length lower bound = 1
5509  Starting byte set: a b  Starting byte set: a b
5510  Compiled regex written to testsavedregex  Compiled regex written to testsavedregex
5511  Study data written to testsavedregex  Study data written to testsavedregex
# Line 5548  No match Line 5576  No match
5576      line one\nthis is a line\nbreak in the second line      line one\nthis is a line\nbreak in the second line
5577  No match  No match
5578    
5579  /ab.cd/IP  /ab.cd/P
5580      ab-cd      ab-cd
5581   0: ab-cd   0: ab-cd
5582      ab=cd      ab=cd
# Line 5558  No match: POSIX code 17: match failed Line 5586  No match: POSIX code 17: match failed
5586      ab\ncd      ab\ncd
5587  No match: POSIX code 17: match failed  No match: POSIX code 17: match failed
5588    
5589  /ab.cd/IPs  /ab.cd/Ps
5590      ab-cd      ab-cd
5591   0: ab-cd   0: ab-cd
5592      ab=cd      ab=cd
# Line 5858  No need char Line 5886  No need char
5886      ((this))      ((this))
5887   0: ((this))   0: ((this))
5888    
5889  /a(b)c/IPN  /a(b)c/PN
5890      abc      abc
5891  Matched with REG_NOSUB  Matched with REG_NOSUB
5892    
5893  /a(?P<name>b)c/IPN  /a(?P<name>b)c/PN
5894      abc      abc
5895  Matched with REG_NOSUB  Matched with REG_NOSUB
5896    
# Line 6190  Capturing subpattern count = 0 Line 6218  Capturing subpattern count = 0
6218  No options  No options
6219  No first char  No first char
6220  Need char = ','  Need char = ','
6221    Subject length lower bound = 1
6222  Starting byte set: \x09 \x0a \x0c \x0d \x20 ,  Starting byte set: \x09 \x0a \x0c \x0d \x20 ,
6223      \x0b,\x0b      \x0b,\x0b
6224   0: ,   0: ,
# Line 6494  Capturing subpattern count = 1 Line 6523  Capturing subpattern count = 1
6523  No options  No options
6524  No first char  No first char
6525  No need char  No need char
6526    Subject length lower bound = 1
6527  Starting byte set: C a b c d  Starting byte set: C a b c d
6528    
6529  /()[ab]xyz/IS  /()[ab]xyz/IS
# Line 6501  Capturing subpattern count = 1 Line 6531  Capturing subpattern count = 1
6531  No options  No options
6532  No first char  No first char
6533  Need char = 'z'  Need char = 'z'
6534    Subject length lower bound = 4
6535  Starting byte set: a b  Starting byte set: a b
6536    
6537  /(|)[ab]xyz/IS  /(|)[ab]xyz/IS
# Line 6508  Capturing subpattern count = 1 Line 6539  Capturing subpattern count = 1
6539  No options  No options
6540  No first char  No first char
6541  Need char = 'z'  Need char = 'z'
6542    Subject length lower bound = 4
6543  Starting byte set: a b  Starting byte set: a b
6544    
6545  /(|c)[ab]xyz/IS  /(|c)[ab]xyz/IS
# Line 6515  Capturing subpattern count = 1 Line 6547  Capturing subpattern count = 1
6547  No options  No options
6548  No first char  No first char
6549  Need char = 'z'  Need char = 'z'
6550    Subject length lower bound = 4
6551  Starting byte set: a b c  Starting byte set: a b c
6552    
6553  /(|c?)[ab]xyz/IS  /(|c?)[ab]xyz/IS
# Line 6522  Capturing subpattern count = 1 Line 6555  Capturing subpattern count = 1
6555  No options  No options
6556  No first char  No first char
6557  Need char = 'z'  Need char = 'z'
6558    Subject length lower bound = 4
6559  Starting byte set: a b c  Starting byte set: a b c
6560    
6561  /(d?|c?)[ab]xyz/IS  /(d?|c?)[ab]xyz/IS
# Line 6529  Capturing subpattern count = 1 Line 6563  Capturing subpattern count = 1
6563  No options  No options
6564  No first char  No first char
6565  Need char = 'z'  Need char = 'z'
6566    Subject length lower bound = 4
6567  Starting byte set: a b c d  Starting byte set: a b c d
6568    
6569  /(d?|c)[ab]xyz/IS  /(d?|c)[ab]xyz/IS
# Line 6536  Capturing subpattern count = 1 Line 6571  Capturing subpattern count = 1
6571  No options  No options
6572  No first char  No first char
6573  Need char = 'z'  Need char = 'z'
6574    Subject length lower bound = 4
6575  Starting byte set: a b c d  Starting byte set: a b c d
6576    
6577  /^a*b\d/DZ  /^a*b\d/DZ
# Line 6628  Capturing subpattern count = 1 Line 6664  Capturing subpattern count = 1
6664  No options  No options
6665  No first char  No first char
6666  No need char  No need char
6667    Subject length lower bound = 1
6668  Starting byte set: a b c d  Starting byte set: a b c d
6669    
6670  /(a+|b*)[cd]/IS  /(a+|b*)[cd]/IS
# Line 6635  Capturing subpattern count = 1 Line 6672  Capturing subpattern count = 1
6672  No options  No options
6673  No first char  No first char
6674  No need char  No need char
6675    Subject length lower bound = 1
6676  Starting byte set: a b c d  Starting byte set: a b c d
6677    
6678  /(a*|b+)[cd]/IS  /(a*|b+)[cd]/IS
# Line 6642  Capturing subpattern count = 1 Line 6680  Capturing subpattern count = 1
6680  No options  No options
6681  No first char  No first char
6682  No need char  No need char
6683    Subject length lower bound = 1
6684  Starting byte set: a b c d  Starting byte set: a b c d
6685    
6686  /(a+|b+)[cd]/IS  /(a+|b+)[cd]/IS
# Line 6649  Capturing subpattern count = 1 Line 6688  Capturing subpattern count = 1
6688  No options  No options
6689  No first char  No first char
6690  No need char  No need char
6691    Subject length lower bound = 2
6692  Starting byte set: a b  Starting byte set: a b
6693    
6694  /((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((  /((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
# Line 7454  No match Line 7494  No match
7494          ^          ^
7495          CBra 1          CBra 1
7496          Cond          Cond
7497        2 Cond ref        2 Cond nref
7498          y          y
7499          Ket          Ket
7500          [()]          [()]
# Line 7572  Need char = ':' Line 7612  Need char = ':'
7612   0: abcd:   0: abcd:
7613   1: abcd   1: abcd
7614    
 /(?'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  
   
7615  /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/J  /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/J
7616      adaa      adaa
7617   0: adaa   0: adaa
# Line 7612  No match Line 7638  No match
7638      bddd      bddd
7639  No match  No match
7640    
 /^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)/x  
     abd  
  0: abd  
  1: a  
     ce  
  0: ce  
   
7641  /(?(<bc))/  /(?(<bc))/
7642  Failed: malformed number or name after (?( at offset 6  Failed: malformed number or name after (?( at offset 6
7643    
# Line 7649  Failed: reference to non-existent subpat Line 7668  Failed: reference to non-existent subpat
7668   1: abcabc1Xabc2XabcX   1: abcabc1Xabc2XabcX
7669   2: abcabc1Xabc2XabcX   2: abcabc1Xabc2XabcX
7670    
 /^(?(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>  
   
7671  /^(?(DEFINE) abc | xyz ) /x  /^(?(DEFINE) abc | xyz ) /x
7672  Failed: DEFINE group contains more than one branch at offset 22  Failed: DEFINE group contains more than one branch at offset 22
7673    
# Line 7844  Need char = 'P' Line 7845  Need char = 'P'
7845   0: PXP   0: PXP
7846   1: P   1: P
7847    
 /(?(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  
   
7848  /(?:a(?&abc)b)*(?<abc>x)/  /(?:a(?&abc)b)*(?<abc>x)/
7849      123axbaxbaxbx456      123axbaxbaxbx456
7850   0: axbaxbaxbx   0: axbaxbaxbx
# Line 7921  No match Line 7882  No match
7882     DEFabcABCXYZ     DEFabcABCXYZ
7883  No match  No match
7884    
 /^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/  
     ababababbbabZXXXX  
  0: ababababbbabZ  
  1: ab  
  2: b  
   
7885  /^(a)\g-2/  /^(a)\g-2/
7886  Failed: reference to non-existent subpattern at offset 7  Failed: reference to non-existent subpattern at offset 7
7887    
# Line 8182  Failed: reference to non-existent subpat Line 8137  Failed: reference to non-existent subpat
8137   0: Y!   0: Y!
8138   1: !   1: !
8139    
 /(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  
   
8140  /(?<A>tom|bon)-\k{A}/  /(?<A>tom|bon)-\k{A}/
8141      tom-tom      tom-tom
8142   0: tom-tom   0: tom-tom
# Line 8214  No match Line 8149  No match
8149      tom-bon      tom-bon
8150  No match  No match
8151    
 /(?<A>tom|bon)-\g{A}/  
     tom-tom  
  0: tom-tom  
  1: tom  
     bon-bon  
  0: bon-bon  
  1: bon  
   
8152  /\g{A/  /\g{A/
8153  Failed: syntax error in subpattern name (missing terminator) at offset 4  Failed: syntax error in subpattern name (missing terminator) at offset 4
8154    
# Line 8316  Failed: syntax error in subpattern name Line 8243  Failed: syntax error in subpattern name
8243   3: <unset>   3: <unset>
8244   4: x   4: x
8245    
 /(?|(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  
   
8246  /[\h]/BZ  /[\h]/BZ
8247  ------------------------------------------------------------------  ------------------------------------------------------------------
8248          Bra          Bra
# Line 8688  Failed: missing terminating ] for charac Line 8539  Failed: missing terminating ] for charac
8539          End          End
8540  ------------------------------------------------------------------  ------------------------------------------------------------------
8541    
 /^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  
   
8542  /^a+(*FAIL)/C  /^a+(*FAIL)/C
8543      aaaaaa      aaaaaa
8544  --->aaaaaa  --->aaaaaa
# Line 9240  Failed: unknown POSIX class name at offs Line 9010  Failed: unknown POSIX class name at offs
9010  /[[:a\dz:]]/  /[[:a\dz:]]/
9011  Failed: unknown POSIX class name at offset 3  Failed: unknown POSIX class name at offset 3
9012    
9013  /^(?<name>a|b\g<name>c)/  /(^(a|b\g<-1'c))/
9014      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  
9015    
9016  /^(?<name>a|b\g'name'c)/  /^(?+1)(?<a>x|y){0}z/
9017      aaaa      xzxx
9018   0: a   0: xz
9019   1: a      yzyy
9020      bacxxx   0: yz
9021   0: bac      ** Failers
9022   1: bac  No match
9023      bbaccxxx      xxz
9024   0: bbacc  No match
  1: bbacc  
     bbbacccxx  
  0: bbbaccc  
  1: bbbaccc  
9025    
9026  /^(a|b\g<1>c)/  /(\3)(\1)(a)/
9027      aaaa      cat
9028   0: a  No match
  1: a  
     bacxxx  
  0: bac  
  1: bac  
     bbaccxxx  
  0: bbacc  
  1: bbacc  
     bbbacccxx  
  0: bbbaccc  
  1: bbbaccc  
9029    
9030  /^(a|b\g'1'c)/  /(\3)(\1)(a)/<JS>
9031      aaaa      cat
9032   0: a   0: a
9033   1: a   1:
9034      bacxxx   2:
9035   0: bac   3: a
9036   1: bac  
9037      bbaccxxx  /TA]/
9038   0: bbacc      The ACTA] comes
9039   1: bbacc   0: TA]
     bbbacccxx  
  0: bbbaccc  
  1: bbbaccc  
9040    
9041  /^(a|b\g'-1'c)/  /TA]/<JS>
9042      aaaa  Failed: ] is an invalid data character in JavaScript compatibility mode at offset 2
  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  
   
 /(^(a|b\g<-1'c))/  
 Failed: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number at offset 15  
   
 /(^(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  
   
 /^(?+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  
9043    
9044  /(?2)[]a()b](abc)/  /(?2)[]a()b](abc)/
9045  Failed: reference to non-existent subpattern at offset 3  Failed: reference to non-existent subpattern at offset 3
# Line 9491  Capturing subpattern count = 1 Line 9132  Capturing subpattern count = 1
9132  No options  No options
9133  No first char  No first char
9134  No need char  No need char
9135    Subject length lower bound = 1
9136  Starting byte set: x y z  Starting byte set: x y z
9137    
9138  /(?(?=.*b)b|^)/CI  /(?(?=.*b)b|^)/CI
# Line 9638  No match Line 9280  No match
9280   0: "ab"   0: "ab"
9281   1:   1:
9282    
 /^X(?5)(a)(?|(b)|(q))(c)(d)(Y)/  
     XYabcdY  
  0: XYabcdY  
  1: a  
  2: b  
  3: c  
  4: d  
  5: Y  
   
9283  /^X(?5)(a)(?|(b)|(q))(c)(d)Y/  /^X(?5)(a)(?|(b)|(q))(c)(d)Y/
9284  Failed: reference to non-existent subpattern at offset 5  Failed: reference to non-existent subpattern at offset 5
9285    
# Line 9659  Failed: reference to non-existent subpat Line 9292  Failed: reference to non-existent subpat
9292   4: d   4: d
9293   5: Y   5: Y
9294    
 /^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  
   
9295  /Xa{2,4}b/  /Xa{2,4}b/
9296      X\P      X\P
9297  Partial match: X  Partial match: X
# Line 9963  Partial match: the cat Line 9563  Partial match: the cat
9563   0: abc   0: abc
9564     abc\P\P     abc\P\P
9565   0: abc   0: abc
9566    
9567    /\w+A/P
9568       CDAAAAB
9569     0: CDAAAA
9570    
9571    /\w+A/PU
9572       CDAAAAB
9573     0: CDA
9574    
9575    /abc\K123/
9576        xyzabc123pqr
9577     0: 123
9578        xyzabc12\P
9579    Partial match: abc12
9580        xyzabc12\P\P
9581    Partial match: abc12
9582    
9583    /(?<=abc)123/
9584        xyzabc123pqr
9585     0: 123
9586        xyzabc12\P
9587    Partial match: abc12
9588        xyzabc12\P\P
9589    Partial match: abc12
9590    
9591    /\babc\b/
9592        +++abc+++
9593     0: abc
9594        +++ab\P
9595    Partial match: +ab
9596        +++ab\P\P
9597    Partial match: +ab
9598    
9599    /(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/BZ
9600    ------------------------------------------------------------------
9601            Bra
9602            Once
9603            Recurse
9604            Ket
9605            Once
9606            Recurse
9607            Ket
9608            Cond
9609            Cond def
9610            CBra 1
9611            <
9612            [^m]
9613            [^>]
9614            >
9615            [^<]
9616            Ket
9617            CBra 2
9618            \w*+
9619            Ket
9620            Ket
9621            Ket
9622            End
9623    ------------------------------------------------------------------
9624    
9625    /(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/BZ
9626    ------------------------------------------------------------------
9627            Bra
9628            Once
9629            Recurse
9630            Ket
9631            Once
9632            Recurse
9633            Ket
9634            Cond
9635            Cond def
9636            CBra 1
9637            <
9638            [\x00-/:-\xff] (neg)
9639            [^>]
9640            >
9641            [^<]
9642            Ket
9643            CBra 2
9644            \w*+
9645            Ket
9646            Ket
9647            Ket
9648            End
9649    ------------------------------------------------------------------
9650    
9651    /(ab)(x(y)z(cd(*ACCEPT)))pq/BZ
9652    ------------------------------------------------------------------
9653            Bra
9654            CBra 1
9655            ab
9656            Ket
9657            CBra 2
9658            x
9659            CBra 3
9660            y
9661            Ket
9662            z
9663            CBra 4
9664            cd
9665            Close 4
9666            Close 2
9667            *ACCEPT
9668            Ket
9669            Ket
9670            pq
9671            Ket
9672            End
9673    ------------------------------------------------------------------
9674    
9675    /abc\K/+
9676        abcdef
9677     0:
9678     0+ def
9679        abcdef\N\N
9680     0:
9681     0+ def
9682        xyzabcdef\N\N
9683     0:
9684     0+ def
9685        ** Failers
9686    No match
9687        abcdef\N
9688    No match
9689        xyzabcdef\N
9690    No match
9691    
9692    /^(?:(?=abc)|abc\K)/+
9693        abcdef
9694     0:
9695     0+ abcdef
9696        abcdef\N\N
9697     0:
9698     0+ def
9699        ** Failers
9700    No match
9701        abcdef\N
9702    No match
9703    
9704    /a?b?/+
9705        xyz
9706     0:
9707     0+ xyz
9708        xyzabc
9709     0:
9710     0+ xyzabc
9711        xyzabc\N
9712     0: ab
9713     0+ c
9714        xyzabc\N\N
9715     0:
9716     0+ yzabc
9717        xyz\N\N
9718     0:
9719     0+ yz
9720        ** Failers
9721     0:
9722     0+ ** Failers
9723        xyz\N
9724    No match
9725    
9726    /^a?b?/+
9727        xyz
9728     0:
9729     0+ xyz
9730        xyzabc
9731     0:
9732     0+ xyzabc
9733        ** Failers
9734     0:
9735     0+ ** Failers
9736        xyzabc\N
9737    No match
9738        xyzabc\N\N
9739    No match
9740        xyz\N\N
9741    No match
9742        xyz\N
9743    No match
9744    
9745    /^(?<name>a|b\g<name>c)/
9746        aaaa
9747     0: a
9748     1: a
9749        bacxxx
9750     0: bac
9751     1: bac
9752        bbaccxxx
9753     0: bbacc
9754     1: bbacc
9755        bbbacccxx
9756     0: bbbaccc
9757     1: bbbaccc
9758    
9759    /^(?<name>a|b\g'name'c)/
9760        aaaa
9761     0: a
9762     1: a
9763        bacxxx
9764     0: bac
9765     1: bac
9766        bbaccxxx
9767     0: bbacc
9768     1: bbacc
9769        bbbacccxx
9770     0: bbbaccc
9771     1: bbbaccc
9772    
9773    /^(a|b\g<1>c)/
9774        aaaa
9775     0: a
9776     1: a
9777        bacxxx
9778     0: bac
9779     1: bac
9780        bbaccxxx
9781     0: bbacc
9782     1: bbacc
9783        bbbacccxx
9784     0: bbbaccc
9785     1: bbbaccc
9786    
9787    /^(a|b\g'1'c)/
9788        aaaa
9789     0: a
9790     1: a
9791        bacxxx
9792     0: bac
9793     1: bac
9794        bbaccxxx
9795     0: bbacc
9796     1: bbacc
9797        bbbacccxx
9798     0: bbbaccc
9799     1: bbbaccc
9800    
9801    /^(a|b\g'-1'c)/
9802        aaaa
9803     0: a
9804     1: a
9805        bacxxx
9806     0: bac
9807     1: bac
9808        bbaccxxx
9809     0: bbacc
9810     1: bbacc
9811        bbbacccxx
9812     0: bbbaccc
9813     1: bbbaccc
9814    
9815    /(^(a|b\g<-1>c))/
9816        aaaa
9817     0: a
9818     1: a
9819     2: a
9820        bacxxx
9821     0: bac
9822     1: bac
9823     2: bac
9824        bbaccxxx
9825     0: bbacc
9826     1: bbacc
9827     2: bbacc
9828        bbbacccxx
9829     0: bbbaccc
9830     1: bbbaccc
9831     2: bbbaccc
9832    
9833    /(?-i:\g<name>)(?i:(?<name>a))/
9834        XaaX
9835     0: aa
9836     1: a
9837        XAAX
9838     0: AA
9839     1: A
9840    
9841    /(?i:\g<name>)(?-i:(?<name>a))/
9842        XaaX
9843     0: aa
9844     1: a
9845        ** Failers
9846    No match
9847        XAAX
9848    No match
9849    
9850    /(?-i:\g<+1>)(?i:(a))/
9851        XaaX
9852     0: aa
9853     1: a
9854        XAAX
9855     0: AA
9856     1: A
9857    
9858    /(?=(?<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>\})\}))\{/
9859    
9860    /(?<n>a|b|c)\g<n>*/
9861       abc
9862     0: abc
9863     1: a
9864       accccbbb
9865     0: accccbbb
9866     1: a
9867    
9868    /^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/
9869        XYabcdY
9870     0: XYabcdY
9871     1: a
9872     2: b
9873     3: <unset>
9874     4: <unset>
9875     5: c
9876     6: d
9877     7: Y
9878    
9879    /(?<=b(?1)|zzz)(a)/
9880        xbaax
9881     0: a
9882     1: a
9883        xzzzax
9884     0: a
9885     1: a
9886    
9887    /(a)(?<=b\1)/
9888    Failed: lookbehind assertion is not fixed length at offset 10
9889    
9890    /(a)(?<=b+(?1))/
9891    Failed: lookbehind assertion is not fixed length at offset 13
9892    
9893    /(a+)(?<=b(?1))/
9894    Failed: lookbehind assertion is not fixed length at offset 14
9895    
9896    /(a(?<=b(?1)))/
9897    Failed: lookbehind assertion is not fixed length at offset 13
9898    
9899    /(?<=b(?1))xyz/
9900    Failed: reference to non-existent subpattern at offset 8
9901    
9902    /(?<=b(?1))xyz(b+)pqrstuvew/
9903    Failed: lookbehind assertion is not fixed length at offset 26
9904    
9905    /(a|bc)\1/SI
9906    Capturing subpattern count = 1
9907    Max back reference = 1
9908    No options
9909    No first char
9910    No need char
9911    Subject length lower bound = 2
9912    Starting byte set: a b
9913    
9914    /(a|bc)\1{2,3}/SI
9915    Capturing subpattern count = 1
9916    Max back reference = 1
9917    No options
9918    No first char
9919    No need char
9920    Subject length lower bound = 3
9921    Starting byte set: a b
9922    
9923    /(a|bc)(?1)/SI
9924    Capturing subpattern count = 1
9925    No options
9926    No first char
9927    No need char
9928    Subject length lower bound = 2
9929    Starting byte set: a b
9930    
9931    /(a|b\1)(a|b\1)/SI
9932    Capturing subpattern count = 2
9933    Max back reference = 1
9934    No options
9935    No first char
9936    No need char
9937    Subject length lower bound = 2
9938    Starting byte set: a b
9939    
9940    /(a|b\1){2}/SI
9941    Capturing subpattern count = 1
9942    Max back reference = 1
9943    No options
9944    No first char
9945    No need char
9946    Subject length lower bound = 2
9947    Starting byte set: a b
9948    
9949    /(a|bbbb\1)(a|bbbb\1)/SI
9950    Capturing subpattern count = 2
9951    Max back reference = 1
9952    No options
9953    No first char
9954    No need char
9955    Subject length lower bound = 2
9956    Starting byte set: a b
9957    
9958    /(a|bbbb\1){2}/SI
9959    Capturing subpattern count = 1
9960    Max back reference = 1
9961    No options
9962    No first char
9963    No need char
9964    Subject length lower bound = 2
9965    Starting byte set: a b
9966    
9967    /^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
9968    Capturing subpattern count = 1
9969    Options: anchored
9970    No first char
9971    Need char = ':'
9972    Subject length lower bound = 22
9973    No set of starting bytes
9974    
9975    /  (?: [\040\t] |  \(
9976    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
9977    \)  )*                          # optional leading comment
9978    (?:    (?:
9979    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
9980    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
9981    |
9982    " (?:                      # opening quote...
9983    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
9984    |                     #    or
9985    \\ [^\x80-\xff]           #   Escaped something (something != CR)
9986    )* "  # closing quote
9987    )                    # initial word
9988    (?:  (?: [\040\t] |  \(
9989    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
9990    \)  )*  \.  (?: [\040\t] |  \(
9991    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
9992    \)  )*   (?:
9993    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
9994    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
9995    |
9996    " (?:                      # opening quote...
9997    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
9998    |                     #    or
9999    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10000    )* "  # closing quote
10001    )  )* # further okay, if led by a period
10002    (?: [\040\t] |  \(
10003    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10004    \)  )*  @  (?: [\040\t] |  \(
10005    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10006    \)  )*    (?:
10007    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10008    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10009    |   \[                         # [
10010    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10011    \]                        #           ]
10012    )                           # initial subdomain
10013    (?:                                  #
10014    (?: [\040\t] |  \(
10015    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10016    \)  )*  \.                        # if led by a period...
10017    (?: [\040\t] |  \(
10018    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10019    \)  )*   (?:
10020    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10021    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10022    |   \[                         # [
10023    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10024    \]                        #           ]
10025    )                     #   ...further okay
10026    )*
10027    # address
10028    |                     #  or
10029    (?:
10030    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10031    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10032    |
10033    " (?:                      # opening quote...
10034    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
10035    |                     #    or
10036    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10037    )* "  # closing quote
10038    )             # one word, optionally followed by....
10039    (?:
10040    [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037]  |  # atom and space parts, or...
10041    \(
10042    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10043    \)       |  # comments, or...
10044    
10045    " (?:                      # opening quote...
10046    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
10047    |                     #    or
10048    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10049    )* "  # closing quote
10050    # quoted strings
10051    )*
10052    <  (?: [\040\t] |  \(
10053    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10054    \)  )*                     # leading <
10055    (?:  @  (?: [\040\t] |  \(
10056    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10057    \)  )*    (?:
10058    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10059    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10060    |   \[                         # [
10061    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10062    \]                        #           ]
10063    )                           # initial subdomain
10064    (?:                                  #
10065    (?: [\040\t] |  \(
10066    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10067    \)  )*  \.                        # if led by a period...
10068    (?: [\040\t] |  \(
10069    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10070    \)  )*   (?:
10071    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10072    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10073    |   \[                         # [
10074    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10075    \]                        #           ]
10076    )                     #   ...further okay
10077    )*
10078    
10079    (?:  (?: [\040\t] |  \(
10080    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10081    \)  )*  ,  (?: [\040\t] |  \(
10082    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10083    \)  )*  @  (?: [\040\t] |  \(
10084    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10085    \)  )*    (?:
10086    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10087    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10088    |   \[                         # [
10089    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10090    \]                        #           ]
10091    )                           # initial subdomain
10092    (?:                                  #
10093    (?: [\040\t] |  \(
10094    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10095    \)  )*  \.                        # if led by a period...
10096    (?: [\040\t] |  \(
10097    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10098    \)  )*   (?:
10099    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10100    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10101    |   \[                         # [
10102    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10103    \]                        #           ]
10104    )                     #   ...further okay
10105    )*
10106    )* # further okay, if led by comma
10107    :                                # closing colon
10108    (?: [\040\t] |  \(
10109    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10110    \)  )*  )? #       optional route
10111    (?:
10112    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10113    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10114    |
10115    " (?:                      # opening quote...
10116    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
10117    |                     #    or
10118    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10119    )* "  # closing quote
10120    )                    # initial word
10121    (?:  (?: [\040\t] |  \(
10122    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10123    \)  )*  \.  (?: [\040\t] |  \(
10124    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10125    \)  )*   (?:
10126    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10127    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10128    |
10129    " (?:                      # opening quote...
10130    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
10131    |                     #    or
10132    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10133    )* "  # closing quote
10134    )  )* # further okay, if led by a period
10135    (?: [\040\t] |  \(
10136    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10137    \)  )*  @  (?: [\040\t] |  \(
10138    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10139    \)  )*    (?:
10140    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10141    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10142    |   \[                         # [
10143    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10144    \]                        #           ]
10145    )                           # initial subdomain
10146    (?:                                  #
10147    (?: [\040\t] |  \(
10148    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10149    \)  )*  \.                        # if led by a period...
10150    (?: [\040\t] |  \(
10151    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10152    \)  )*   (?:
10153    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10154    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10155    |   \[                         # [
10156    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10157    \]                        #           ]
10158    )                     #   ...further okay
10159    )*
10160    #       address spec
10161    (?: [\040\t] |  \(
10162    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10163    \)  )*  > #                  trailing >
10164    # name and address
10165    )  (?: [\040\t] |  \(
10166    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10167    \)  )*                       # optional trailing comment
10168    /xSI
10169    Capturing subpattern count = 0
10170    Contains explicit CR or LF match
10171    Options: extended
10172    No first char
10173    No need char
10174    Subject length lower bound = 3
10175    Starting byte set: \x09 \x20 ! " # $ % & ' ( * + - / 0 1 2 3 4 5 6 7 8
10176      9 = ? A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ^ _ ` a b c d e
10177      f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f
10178    
10179    /<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
10180    Capturing subpattern count = 11
10181    Options: caseless dotall
10182    First char = '<'
10183    Need char = '>'
10184    Subject length lower bound = 47
10185    No set of starting bytes
10186    
10187    "(?>.*/)foo"SI
10188    Capturing subpattern count = 0
10189    No options
10190    First char at start or follows newline
10191    Need char = 'o'
10192    Subject length lower bound = 4
10193    No set of starting bytes
10194    
10195    /(?(?=[^a-z]+[a-z])  \d{2}-[a-z]{3}-\d{2}  |  \d{2}-\d{2}-\d{2} ) /xSI
10196    Capturing subpattern count = 0
10197    Options: extended
10198    No first char
10199    Need char = '-'
10200    Subject length lower bound = 8
10201    No set of starting bytes
10202    
10203    /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/iSI
10204    Capturing subpattern count = 1
10205    Options: caseless
10206    No first char
10207    No need char
10208    Subject length lower bound = 1
10209    Starting byte set: A B C a b c
10210    
10211    /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/SI
10212    Capturing subpattern count = 0
10213    No options
10214    No first char
10215    Need char = 'b'
10216    Subject length lower bound = 41
10217    Starting byte set: c d
10218    
10219    /<a[\s]+href[\s]*=[\s]*          # find <a href=
10220     ([\"\'])?                       # find single or double quote
10221     (?(1) (.*?)\1 | ([^\s]+))       # if quote found, match up to next matching
10222                                     # quote, otherwise match up to next space
10223    /isxSI
10224    Capturing subpattern count = 3
10225    Max back reference = 1
10226    Options: caseless extended dotall
10227    First char = '<'
10228    Need char = '='
10229    Subject length lower bound = 9
10230    No set of starting bytes
10231    
10232    /^(?!:)                       # colon disallowed at start
10233      (?:                         # start of item
10234        (?: [0-9a-f]{1,4} |       # 1-4 hex digits or
10235        (?(1)0 | () ) )           # if null previously matched, fail; else null
10236        :                         # followed by colon
10237      ){1,7}                      # end item; 1-7 of them required
10238      [0-9a-f]{1,4} $             # final hex number at end of string
10239      (?(1)|.)                    # check that there was an empty component
10240      /xiIS
10241    Capturing subpattern count = 1
10242    Options: anchored caseless extended
10243    No first char
10244    Need char = ':'
10245    Subject length lower bound = 2
10246    No set of starting bytes
10247    
10248    /(?|(?<a>A)|(?<a>B))/I
10249    Capturing subpattern count = 1
10250    Named capturing subpatterns:
10251      a   1
10252      a   1
10253    No options
10254    No first char
10255    No need char
10256        AB\Ca
10257     0: A
10258     1: A
10259      C A (1) a
10260        BA\Ca
10261     0: B
10262     1: B
10263      C B (1) a
10264    
10265    /(?|(?<a>A)|(?<b>B))/
10266    Failed: different names for subpatterns of the same number are not allowed at offset 15
10267    
10268    /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |
10269        b(?<quote> (?<apostrophe>')|(?<realquote>")) )
10270        (?('quote')[a-z]+|[0-9]+)/JIx
10271    Capturing subpattern count = 6
10272    Named capturing subpatterns:
10273      apostrophe   2
10274      apostrophe   5
10275      quote        1
10276      quote        4
10277      realquote    3
10278      realquote    6
10279    Options: extended dupnames
10280    No first char
10281    No need char
10282        a"aaaaa
10283     0: a"aaaaa
10284     1: "
10285     2: <unset>
10286     3: "
10287        b"aaaaa
10288     0: b"aaaaa
10289     1: <unset>
10290     2: <unset>
10291     3: <unset>
10292     4: "
10293     5: <unset>
10294     6: "
10295        ** Failers
10296    No match
10297        b"11111
10298    No match
10299        a"11111
10300    No match
10301    
10302    /^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/JDZx
10303    ------------------------------------------------------------------
10304            Bra
10305            ^
10306            Bra
10307            CBra 1
10308            a
10309            Ket
10310            CBra 2
10311            b
10312            Ket
10313            CBra 3
10314            c
10315            Ket
10316            CBra 4
10317            d
10318            Ket
10319            Alt
10320            CBra 1
10321            e
10322            Ket
10323            Ket
10324            Cond
10325          4 Cond nref
10326            X
10327            Alt
10328            Y
10329            Ket
10330            Ket
10331            End
10332    ------------------------------------------------------------------
10333    Capturing subpattern count = 4
10334    Named capturing subpatterns:
10335      D   4
10336      D   1
10337    Options: anchored extended dupnames
10338    No first char
10339    No need char
10340        abcdX
10341     0: abcdX
10342     1: a
10343     2: b
10344     3: c
10345     4: d
10346        eX
10347     0: eX
10348     1: e
10349        ** Failers
10350    No match
10351        abcdY
10352    No match
10353        ey
10354    No match
10355    
10356    /(?<A>a) (b)(c)  (?<A>d  (?(R&A)$ | (?4)) )/JDZx
10357    ------------------------------------------------------------------
10358            Bra
10359            CBra 1
10360            a
10361            Ket
10362            CBra 2
10363            b
10364            Ket
10365            CBra 3
10366            c
10367            Ket
10368            CBra 4
10369            d
10370            Cond
10371            Cond nrecurse 1
10372            $
10373            Alt
10374            Once
10375            Recurse
10376            Ket
10377            Ket
10378            Ket
10379            Ket
10380            End
10381    ------------------------------------------------------------------
10382    Capturing subpattern count = 4
10383    Named capturing subpatterns:
10384      A   1
10385      A   4
10386    Options: extended dupnames
10387    First char = 'a'
10388    Need char = 'd'
10389        abcdd
10390     0: abcdd
10391     1: a
10392     2: b
10393     3: c
10394     4: dd
10395        ** Failers
10396    No match
10397        abcdde
10398    No match
10399    
10400    /abcd*/
10401        xxxxabcd\P
10402     0: abcd
10403        xxxxabcd\P\P
10404    Partial match: abcd
10405    
10406    /abcd*/i
10407        xxxxabcd\P
10408     0: abcd
10409        xxxxabcd\P\P
10410    Partial match: abcd
10411        XXXXABCD\P
10412     0: ABCD
10413        XXXXABCD\P\P
10414    Partial match: ABCD
10415    
10416    /abc\d*/
10417        xxxxabc1\P
10418     0: abc1
10419        xxxxabc1\P\P
10420    Partial match: abc1
10421    
10422    /(a)bc\1*/
10423        xxxxabca\P
10424     0: abca
10425     1: a
10426        xxxxabca\P\P
10427    Partial match: abca
10428    
10429    /abc[de]*/
10430        xxxxabcde\P
10431     0: abcde
10432        xxxxabcde\P\P
10433    Partial match: abcde
10434    
10435    /-- This is not in the Perl 5.10 test because Perl seems currently to be broken
10436        and not behaving as specified in that it *does* bumpalong after hitting
10437        (*COMMIT). --/
10438    
10439    /(?1)(A(*COMMIT)|B)D/
10440        ABD
10441     0: ABD
10442     1: B
10443        XABD
10444     0: ABD
10445     1: B
10446        BAD
10447     0: BAD
10448     1: A
10449        ABXABD
10450     0: ABD
10451     1: B
10452        ** Failers
10453    No match
10454        ABX
10455    No match
10456        BAXBAD
10457    No match
10458    
10459    /(\3)(\1)(a)/<JS>
10460        cat
10461     0: a
10462     1:
10463     2:
10464     3: a
10465    
10466    /(\3)(\1)(a)/SI<JS>
10467    Capturing subpattern count = 3
10468    Max back reference = 3
10469    Options:
10470    No first char
10471    Need char = 'a'
10472    Subject length lower bound = 1
10473    No set of starting bytes
10474        cat
10475     0: a
10476     1:
10477     2:
10478     3: a
10479    
10480    /(\3)(\1)(a)/SI
10481    Capturing subpattern count = 3
10482    Max back reference = 3
10483    No options
10484    No first char
10485    Need char = 'a'
10486    Subject length lower bound = 3
10487    No set of starting bytes
10488        cat
10489    No match
10490    
10491    /i(?(DEFINE)(?<s>a))/SI
10492    Capturing subpattern count = 1
10493    Named capturing subpatterns:
10494      s   1
10495    No options
10496    First char = 'i'
10497    No need char
10498    Subject length lower bound = 1
10499    No set of starting bytes
10500        i
10501     0: i
10502    
10503    /()i(?(1)a)/SI
10504    Capturing subpattern count = 1
10505    No options
10506    No first char
10507    Need char = 'i'
10508    Subject length lower bound = 1
10509    Starting byte set: i
10510        ia
10511     0: ia
10512     1:
10513    
10514    /(?i)a(?-i)b|c/BZ
10515    ------------------------------------------------------------------
10516            Bra
10517         NC a
10518         00 Opt
10519            b
10520            Alt
10521         00 Opt
10522            c
10523            Ket
10524            End
10525    ------------------------------------------------------------------
10526        XabX
10527     0: ab
10528        XAbX
10529     0: Ab
10530        CcC
10531     0: c
10532        ** Failers
10533    No match
10534        XABX
10535    No match
10536    
10537    /(?i)a(?s)b|c/BZ
10538    ------------------------------------------------------------------
10539            Bra
10540         NC a
10541         05 Opt
10542         NC b
10543            Alt
10544         05 Opt
10545         NC c
10546            Ket
10547            End
10548    ------------------------------------------------------------------
10549    
10550    /(?i)a(?s-i)b|c/BZ
10551    ------------------------------------------------------------------
10552            Bra
10553         NC a
10554         04 Opt
10555            b
10556            Alt
10557         04 Opt
10558            c
10559            Ket
10560            End
10561    ------------------------------------------------------------------
10562    
10563    /^(ab(c\1)d|x){2}$/BZ
10564    ------------------------------------------------------------------
10565            Bra
10566            ^
10567            Once
10568            CBra 1
10569            ab
10570            CBra 2
10571            c
10572            \1
10573            Ket
10574            d
10575            Alt
10576            x
10577            Ket
10578            Ket
10579            Once
10580            CBra 1
10581            ab
10582            CBra 2
10583            c
10584            \1
10585            Ket
10586            d
10587            Alt
10588            x
10589            Ket
10590            Ket
10591            $
10592            Ket
10593            End
10594    ------------------------------------------------------------------
10595        xabcxd
10596     0: xabcxd
10597     1: abcxd
10598     2: cx
10599    
10600    /^(?&t)*+(?(DEFINE)(?<t>.))$/BZ
10601    ------------------------------------------------------------------
10602            Bra
10603            ^
10604            Once
10605            Brazero
10606            Once
10607            Recurse
10608            KetRmax
10609            Ket
10610            Cond
10611            Cond def
10612            CBra 1
10613            Any
10614            Ket
10615            Ket
10616            $
10617            Ket
10618            End
10619    ------------------------------------------------------------------
10620    
10621    /^(?&t)*(?(DEFINE)(?<t>.))$/BZ
10622    ------------------------------------------------------------------
10623            Bra
10624            ^
10625            Brazero
10626            Once
10627            Recurse
10628            KetRmax
10629            Cond
10630            Cond def
10631            CBra 1
10632            Any
10633            Ket
10634            Ket
10635            $
10636            Ket
10637            End
10638    ------------------------------------------------------------------
10639    
10640    / -- The first four of these are not in the Perl 5.10 test because Perl
10641         documents that the use of \K in assertions is "not well defined". The
10642         last is here because Perl gives the match as "b" rather than "ab". I
10643         believe this to be a Perl bug. --/
10644    
10645    /(?=a\Kb)ab/
10646        ab
10647     0: b
10648    
10649    /(?!a\Kb)ac/
10650        ac
10651     0: ac
10652    
10653    /^abc(?<=b\Kc)d/
10654        abcd
10655     0: cd
10656    
10657    /^abc(?<!b\Kq)d/
10658        abcd
10659     0: abcd
10660    
10661    /(?>a\Kb)z|(ab)/
10662        ab
10663     0: ab
10664     1: ab
10665    
10666    /----------------------/
10667    
10668  / End of testinput2 /  /-- End of testinput2 --/

Legend:
Removed from v.428  
changed lines
  Added in v.500

  ViewVC Help
Powered by ViewVC 1.1.5