/[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 450 by ph10, Wed Sep 16 10:56:40 2009 UTC revision 578 by ph10, Tue Nov 23 15:34:55 2010 UTC
# Line 2  Line 2 
2      of PCRE's API, error diagnostics, and the compiled code of some patterns.      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,      It also checks the non-Perl syntax the PCRE supports (Python, .NET,
4      Oniguruma). Finally, there are some tests where PCRE and Perl differ,      Oniguruma). Finally, there are some tests where PCRE and Perl differ,
5      either because PCRE can't be compatible, or there is potential Perl      either because PCRE can't be compatible, or there is a possible Perl
6      bug. --/      bug. --/
7    
8  /-- Originally, the Perl 5.10 things were in here too, but now I have separated  /-- Originally, the Perl >= 5.10 things were in here too, but now I have
9      many (most?) of them out into test 11. However, there may still be some      separated many (most?) of them out into test 11. However, there may still
10      that were overlooked. --/      be some that were overlooked. --/
11    
12  /(a)b|/I  /(a)b|/I
13  Capturing subpattern count = 1  Capturing subpattern count = 1
# Line 103  Failed: missing terminating ] for charac Line 103  Failed: missing terminating ] for charac
103  /(?X)[\B]/  /(?X)[\B]/
104  Failed: invalid escape sequence in character class at offset 6  Failed: invalid escape sequence in character class at offset 6
105    
106    /(?X)[\R]/
107    Failed: invalid escape sequence in character class at offset 6
108    
109    /(?X)[\X]/
110    Failed: invalid escape sequence in character class at offset 6
111    
112    /[\B]/BZ
113    ------------------------------------------------------------------
114            Bra
115            B
116            Ket
117            End
118    ------------------------------------------------------------------
119    
120    /[\R]/BZ
121    ------------------------------------------------------------------
122            Bra
123            R
124            Ket
125            End
126    ------------------------------------------------------------------
127    
128    /[\X]/BZ
129    ------------------------------------------------------------------
130            Bra
131            X
132            Ket
133            End
134    ------------------------------------------------------------------
135    
136  /[z-a]/  /[z-a]/
137  Failed: range out of order in character class at offset 3  Failed: range out of order in character class at offset 3
138    
# Line 145  Capturing subpattern count = 0 Line 175  Capturing subpattern count = 0
175  No options  No options
176  No first char  No first char
177  No need char  No need char
178    Subject length lower bound = 3
179  Starting byte set: c d e  Starting byte set: c d e
180      this sentence eventually mentions a cat      this sentence eventually mentions a cat
181   0: cat   0: cat
# Line 156  Capturing subpattern count = 0 Line 187  Capturing subpattern count = 0
187  Options: caseless  Options: caseless
188  No first char  No first char
189  No need char  No need char
190    Subject length lower bound = 3
191  Starting byte set: C D E c d e  Starting byte set: C D E c d e
192      this sentence eventually mentions a CAT cat      this sentence eventually mentions a CAT cat
193   0: CAT   0: CAT
# Line 167  Capturing subpattern count = 0 Line 199  Capturing subpattern count = 0
199  No options  No options
200  No first char  No first char
201  No need char  No need char
202    Subject length lower bound = 1
203  Starting byte set: a b c d  Starting byte set: a b c d
204    
205  /(a|[^\dZ])/IS  /(a|[^\dZ])/IS
# Line 174  Capturing subpattern count = 1 Line 207  Capturing subpattern count = 1
207  No options  No options
208  No first char  No first char
209  No need char  No need char
210    Subject length lower bound = 1
211  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
212    \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
213    \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / : ; < = >    \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / : ; < = >
# Line 194  Capturing subpattern count = 1 Line 228  Capturing subpattern count = 1
228  No options  No options
229  No first char  No first char
230  No need char  No need char
231    Subject length lower bound = 1
232  Starting byte set: \x09 \x0a \x0c \x0d \x20 a b  Starting byte set: \x09 \x0a \x0c \x0d \x20 a b
233    
234  /(ab\2)/  /(ab\2)/
# Line 527  Capturing subpattern count = 0 Line 562  Capturing subpattern count = 0
562  No options  No options
563  No first char  No first char
564  No need char  No need char
565    Subject length lower bound = 1
566  Starting byte set: a b c d  Starting byte set: a b c d
567    
568  /(?i)[abcd]/IS  /(?i)[abcd]/IS
# Line 534  Capturing subpattern count = 0 Line 570  Capturing subpattern count = 0
570  Options: caseless  Options: caseless
571  No first char  No first char
572  No need char  No need char
573    Subject length lower bound = 1
574  Starting byte set: A B C D a b c d  Starting byte set: A B C D a b c d
575    
576  /(?m)[xy]|(b|c)/IS  /(?m)[xy]|(b|c)/IS
# Line 541  Capturing subpattern count = 1 Line 578  Capturing subpattern count = 1
578  Options: multiline  Options: multiline
579  No first char  No first char
580  No need char  No need char
581    Subject length lower bound = 1
582  Starting byte set: b c x y  Starting byte set: b c x y
583    
584  /(^a|^b)/Im  /(^a|^b)/Im
# Line 605  Capturing subpattern count = 1 Line 643  Capturing subpattern count = 1
643  No options  No options
644  First char = 'b' (caseless)  First char = 'b' (caseless)
645  No need char  No need char
646  Study returned NULL  Subject length lower bound = 1
647    No set of starting bytes
648    
649  /(a*b|(?i:c*(?-i)d))/IS  /(a*b|(?i:c*(?-i)d))/IS
650  Capturing subpattern count = 1  Capturing subpattern count = 1
651  No options  No options
652  No first char  No first char
653  No need char  No need char
654    Subject length lower bound = 1
655  Starting byte set: C a b c d  Starting byte set: C a b c d
656    
657  /a$/I  /a$/I
# Line 676  Capturing subpattern count = 0 Line 716  Capturing subpattern count = 0
716  No options  No options
717  No first char  No first char
718  No need char  No need char
719    Subject length lower bound = 1
720  Starting byte set: a b  Starting byte set: a b
721    
722  /(?<!foo)(alpha|omega)/IS  /(?<!foo)(alpha|omega)/IS
# Line 683  Capturing subpattern count = 1 Line 724  Capturing subpattern count = 1
724  No options  No options
725  No first char  No first char
726  Need char = 'a'  Need char = 'a'
727    Subject length lower bound = 5
728  Starting byte set: a o  Starting byte set: a o
729    
730  /(?!alphabet)[ab]/IS  /(?!alphabet)[ab]/IS
# Line 690  Capturing subpattern count = 0 Line 732  Capturing subpattern count = 0
732  No options  No options
733  No first char  No first char
734  No need char  No need char
735    Subject length lower bound = 1
736  Starting byte set: a b  Starting byte set: a b
737    
738  /(?<=foo\n)^bar/Im  /(?<=foo\n)^bar/Im
# Line 844  No match Line 887  No match
887      a      a
888  No match  No match
889    
890  /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
891  Capturing subpattern count = 0  Capturing subpattern count = 0
892  No options  No options
893  First char = 'T'  First char = 'T'
# Line 856  Max back reference = 1 Line 899  Max back reference = 1
899  Options: anchored  Options: anchored
900  No first char  No first char
901  No need char  No need char
902        aaaa
903    No match
904      aaaaaa      aaaaaa
905   0: aaaaaa  No match
906   1: aa  
907    /Perl does not fail these two for the final subjects. Neither did PCRE until/
908    /release 8.01. The problem is in backtracking into a subpattern that contains/
909    No match
910    /a recursive reference to itself. PCRE has now made these into atomic patterns./
911    No match
912    
913    /^(xa|=?\1a){2}$/
914        xa=xaa
915     0: xa=xaa
916     1: =xaa
917        ** Failers
918    No match
919        xa=xaaa
920    No match
921    
922    /^(xa|=?\1a)+$/
923        xa=xaa
924     0: xa=xaa
925     1: =xaa
926        ** Failers
927    No match
928        xa=xaaa
929    No match
930    
931  /These are syntax tests from Perl 5.005/I  /These are syntax tests from Perl 5.005/I
932  Capturing subpattern count = 0  Capturing subpattern count = 0
# Line 1658  Capturing subpattern count = 0 Line 1726  Capturing subpattern count = 0
1726  Options: anchored  Options: anchored
1727  No first char  No first char
1728  Need char = 'd'  Need char = 'd'
1729  Study returned NULL  Subject length lower bound = 4
1730    No set of starting bytes
1731    
1732  /\(             # ( at start  /\(             # ( at start
1733    (?:           # Non-capturing bracket    (?:           # Non-capturing bracket
# Line 1890  Capturing subpattern count = 0 Line 1959  Capturing subpattern count = 0
1959  No options  No options
1960  No first char  No first char
1961  No need char  No need char
1962    Subject length lower bound = 1
1963  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
1964    _ 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
1965    
# Line 1951  Contains explicit CR or LF match Line 2021  Contains explicit CR or LF match
2021  No options  No options
2022  No first char  No first char
2023  No need char  No need char
2024    Subject length lower bound = 1
2025  Starting byte set: \x09 \x0a \x0b \x0c \x0d \x20  Starting byte set: \x09 \x0a \x0b \x0c \x0d \x20
2026    
2027  /^[[:cntrl:]]/DZ  /^[[:cntrl:]]/DZ
# Line 3157  Failed: POSIX collating elements are not Line 3228  Failed: POSIX collating elements are not
3228  Failed: POSIX named classes are supported only within a class at offset 0  Failed: POSIX named classes are supported only within a class at offset 0
3229    
3230  /\l/I  /\l/I
3231  Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1  Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
3232    
3233  /\L/I  /\L/I
3234  Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1  Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
3235    
3236  /\N{name}/I  /\N{name}/I
3237  Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1  Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
3238    
3239  /\u/I  /\u/I
3240  Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1  Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
3241    
3242  /\U/I  /\U/I
3243  Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1  Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
3244    
3245  /[/I  /[/I
3246  Failed: missing terminating ] for character class at offset 1  Failed: missing terminating ] for character class at offset 1
# Line 3421  Capturing subpattern count = 0 Line 3492  Capturing subpattern count = 0
3492  No options  No options
3493  No first char  No first char
3494  No need char  No need char
3495    Subject length lower bound = 1
3496  Starting byte set: a b  Starting byte set: a b
3497    
3498  /[^a]/I  /[^a]/I
# Line 3440  Capturing subpattern count = 0 Line 3512  Capturing subpattern count = 0
3512  No options  No options
3513  No first char  No first char
3514  Need char = '6'  Need char = '6'
3515    Subject length lower bound = 4
3516  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
3517    
3518  /a^b/I  /a^b/I
# Line 3473  Capturing subpattern count = 0 Line 3546  Capturing subpattern count = 0
3546  Options: caseless  Options: caseless
3547  No first char  No first char
3548  No need char  No need char
3549    Subject length lower bound = 1
3550  Starting byte set: A B a b  Starting byte set: A B a b
3551    
3552  /[ab](?i)cd/IS  /[ab](?i)cd/IS
# Line 3480  Capturing subpattern count = 0 Line 3554  Capturing subpattern count = 0
3554  No options  No options
3555  No first char  No first char
3556  Need char = 'd' (caseless)  Need char = 'd' (caseless)
3557    Subject length lower bound = 3
3558  Starting byte set: a b  Starting byte set: a b
3559    
3560  /abc(?C)def/I  /abc(?C)def/I
# Line 3830  Capturing subpattern count = 0 Line 3905  Capturing subpattern count = 0
3905  No options  No options
3906  No first char  No first char
3907  No need char  No need char
3908    Subject length lower bound = 1
3909  Starting byte set: a b  Starting byte set: a b
3910    
3911  /(?R)/I  /(?R)/I
# Line 3949  No options Line 4025  No options
4025  First char = 'a'  First char = 'a'
4026  Need char = 'b'  Need char = 'b'
4027    
 /^\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  
   
4028  /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I  /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I
4029  Capturing subpattern count = 2  Capturing subpattern count = 2
4030  Options: anchored  Options: anchored
# Line 4647  Capturing subpattern count = 3 Line 4690  Capturing subpattern count = 3
4690  Options: caseless  Options: caseless
4691  No first char  No first char
4692  Need char = 'g' (caseless)  Need char = 'g' (caseless)
4693  Study returned NULL  Subject length lower bound = 8
4694    No set of starting bytes
4695       Baby Bjorn Active Carrier - With free SHIPPING!!       Baby Bjorn Active Carrier - With free SHIPPING!!
4696   0: Baby Bjorn Active Carrier - With free SHIPPING!!   0: Baby Bjorn Active Carrier - With free SHIPPING!!
4697   1: Baby Bjorn Active Carrier - With free SHIPPING!!   1: Baby Bjorn Active Carrier - With free SHIPPING!!
# Line 4665  Capturing subpattern count = 0 Line 4709  Capturing subpattern count = 0
4709  No options  No options
4710  No first char  No first char
4711  Need char = 'b'  Need char = 'b'
4712  Study returned NULL  Subject length lower bound = 1
4713    No set of starting bytes
4714    
4715  /(a|b)*.?c/ISDZ  /(a|b)*.?c/ISDZ
4716  ------------------------------------------------------------------  ------------------------------------------------------------------
# Line 4685  Capturing subpattern count = 1 Line 4730  Capturing subpattern count = 1
4730  No options  No options
4731  No first char  No first char
4732  Need char = 'c'  Need char = 'c'
4733  Study returned NULL  Subject length lower bound = 1
4734    No set of starting bytes
4735    
4736  /abc(?C255)de(?C)f/DZ  /abc(?C255)de(?C)f/DZ
4737  ------------------------------------------------------------------  ------------------------------------------------------------------
# Line 5468  Capturing subpattern count = 1 Line 5514  Capturing subpattern count = 1
5514  No options  No options
5515  No first char  No first char
5516  No need char  No need char
5517    Subject length lower bound = 1
5518  Starting byte set: a b  Starting byte set: a b
5519  Compiled regex written to testsavedregex  Compiled regex written to testsavedregex
5520  Study data written to testsavedregex  Study data written to testsavedregex
# Line 5488  Capturing subpattern count = 1 Line 5535  Capturing subpattern count = 1
5535  No options  No options
5536  No first char  No first char
5537  No need char  No need char
5538    Subject length lower bound = 1
5539  Starting byte set: a b  Starting byte set: a b
5540  Compiled regex written to testsavedregex  Compiled regex written to testsavedregex
5541  Study data written to testsavedregex  Study data written to testsavedregex
# Line 6200  Capturing subpattern count = 0 Line 6248  Capturing subpattern count = 0
6248  No options  No options
6249  No first char  No first char
6250  Need char = ','  Need char = ','
6251    Subject length lower bound = 1
6252  Starting byte set: \x09 \x0a \x0c \x0d \x20 ,  Starting byte set: \x09 \x0a \x0c \x0d \x20 ,
6253      \x0b,\x0b      \x0b,\x0b
6254   0: ,   0: ,
# Line 6504  Capturing subpattern count = 1 Line 6553  Capturing subpattern count = 1
6553  No options  No options
6554  No first char  No first char
6555  No need char  No need char
6556    Subject length lower bound = 1
6557  Starting byte set: C a b c d  Starting byte set: C a b c d
6558    
6559  /()[ab]xyz/IS  /()[ab]xyz/IS
# Line 6511  Capturing subpattern count = 1 Line 6561  Capturing subpattern count = 1
6561  No options  No options
6562  No first char  No first char
6563  Need char = 'z'  Need char = 'z'
6564    Subject length lower bound = 4
6565  Starting byte set: a b  Starting byte set: a b
6566    
6567  /(|)[ab]xyz/IS  /(|)[ab]xyz/IS
# Line 6518  Capturing subpattern count = 1 Line 6569  Capturing subpattern count = 1
6569  No options  No options
6570  No first char  No first char
6571  Need char = 'z'  Need char = 'z'
6572    Subject length lower bound = 4
6573  Starting byte set: a b  Starting byte set: a b
6574    
6575  /(|c)[ab]xyz/IS  /(|c)[ab]xyz/IS
# Line 6525  Capturing subpattern count = 1 Line 6577  Capturing subpattern count = 1
6577  No options  No options
6578  No first char  No first char
6579  Need char = 'z'  Need char = 'z'
6580    Subject length lower bound = 4
6581  Starting byte set: a b c  Starting byte set: a b c
6582    
6583  /(|c?)[ab]xyz/IS  /(|c?)[ab]xyz/IS
# Line 6532  Capturing subpattern count = 1 Line 6585  Capturing subpattern count = 1
6585  No options  No options
6586  No first char  No first char
6587  Need char = 'z'  Need char = 'z'
6588    Subject length lower bound = 4
6589  Starting byte set: a b c  Starting byte set: a b c
6590    
6591  /(d?|c?)[ab]xyz/IS  /(d?|c?)[ab]xyz/IS
# Line 6539  Capturing subpattern count = 1 Line 6593  Capturing subpattern count = 1
6593  No options  No options
6594  No first char  No first char
6595  Need char = 'z'  Need char = 'z'
6596    Subject length lower bound = 4
6597  Starting byte set: a b c d  Starting byte set: a b c d
6598    
6599  /(d?|c)[ab]xyz/IS  /(d?|c)[ab]xyz/IS
# Line 6546  Capturing subpattern count = 1 Line 6601  Capturing subpattern count = 1
6601  No options  No options
6602  No first char  No first char
6603  Need char = 'z'  Need char = 'z'
6604    Subject length lower bound = 4
6605  Starting byte set: a b c d  Starting byte set: a b c d
6606    
6607  /^a*b\d/DZ  /^a*b\d/DZ
# Line 6638  Capturing subpattern count = 1 Line 6694  Capturing subpattern count = 1
6694  No options  No options
6695  No first char  No first char
6696  No need char  No need char
6697    Subject length lower bound = 1
6698  Starting byte set: a b c d  Starting byte set: a b c d
6699    
6700  /(a+|b*)[cd]/IS  /(a+|b*)[cd]/IS
# Line 6645  Capturing subpattern count = 1 Line 6702  Capturing subpattern count = 1
6702  No options  No options
6703  No first char  No first char
6704  No need char  No need char
6705    Subject length lower bound = 1
6706  Starting byte set: a b c d  Starting byte set: a b c d
6707    
6708  /(a*|b+)[cd]/IS  /(a*|b+)[cd]/IS
# Line 6652  Capturing subpattern count = 1 Line 6710  Capturing subpattern count = 1
6710  No options  No options
6711  No first char  No first char
6712  No need char  No need char
6713    Subject length lower bound = 1
6714  Starting byte set: a b c d  Starting byte set: a b c d
6715    
6716  /(a+|b+)[cd]/IS  /(a+|b+)[cd]/IS
# Line 6659  Capturing subpattern count = 1 Line 6718  Capturing subpattern count = 1
6718  No options  No options
6719  No first char  No first char
6720  No need char  No need char
6721    Subject length lower bound = 2
6722  Starting byte set: a b  Starting byte set: a b
6723    
6724  /((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((  /((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
# Line 7464  No match Line 7524  No match
7524          ^          ^
7525          CBra 1          CBra 1
7526          Cond          Cond
7527        2 Cond ref        2 Cond nref
7528          y          y
7529          Ket          Ket
7530          [()]          [()]
# Line 8637  No match Line 8697  No match
8697  +13   ^  ^      (*FAIL)  +13   ^  ^      (*FAIL)
8698  No match  No match
8699    
 /a(*PRUNE:XXX)b/  
 Failed: (*VERB) with an argument is not supported at offset 8  
   
8700  /a(*MARK)b/  /a(*MARK)b/
8701  Failed: (*VERB) not recognized at offset 7  Failed: (*MARK) must have an argument at offset 7
8702    
8703  /(?i:A{1,}\6666666666)/  /(?i:A{1,}\6666666666)/
8704  Failed: number is too big at offset 19  Failed: number is too big at offset 19
# Line 8730  No match Line 8787  No match
8787  No match  No match
8788      a\x85b      a\x85b
8789  No match  No match
8790    
8791    /(*ANY).*/g
8792        abc\r\ndef
8793     0: abc
8794     0:
8795     0: def
8796     0:
8797    
8798    /(*ANYCRLF).*/g
8799        abc\r\ndef
8800     0: abc
8801     0:
8802     0: def
8803     0:
8804    
8805    /(*CRLF).*/g
8806        abc\r\ndef
8807     0: abc
8808     0:
8809     0: def
8810     0:
8811    
8812  /a\Rb/I<bsr_anycrlf>  /a\Rb/I<bsr_anycrlf>
8813  Capturing subpattern count = 0  Capturing subpattern count = 0
# Line 9102  Capturing subpattern count = 1 Line 9180  Capturing subpattern count = 1
9180  No options  No options
9181  No first char  No first char
9182  No need char  No need char
9183    Subject length lower bound = 1
9184  Starting byte set: x y z  Starting byte set: x y z
9185    
9186  /(?(?=.*b)b|^)/CI  /(?(?=.*b)b|^)/CI
# Line 9215  No match Line 9294  No match
9294   +0        ^     x   +0        ^     x
9295   +0         ^    x   +0         ^    x
9296  No match  No match
9297    
9298    /(*NO_START_OPT)xyz/C
9299      abcxyz
9300    --->abcxyz
9301    +15 ^          x
9302    +15  ^         x
9303    +15   ^        x
9304    +15    ^       x
9305    +16    ^^      y
9306    +17    ^ ^     z
9307    +18    ^  ^
9308     0: xyz
9309    
9310    /xyz/CY
9311      abcxyz
9312    --->abcxyz
9313     +0 ^          x
9314     +0  ^         x
9315     +0   ^        x
9316     +0    ^       x
9317     +1    ^^      y
9318     +2    ^ ^     z
9319     +3    ^  ^
9320     0: xyz
9321    
9322  /^"((?(?=[a])[^"])|b)*"$/C  /^"((?(?=[a])[^"])|b)*"$/C
9323      "ab"      "ab"
# Line 9845  No match Line 9948  No match
9948   6: d   6: d
9949   7: Y   7: Y
9950    
9951    /(?<=b(?1)|zzz)(a)/
9952        xbaax
9953     0: a
9954     1: a
9955        xzzzax
9956     0: a
9957     1: a
9958    
9959    /(a)(?<=b\1)/
9960    Failed: lookbehind assertion is not fixed length at offset 10
9961    
9962    /(a)(?<=b+(?1))/
9963    Failed: lookbehind assertion is not fixed length at offset 13
9964    
9965    /(a+)(?<=b(?1))/
9966    Failed: lookbehind assertion is not fixed length at offset 14
9967    
9968    /(a(?<=b(?1)))/
9969    Failed: lookbehind assertion is not fixed length at offset 13
9970    
9971    /(?<=b(?1))xyz/
9972    Failed: reference to non-existent subpattern at offset 8
9973    
9974    /(?<=b(?1))xyz(b+)pqrstuvew/
9975    Failed: lookbehind assertion is not fixed length at offset 26
9976    
9977    /(a|bc)\1/SI
9978    Capturing subpattern count = 1
9979    Max back reference = 1
9980    No options
9981    No first char
9982    No need char
9983    Subject length lower bound = 2
9984    Starting byte set: a b
9985    
9986    /(a|bc)\1{2,3}/SI
9987    Capturing subpattern count = 1
9988    Max back reference = 1
9989    No options
9990    No first char
9991    No need char
9992    Subject length lower bound = 3
9993    Starting byte set: a b
9994    
9995    /(a|bc)(?1)/SI
9996    Capturing subpattern count = 1
9997    No options
9998    No first char
9999    No need char
10000    Subject length lower bound = 2
10001    Starting byte set: a b
10002    
10003    /(a|b\1)(a|b\1)/SI
10004    Capturing subpattern count = 2
10005    Max back reference = 1
10006    No options
10007    No first char
10008    No need char
10009    Subject length lower bound = 2
10010    Starting byte set: a b
10011    
10012    /(a|b\1){2}/SI
10013    Capturing subpattern count = 1
10014    Max back reference = 1
10015    No options
10016    No first char
10017    No need char
10018    Subject length lower bound = 2
10019    Starting byte set: a b
10020    
10021    /(a|bbbb\1)(a|bbbb\1)/SI
10022    Capturing subpattern count = 2
10023    Max back reference = 1
10024    No options
10025    No first char
10026    No need char
10027    Subject length lower bound = 2
10028    Starting byte set: a b
10029    
10030    /(a|bbbb\1){2}/SI
10031    Capturing subpattern count = 1
10032    Max back reference = 1
10033    No options
10034    No first char
10035    No need char
10036    Subject length lower bound = 2
10037    Starting byte set: a b
10038    
10039    /^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
10040    Capturing subpattern count = 1
10041    Options: anchored
10042    No first char
10043    Need char = ':'
10044    Subject length lower bound = 22
10045    No set of starting bytes
10046    
10047    /  (?: [\040\t] |  \(
10048    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10049    \)  )*                          # optional leading comment
10050    (?:    (?:
10051    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10052    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10053    |
10054    " (?:                      # opening quote...
10055    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
10056    |                     #    or
10057    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10058    )* "  # closing quote
10059    )                    # initial word
10060    (?:  (?: [\040\t] |  \(
10061    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10062    \)  )*  \.  (?: [\040\t] |  \(
10063    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10064    \)  )*   (?:
10065    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10066    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10067    |
10068    " (?:                      # opening quote...
10069    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
10070    |                     #    or
10071    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10072    )* "  # closing quote
10073    )  )* # further okay, if led by a period
10074    (?: [\040\t] |  \(
10075    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10076    \)  )*  @  (?: [\040\t] |  \(
10077    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10078    \)  )*    (?:
10079    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10080    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10081    |   \[                         # [
10082    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10083    \]                        #           ]
10084    )                           # initial subdomain
10085    (?:                                  #
10086    (?: [\040\t] |  \(
10087    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10088    \)  )*  \.                        # if led by a period...
10089    (?: [\040\t] |  \(
10090    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10091    \)  )*   (?:
10092    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10093    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10094    |   \[                         # [
10095    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10096    \]                        #           ]
10097    )                     #   ...further okay
10098    )*
10099    # address
10100    |                     #  or
10101    (?:
10102    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10103    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10104    |
10105    " (?:                      # opening quote...
10106    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
10107    |                     #    or
10108    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10109    )* "  # closing quote
10110    )             # one word, optionally followed by....
10111    (?:
10112    [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037]  |  # atom and space parts, or...
10113    \(
10114    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10115    \)       |  # comments, or...
10116    
10117    " (?:                      # opening quote...
10118    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
10119    |                     #    or
10120    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10121    )* "  # closing quote
10122    # quoted strings
10123    )*
10124    <  (?: [\040\t] |  \(
10125    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10126    \)  )*                     # leading <
10127    (?:  @  (?: [\040\t] |  \(
10128    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10129    \)  )*    (?:
10130    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10131    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10132    |   \[                         # [
10133    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10134    \]                        #           ]
10135    )                           # initial subdomain
10136    (?:                                  #
10137    (?: [\040\t] |  \(
10138    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10139    \)  )*  \.                        # if led by a period...
10140    (?: [\040\t] |  \(
10141    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10142    \)  )*   (?:
10143    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10144    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10145    |   \[                         # [
10146    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10147    \]                        #           ]
10148    )                     #   ...further okay
10149    )*
10150    
10151    (?:  (?: [\040\t] |  \(
10152    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10153    \)  )*  ,  (?: [\040\t] |  \(
10154    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10155    \)  )*  @  (?: [\040\t] |  \(
10156    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10157    \)  )*    (?:
10158    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10159    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10160    |   \[                         # [
10161    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10162    \]                        #           ]
10163    )                           # initial subdomain
10164    (?:                                  #
10165    (?: [\040\t] |  \(
10166    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10167    \)  )*  \.                        # if led by a period...
10168    (?: [\040\t] |  \(
10169    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10170    \)  )*   (?:
10171    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10172    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10173    |   \[                         # [
10174    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10175    \]                        #           ]
10176    )                     #   ...further okay
10177    )*
10178    )* # further okay, if led by comma
10179    :                                # closing colon
10180    (?: [\040\t] |  \(
10181    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10182    \)  )*  )? #       optional route
10183    (?:
10184    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10185    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10186    |
10187    " (?:                      # opening quote...
10188    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
10189    |                     #    or
10190    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10191    )* "  # closing quote
10192    )                    # initial word
10193    (?:  (?: [\040\t] |  \(
10194    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10195    \)  )*  \.  (?: [\040\t] |  \(
10196    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10197    \)  )*   (?:
10198    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10199    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10200    |
10201    " (?:                      # opening quote...
10202    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
10203    |                     #    or
10204    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10205    )* "  # closing quote
10206    )  )* # further okay, if led by a period
10207    (?: [\040\t] |  \(
10208    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10209    \)  )*  @  (?: [\040\t] |  \(
10210    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10211    \)  )*    (?:
10212    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10213    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10214    |   \[                         # [
10215    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10216    \]                        #           ]
10217    )                           # initial subdomain
10218    (?:                                  #
10219    (?: [\040\t] |  \(
10220    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10221    \)  )*  \.                        # if led by a period...
10222    (?: [\040\t] |  \(
10223    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10224    \)  )*   (?:
10225    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10226    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10227    |   \[                         # [
10228    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10229    \]                        #           ]
10230    )                     #   ...further okay
10231    )*
10232    #       address spec
10233    (?: [\040\t] |  \(
10234    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10235    \)  )*  > #                  trailing >
10236    # name and address
10237    )  (?: [\040\t] |  \(
10238    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10239    \)  )*                       # optional trailing comment
10240    /xSI
10241    Capturing subpattern count = 0
10242    Contains explicit CR or LF match
10243    Options: extended
10244    No first char
10245    No need char
10246    Subject length lower bound = 3
10247    Starting byte set: \x09 \x20 ! " # $ % & ' ( * + - / 0 1 2 3 4 5 6 7 8
10248      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
10249      f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f
10250    
10251    /<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
10252    Capturing subpattern count = 11
10253    Options: caseless dotall
10254    First char = '<'
10255    Need char = '>'
10256    Subject length lower bound = 47
10257    No set of starting bytes
10258    
10259    "(?>.*/)foo"SI
10260    Capturing subpattern count = 0
10261    No options
10262    First char at start or follows newline
10263    Need char = 'o'
10264    Subject length lower bound = 4
10265    No set of starting bytes
10266    
10267    /(?(?=[^a-z]+[a-z])  \d{2}-[a-z]{3}-\d{2}  |  \d{2}-\d{2}-\d{2} ) /xSI
10268    Capturing subpattern count = 0
10269    Options: extended
10270    No first char
10271    Need char = '-'
10272    Subject length lower bound = 8
10273    No set of starting bytes
10274    
10275    /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/iSI
10276    Capturing subpattern count = 1
10277    Options: caseless
10278    No first char
10279    No need char
10280    Subject length lower bound = 1
10281    Starting byte set: A B C a b c
10282    
10283    /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/SI
10284    Capturing subpattern count = 0
10285    No options
10286    No first char
10287    Need char = 'b'
10288    Subject length lower bound = 41
10289    Starting byte set: c d
10290    
10291    /<a[\s]+href[\s]*=[\s]*          # find <a href=
10292     ([\"\'])?                       # find single or double quote
10293     (?(1) (.*?)\1 | ([^\s]+))       # if quote found, match up to next matching
10294                                     # quote, otherwise match up to next space
10295    /isxSI
10296    Capturing subpattern count = 3
10297    Max back reference = 1
10298    Options: caseless extended dotall
10299    First char = '<'
10300    Need char = '='
10301    Subject length lower bound = 9
10302    No set of starting bytes
10303    
10304    /^(?!:)                       # colon disallowed at start
10305      (?:                         # start of item
10306        (?: [0-9a-f]{1,4} |       # 1-4 hex digits or
10307        (?(1)0 | () ) )           # if null previously matched, fail; else null
10308        :                         # followed by colon
10309      ){1,7}                      # end item; 1-7 of them required
10310      [0-9a-f]{1,4} $             # final hex number at end of string
10311      (?(1)|.)                    # check that there was an empty component
10312      /xiIS
10313    Capturing subpattern count = 1
10314    Options: anchored caseless extended
10315    No first char
10316    Need char = ':'
10317    Subject length lower bound = 2
10318    No set of starting bytes
10319    
10320    /(?|(?<a>A)|(?<a>B))/I
10321    Capturing subpattern count = 1
10322    Named capturing subpatterns:
10323      a   1
10324      a   1
10325    No options
10326    No first char
10327    No need char
10328        AB\Ca
10329     0: A
10330     1: A
10331      C A (1) a
10332        BA\Ca
10333     0: B
10334     1: B
10335      C B (1) a
10336    
10337    /(?|(?<a>A)|(?<b>B))/
10338    Failed: different names for subpatterns of the same number are not allowed at offset 15
10339    
10340    /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |
10341        b(?<quote> (?<apostrophe>')|(?<realquote>")) )
10342        (?('quote')[a-z]+|[0-9]+)/JIx
10343    Capturing subpattern count = 6
10344    Named capturing subpatterns:
10345      apostrophe   2
10346      apostrophe   5
10347      quote        1
10348      quote        4
10349      realquote    3
10350      realquote    6
10351    Options: extended dupnames
10352    No first char
10353    No need char
10354        a"aaaaa
10355     0: a"aaaaa
10356     1: "
10357     2: <unset>
10358     3: "
10359        b"aaaaa
10360     0: b"aaaaa
10361     1: <unset>
10362     2: <unset>
10363     3: <unset>
10364     4: "
10365     5: <unset>
10366     6: "
10367        ** Failers
10368    No match
10369        b"11111
10370    No match
10371        a"11111
10372    No match
10373    
10374    /^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/JDZx
10375    ------------------------------------------------------------------
10376            Bra
10377            ^
10378            Bra
10379            CBra 1
10380            a
10381            Ket
10382            CBra 2
10383            b
10384            Ket
10385            CBra 3
10386            c
10387            Ket
10388            CBra 4
10389            d
10390            Ket
10391            Alt
10392            CBra 1
10393            e
10394            Ket
10395            Ket
10396            Cond
10397          4 Cond nref
10398            X
10399            Alt
10400            Y
10401            Ket
10402            Ket
10403            End
10404    ------------------------------------------------------------------
10405    Capturing subpattern count = 4
10406    Named capturing subpatterns:
10407      D   4
10408      D   1
10409    Options: anchored extended dupnames
10410    No first char
10411    No need char
10412        abcdX
10413     0: abcdX
10414     1: a
10415     2: b
10416     3: c
10417     4: d
10418        eX
10419     0: eX
10420     1: e
10421        ** Failers
10422    No match
10423        abcdY
10424    No match
10425        ey
10426    No match
10427    
10428    /(?<A>a) (b)(c)  (?<A>d  (?(R&A)$ | (?4)) )/JDZx
10429    ------------------------------------------------------------------
10430            Bra
10431            CBra 1
10432            a
10433            Ket
10434            CBra 2
10435            b
10436            Ket
10437            CBra 3
10438            c
10439            Ket
10440            CBra 4
10441            d
10442            Cond
10443            Cond nrecurse 1
10444            $
10445            Alt
10446            Once
10447            Recurse
10448            Ket
10449            Ket
10450            Ket
10451            Ket
10452            End
10453    ------------------------------------------------------------------
10454    Capturing subpattern count = 4
10455    Named capturing subpatterns:
10456      A   1
10457      A   4
10458    Options: extended dupnames
10459    First char = 'a'
10460    Need char = 'd'
10461        abcdd
10462     0: abcdd
10463     1: a
10464     2: b
10465     3: c
10466     4: dd
10467        ** Failers
10468    No match
10469        abcdde
10470    No match
10471    
10472    /abcd*/
10473        xxxxabcd\P
10474     0: abcd
10475        xxxxabcd\P\P
10476    Partial match: abcd
10477    
10478    /abcd*/i
10479        xxxxabcd\P
10480     0: abcd
10481        xxxxabcd\P\P
10482    Partial match: abcd
10483        XXXXABCD\P
10484     0: ABCD
10485        XXXXABCD\P\P
10486    Partial match: ABCD
10487    
10488    /abc\d*/
10489        xxxxabc1\P
10490     0: abc1
10491        xxxxabc1\P\P
10492    Partial match: abc1
10493    
10494    /(a)bc\1*/
10495        xxxxabca\P
10496     0: abca
10497     1: a
10498        xxxxabca\P\P
10499    Partial match: abca
10500    
10501    /abc[de]*/
10502        xxxxabcde\P
10503     0: abcde
10504        xxxxabcde\P\P
10505    Partial match: abcde
10506    
10507    /-- This is not in the Perl >= 5.10 test because Perl seems currently to be
10508        broken and not behaving as specified in that it *does* bumpalong after
10509        hitting (*COMMIT). --/
10510    
10511    /(?1)(A(*COMMIT)|B)D/
10512        ABD
10513     0: ABD
10514     1: B
10515        XABD
10516     0: ABD
10517     1: B
10518        BAD
10519     0: BAD
10520     1: A
10521        ABXABD
10522     0: ABD
10523     1: B
10524        ** Failers
10525    No match
10526        ABX
10527    No match
10528        BAXBAD
10529    No match
10530    
10531    /(\3)(\1)(a)/<JS>
10532        cat
10533     0: a
10534     1:
10535     2:
10536     3: a
10537    
10538    /(\3)(\1)(a)/SI<JS>
10539    Capturing subpattern count = 3
10540    Max back reference = 3
10541    Options:
10542    No first char
10543    Need char = 'a'
10544    Subject length lower bound = 1
10545    No set of starting bytes
10546        cat
10547     0: a
10548     1:
10549     2:
10550     3: a
10551    
10552    /(\3)(\1)(a)/SI
10553    Capturing subpattern count = 3
10554    Max back reference = 3
10555    No options
10556    No first char
10557    Need char = 'a'
10558    Subject length lower bound = 3
10559    No set of starting bytes
10560        cat
10561    No match
10562    
10563    /i(?(DEFINE)(?<s>a))/SI
10564    Capturing subpattern count = 1
10565    Named capturing subpatterns:
10566      s   1
10567    No options
10568    First char = 'i'
10569    No need char
10570    Subject length lower bound = 1
10571    No set of starting bytes
10572        i
10573     0: i
10574    
10575    /()i(?(1)a)/SI
10576    Capturing subpattern count = 1
10577    No options
10578    No first char
10579    Need char = 'i'
10580    Subject length lower bound = 1
10581    Starting byte set: i
10582        ia
10583     0: ia
10584     1:
10585    
10586    /(?i)a(?-i)b|c/BZ
10587    ------------------------------------------------------------------
10588            Bra
10589         NC a
10590         00 Opt
10591            b
10592            Alt
10593         00 Opt
10594            c
10595            Ket
10596            End
10597    ------------------------------------------------------------------
10598        XabX
10599     0: ab
10600        XAbX
10601     0: Ab
10602        CcC
10603     0: c
10604        ** Failers
10605    No match
10606        XABX
10607    No match
10608    
10609    /(?i)a(?s)b|c/BZ
10610    ------------------------------------------------------------------
10611            Bra
10612         NC a
10613         05 Opt
10614         NC b
10615            Alt
10616         05 Opt
10617         NC c
10618            Ket
10619            End
10620    ------------------------------------------------------------------
10621    
10622    /(?i)a(?s-i)b|c/BZ
10623    ------------------------------------------------------------------
10624            Bra
10625         NC a
10626         04 Opt
10627            b
10628            Alt
10629         04 Opt
10630            c
10631            Ket
10632            End
10633    ------------------------------------------------------------------
10634    
10635    /^(ab(c\1)d|x){2}$/BZ
10636    ------------------------------------------------------------------
10637            Bra
10638            ^
10639            Once
10640            CBra 1
10641            ab
10642            CBra 2
10643            c
10644            \1
10645            Ket
10646            d
10647            Alt
10648            x
10649            Ket
10650            Ket
10651            Once
10652            CBra 1
10653            ab
10654            CBra 2
10655            c
10656            \1
10657            Ket
10658            d
10659            Alt
10660            x
10661            Ket
10662            Ket
10663            $
10664            Ket
10665            End
10666    ------------------------------------------------------------------
10667        xabcxd
10668     0: xabcxd
10669     1: abcxd
10670     2: cx
10671    
10672    /^(?&t)*+(?(DEFINE)(?<t>.))$/BZ
10673    ------------------------------------------------------------------
10674            Bra
10675            ^
10676            Once
10677            Brazero
10678            Once
10679            Recurse
10680            KetRmax
10681            Ket
10682            Cond
10683            Cond def
10684            CBra 1
10685            Any
10686            Ket
10687            Ket
10688            $
10689            Ket
10690            End
10691    ------------------------------------------------------------------
10692    
10693    /^(?&t)*(?(DEFINE)(?<t>.))$/BZ
10694    ------------------------------------------------------------------
10695            Bra
10696            ^
10697            Brazero
10698            Once
10699            Recurse
10700            KetRmax
10701            Cond
10702            Cond def
10703            CBra 1
10704            Any
10705            Ket
10706            Ket
10707            $
10708            Ket
10709            End
10710    ------------------------------------------------------------------
10711    
10712    / -- The first four of these are not in the Perl >= 5.10 test because Perl
10713         documents that the use of \K in assertions is "not well defined". The
10714         last is here because Perl gives the match as "b" rather than "ab". I
10715         believe this to be a Perl bug. --/
10716    
10717    /(?=a\Kb)ab/
10718        ab
10719     0: b
10720    
10721    /(?!a\Kb)ac/
10722        ac
10723     0: ac
10724    
10725    /^abc(?<=b\Kc)d/
10726        abcd
10727     0: cd
10728    
10729    /^abc(?<!b\Kq)d/
10730        abcd
10731     0: abcd
10732    
10733    /(?>a\Kb)z|(ab)/
10734        ab
10735     0: ab
10736     1: ab
10737    
10738    /----------------------/
10739    
10740    /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
10741    Failed: recursive call could loop indefinitely at offset 31
10742    
10743    /abc(*MARK:)pqr/
10744    Failed: (*MARK) must have an argument at offset 10
10745    
10746    /abc(*:)pqr/
10747    Failed: (*MARK) must have an argument at offset 6
10748    
10749    /abc(*FAIL:123)xyz/
10750    Failed: an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT) at offset 13
10751    
10752    /--- This should, and does, fail. In Perl, it does not, which I think is a
10753         bug because replacing the B in the pattern by (B|D) does make it fail. ---/
10754    
10755    /A(*COMMIT)B/+K
10756        ACABX
10757    No match
10758    
10759    /--- These should be different, but in Perl 5.11 are not, which I think
10760         is a bug in Perl. ---/
10761    
10762    /A(*THEN)B|A(*THEN)C/K
10763        AC
10764     0: AC
10765    
10766    /A(*PRUNE)B|A(*PRUNE)C/K
10767        AC
10768    No match
10769    
10770    /--- A whole lot of tests of verbs with arguments are here rather than in test
10771         11 because Perl doesn't seem to follow its specification entirely
10772         correctly. ---/
10773    
10774    /--- Perl 5.11 sets $REGERROR on the AC failure case here; PCRE does not. It is
10775         not clear how Perl defines "involved in the failure of the match". ---/
10776    
10777    /^(A(*THEN:A)B|C(*THEN:B)D)/K
10778        AB
10779     0: AB
10780     1: AB
10781        CD
10782     0: CD
10783     1: CD
10784        ** Failers
10785    No match
10786        AC
10787    No match
10788        CB
10789    No match, mark = B
10790    
10791    /--- Check the use of names for success and failure. PCRE doesn't show these
10792    names for success, though Perl does, contrary to its spec. ---/
10793    
10794    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
10795        AB
10796     0: AB
10797     1: AB
10798        CD
10799     0: CD
10800     1: CD
10801        ** Failers
10802    No match
10803        AC
10804    No match, mark = A
10805        CB
10806    No match, mark = B
10807    
10808    /--- An empty name does not pass back an empty string. It is the same as if no
10809    name were given. ---/
10810    
10811    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/K
10812        AB
10813     0: AB
10814     1: AB
10815        CD
10816     0: CD
10817     1: CD
10818    
10819    /--- PRUNE goes to next bumpalong; COMMIT does not. ---/
10820    
10821    /A(*PRUNE:A)B/K
10822        ACAB
10823     0: AB
10824    
10825    /(*MARK:A)(*PRUNE:B)(C|X)/K
10826        C
10827     0: C
10828     1: C
10829    MK: A
10830        D
10831    No match, mark = B
10832    
10833    /(*MARK:A)(*THEN:B)(C|X)/K
10834        C
10835     0: C
10836     1: C
10837    MK: A
10838        D
10839    No match, mark = B
10840    
10841    /--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/
10842    
10843    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK
10844        AAAC
10845    No match
10846    
10847    /--- Same --/
10848    
10849    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK
10850        AAAC
10851    No match
10852    
10853    /--- This should fail; the SKIP advances by one, but when we get to AC, the
10854         PRUNE kills it. ---/
10855    
10856    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
10857        AAAC
10858    No match
10859    
10860    /A(*:A)A+(*SKIP)(B|Z) | AC/xK
10861        AAAC
10862    No match
10863    
10864    /--- This should fail, as a null name is the same as no name ---/
10865    
10866    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK
10867        AAAC
10868    No match
10869    
10870    /--- This fails in PCRE, and I think that is in accordance with Perl's
10871         documentation, though in Perl it succeeds. ---/
10872    
10873    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK
10874        AAAC
10875    No match
10876    
10877    /--- Mark names can be duplicated ---/
10878    
10879    /A(*:A)B|X(*:A)Y/K
10880        AABC
10881     0: AB
10882    MK: A
10883        XXYZ
10884     0: XY
10885    MK: A
10886    
10887    /^A(*:A)B|^X(*:A)Y/K
10888        ** Failers
10889    No match
10890        XAQQ
10891    No match, mark = A
10892    
10893    /--- A check on what happens after hitting a mark and them bumping along to
10894    something that does not even start. Perl reports tags after the failures here,
10895    though it does not when the individual letters are made into something
10896    more complicated. ---/
10897    
10898    /A(*:A)B|XX(*:B)Y/K
10899        AABC
10900     0: AB
10901    MK: A
10902        XXYZ
10903     0: XXY
10904    MK: B
10905        ** Failers
10906    No match
10907        XAQQ
10908    No match
10909        XAQQXZZ
10910    No match
10911        AXQQQ
10912    No match
10913        AXXQQQ
10914    No match
10915    
10916    /--- COMMIT at the start of a pattern should be the same as an anchor. Perl
10917    optimizations defeat this. So does the PCRE optimization unless we disable it
10918    with \Y. ---/
10919    
10920    /(*COMMIT)ABC/
10921        ABCDEFG
10922     0: ABC
10923        ** Failers
10924    No match
10925        DEFGABC\Y
10926    No match
10927    
10928    /--- Repeat some tests with added studying. ---/
10929    
10930    /A(*COMMIT)B/+KS
10931        ACABX
10932    No match
10933    
10934    /A(*THEN)B|A(*THEN)C/KS
10935        AC
10936     0: AC
10937    
10938    /A(*PRUNE)B|A(*PRUNE)C/KS
10939        AC
10940    No match
10941    
10942    /^(A(*THEN:A)B|C(*THEN:B)D)/KS
10943        AB
10944     0: AB
10945     1: AB
10946        CD
10947     0: CD
10948     1: CD
10949        ** Failers
10950    No match
10951        AC
10952    No match
10953        CB
10954    No match, mark = B
10955    
10956    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/KS
10957        AB
10958     0: AB
10959     1: AB
10960        CD
10961     0: CD
10962     1: CD
10963        ** Failers
10964    No match
10965        AC
10966    No match, mark = A
10967        CB
10968    No match, mark = B
10969    
10970    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/KS
10971        AB
10972     0: AB
10973     1: AB
10974        CD
10975     0: CD
10976     1: CD
10977    
10978    /A(*PRUNE:A)B/KS
10979        ACAB
10980     0: AB
10981    
10982    /(*MARK:A)(*PRUNE:B)(C|X)/KS
10983        C
10984     0: C
10985     1: C
10986    MK: A
10987        D
10988    No match
10989    
10990    /(*MARK:A)(*THEN:B)(C|X)/KS
10991        C
10992     0: C
10993     1: C
10994    MK: A
10995        D
10996    No match
10997    
10998    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xKS
10999        AAAC
11000    No match
11001    
11002    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xKS
11003        AAAC
11004    No match
11005    
11006    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xKS
11007        AAAC
11008    No match
11009    
11010    /A(*:A)A+(*SKIP)(B|Z) | AC/xKS
11011        AAAC
11012    No match
11013    
11014    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xKS
11015        AAAC
11016    No match
11017    
11018    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xKS
11019        AAAC
11020    No match
11021    
11022    /A(*:A)B|XX(*:B)Y/KS
11023        AABC
11024     0: AB
11025    MK: A
11026        XXYZ
11027     0: XXY
11028    MK: B
11029        ** Failers
11030    No match
11031        XAQQ
11032    No match
11033        XAQQXZZ
11034    No match
11035        AXQQQ
11036    No match
11037        AXXQQQ
11038    No match
11039    
11040    /(*COMMIT)ABC/
11041        ABCDEFG
11042     0: ABC
11043        ** Failers
11044    No match
11045        DEFGABC\Y
11046    No match
11047    
11048    /^(ab (c+(*THEN)cd) | xyz)/x
11049        abcccd
11050    No match
11051    
11052    /^(ab (c+(*PRUNE)cd) | xyz)/x
11053        abcccd
11054    No match
11055    
11056    /^(ab (c+(*FAIL)cd) | xyz)/x
11057        abcccd
11058    No match
11059    
11060    /--- Perl 5.11 gets some of these wrong ---/
11061    
11062    /(?>.(*ACCEPT))*?5/
11063        abcde
11064     0: a
11065    
11066    /(.(*ACCEPT))*?5/
11067        abcde
11068     0: a
11069     1: a
11070    
11071    /(.(*ACCEPT))5/
11072        abcde
11073     0: a
11074     1: a
11075    
11076    /(.(*ACCEPT))*5/
11077        abcde
11078     0: a
11079     1: a
11080    
11081    /A\NB./BZ
11082    ------------------------------------------------------------------
11083            Bra
11084            A
11085            Any
11086            B
11087            Any
11088            Ket
11089            End
11090    ------------------------------------------------------------------
11091        ACBD
11092     0: ACBD
11093        *** Failers
11094    No match
11095        A\nB
11096    No match
11097        ACB\n
11098    No match
11099    
11100    /A\NB./sBZ
11101    ------------------------------------------------------------------
11102            Bra
11103            A
11104            Any
11105            B
11106            AllAny
11107            Ket
11108            End
11109    ------------------------------------------------------------------
11110        ACBD
11111     0: ACBD
11112        ACB\n
11113     0: ACB\x0a
11114        *** Failers
11115    No match
11116        A\nB
11117    No match
11118    
11119    /A\NB/<crlf>
11120        A\nB
11121     0: A\x0aB
11122        A\rB
11123     0: A\x0dB
11124        ** Failers
11125    No match
11126        A\r\nB
11127    No match
11128    
11129    /\R+b/BZ
11130    ------------------------------------------------------------------
11131            Bra
11132            \R++
11133            b
11134            Ket
11135            End
11136    ------------------------------------------------------------------
11137    
11138    /\R+\n/BZ
11139    ------------------------------------------------------------------
11140            Bra
11141            \R+
11142            \x0a
11143            Ket
11144            End
11145    ------------------------------------------------------------------
11146    
11147    /\R+\d/BZ
11148    ------------------------------------------------------------------
11149            Bra
11150            \R++
11151            \d
11152            Ket
11153            End
11154    ------------------------------------------------------------------
11155    
11156    /\d*\R/BZ
11157    ------------------------------------------------------------------
11158            Bra
11159            \d*+
11160            \R
11161            Ket
11162            End
11163    ------------------------------------------------------------------
11164    
11165    /\s*\R/BZ
11166    ------------------------------------------------------------------
11167            Bra
11168            \s*+
11169            \R
11170            Ket
11171            End
11172    ------------------------------------------------------------------
11173    
11174    /-- Perl treats this one differently, not failing the second string. I believe
11175        that is a bug in Perl. --/
11176    
11177    /^((abc|abcx)(*THEN)y|abcd)/
11178        abcd
11179     0: abcd
11180     1: abcd
11181        *** Failers
11182    No match
11183        abcxy
11184    No match
11185    
11186    /(?<=abc)def/
11187        abc\P\P
11188    Partial match: abc
11189    
11190    /abc$/
11191        abc
11192     0: abc
11193        abc\P
11194     0: abc
11195        abc\P\P
11196    Partial match: abc
11197    
11198    /abc$/m
11199        abc
11200     0: abc
11201        abc\n
11202     0: abc
11203        abc\P\P
11204    Partial match: abc
11205        abc\n\P\P
11206     0: abc
11207        abc\P
11208     0: abc
11209        abc\n\P
11210     0: abc
11211    
11212    /abc\z/
11213        abc
11214     0: abc
11215        abc\P
11216     0: abc
11217        abc\P\P
11218    Partial match: abc
11219    
11220    /abc\Z/
11221        abc
11222     0: abc
11223        abc\P
11224     0: abc
11225        abc\P\P
11226    Partial match: abc
11227    
11228    /abc\b/
11229        abc
11230     0: abc
11231        abc\P
11232     0: abc
11233        abc\P\P
11234    Partial match: abc
11235    
11236    /abc\B/
11237        abc
11238    No match
11239        abc\P
11240    Partial match: abc
11241        abc\P\P
11242    Partial match: abc
11243    
11244    /.+/
11245        abc\>0
11246     0: abc
11247        abc\>1
11248     0: bc
11249        abc\>2
11250     0: c
11251        abc\>3
11252    No match
11253        abc\>4
11254    Error -24
11255        abc\>-4
11256    Error -24
11257    
11258    /^\cģ/
11259    Failed: \c must be followed by an ASCII character at offset 3
11260    
11261    /(?P<abn>(?P=abn)xxx)/BZ
11262    ------------------------------------------------------------------
11263            Bra
11264            Once
11265            CBra 1
11266            \1
11267            xxx
11268            Ket
11269            Ket
11270            Ket
11271            End
11272    ------------------------------------------------------------------
11273    
11274    /(a\1z)/BZ
11275    ------------------------------------------------------------------
11276            Bra
11277            Once
11278            CBra 1
11279            a
11280            \1
11281            z
11282            Ket
11283            Ket
11284            Ket
11285            End
11286    ------------------------------------------------------------------
11287    
11288    /(?P<abn>(?P=abn)(?<badstufxxx)/BZ
11289    Failed: syntax error in subpattern name (missing terminator) at offset 29
11290    
11291    /(?P<abn>(?P=axn)xxx)/BZ
11292    Failed: reference to non-existent subpattern at offset 15
11293    
11294    /(?P<abn>(?P=axn)xxx)(?<axn>yy)/BZ
11295    ------------------------------------------------------------------
11296            Bra
11297            CBra 1
11298            \2
11299            xxx
11300            Ket
11301            CBra 2
11302            yy
11303            Ket
11304            Ket
11305            End
11306    ------------------------------------------------------------------
11307    
11308  /-- End of testinput2 --/  /-- End of testinput2 --/

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

  ViewVC Help
Powered by ViewVC 1.1.5