/[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 455 by ph10, Sat Sep 26 19:12:32 2009 UTC revision 621 by ph10, Mon Jul 18 10:14:09 2011 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 602  Need char = 'h' (caseless) Line 632  Need char = 'h' (caseless)
632  ------------------------------------------------------------------  ------------------------------------------------------------------
633          Bra          Bra
634          CBra 1          CBra 1
635       01 Opt       /i b
      NC b  
636          Ket          Ket
      00 Opt  
637          Ket          Ket
638          End          End
639  ------------------------------------------------------------------  ------------------------------------------------------------------
# Line 857  No match Line 885  No match
885      a      a
886  No match  No match
887    
888  /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
889  Capturing subpattern count = 0  Capturing subpattern count = 0
890  No options  No options
891  First char = 'T'  First char = 'T'
# Line 869  Max back reference = 1 Line 897  Max back reference = 1
897  Options: anchored  Options: anchored
898  No first char  No first char
899  No need char  No need char
900        aaaa
901    No match
902      aaaaaa      aaaaaa
903   0: aaaaaa  No match
904   1: aa  
905    /Perl does not fail these two for the final subjects. Neither did PCRE until/
906    /release 8.01. The problem is in backtracking into a subpattern that contains/
907    No match
908    /a recursive reference to itself. PCRE has now made these into atomic patterns./
909    No match
910    
911    /^(xa|=?\1a){2}$/
912        xa=xaa
913     0: xa=xaa
914     1: =xaa
915        ** Failers
916    No match
917        xa=xaaa
918    No match
919    
920    /^(xa|=?\1a)+$/
921        xa=xaa
922     0: xa=xaa
923     1: =xaa
924        ** Failers
925    No match
926        xa=xaaa
927    No match
928    
929  /These are syntax tests from Perl 5.005/I  /These are syntax tests from Perl 5.005/I
930  Capturing subpattern count = 0  Capturing subpattern count = 0
# Line 1192  No need char Line 1245  No need char
1245  ------------------------------------------------------------------  ------------------------------------------------------------------
1246          Bra          Bra
1247          Bra          Bra
      04 Opt  
1248          AllAny*          AllAny*
1249          X          X
1250          Alt          Alt
      04 Opt  
1251          ^          ^
1252          B          B
1253          Ket          Ket
      00 Opt  
1254          Ket          Ket
1255          End          End
1256  ------------------------------------------------------------------  ------------------------------------------------------------------
# Line 2709  No need char Line 2759  No need char
2759  ------------------------------------------------------------------  ------------------------------------------------------------------
2760          Bra          Bra
2761          a          a
2762       01 Opt       /i b
      NC b  
2763          Ket          Ket
2764          End          End
2765  ------------------------------------------------------------------  ------------------------------------------------------------------
# Line 2732  No match Line 2781  No match
2781          Bra          Bra
2782          CBra 1          CBra 1
2783          a          a
2784       01 Opt       /i b
      NC b  
2785          Ket          Ket
      00 Opt  
2786          Ket          Ket
2787          End          End
2788  ------------------------------------------------------------------  ------------------------------------------------------------------
# Line 2757  No match Line 2804  No match
2804  /   (?i)abc/IxDZ  /   (?i)abc/IxDZ
2805  ------------------------------------------------------------------  ------------------------------------------------------------------
2806          Bra          Bra
2807       NC abc       /i abc
2808          Ket          Ket
2809          End          End
2810  ------------------------------------------------------------------  ------------------------------------------------------------------
# Line 2770  Need char = 'c' (caseless) Line 2817  Need char = 'c' (caseless)
2817    (?i)abc/IxDZ    (?i)abc/IxDZ
2818  ------------------------------------------------------------------  ------------------------------------------------------------------
2819          Bra          Bra
2820       NC abc       /i abc
2821          Ket          Ket
2822          End          End
2823  ------------------------------------------------------------------  ------------------------------------------------------------------
# Line 2943  No need char Line 2990  No need char
2990  /(x)*+/DZ  /(x)*+/DZ
2991  ------------------------------------------------------------------  ------------------------------------------------------------------
2992          Bra          Bra
2993          Once          Braposzero
2994          Brazero          CBraPos 1
         CBra 1  
2995          x          x
2996          KetRmax          KetRpos
         Ket  
2997          Ket          Ket
2998          End          End
2999  ------------------------------------------------------------------  ------------------------------------------------------------------
# Line 3173  Failed: POSIX collating elements are not Line 3218  Failed: POSIX collating elements are not
3218  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
3219    
3220  /\l/I  /\l/I
3221  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
3222    
3223  /\L/I  /\L/I
3224  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
3225    
3226  /\N{name}/I  /\N{name}/I
3227  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
3228    
3229  /\u/I  /\u/I
3230  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
3231    
3232  /\U/I  /\U/I
3233  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
3234    
3235  /[/I  /[/I
3236  Failed: missing terminating ] for character class at offset 1  Failed: missing terminating ] for character class at offset 1
# Line 3535  Need char = 'f' Line 3580  Need char = 'f'
3580    1    ^    ^     f    1    ^    ^     f
3581   0: abcdef   0: abcdef
3582    
3583  /(?C1)\dabc(?C2)def/I  /(?C1)\dabc(?C2)def/IS
3584    Capturing subpattern count = 0
3585    No options
3586    No first char
3587    Need char = 'f'
3588    Subject length lower bound = 7
3589    Starting byte set: 0 1 2 3 4 5 6 7 8 9
3590        1234abcdef
3591    --->1234abcdef
3592      1 ^              \d
3593      1  ^             \d
3594      1   ^            \d
3595      1    ^           \d
3596      2    ^   ^       d
3597     0: 4abcdef
3598        *** Failers
3599    No match
3600        abcdef
3601    No match
3602    
3603    /(?C1)\dabc(?C2)def/ISS
3604  Capturing subpattern count = 0  Capturing subpattern count = 0
3605  No options  No options
3606  No first char  No first char
# Line 3939  Need char = '<' Line 4004  Need char = '<'
4004          Bra          Bra
4005          CBra 1          CBra 1
4006          a          a
         Once  
4007          Recurse          Recurse
         Ket  
4008          b          b
4009          Ket          Ket
4010          Ket          Ket
# Line 4162  Need char = 'a' Line 4225  Need char = 'a'
4225          Any          Any
4226          \1          \1
4227          bbb          bbb
         Once  
4228          Recurse          Recurse
         Ket  
4229          d          d
4230          Ket          Ket
4231          End          End
# Line 4369  No first char Line 4430  No first char
4430  Need char = 'z'  Need char = 'z'
4431    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\M    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\M
4432  Minimum match() limit = 8  Minimum match() limit = 8
4433  Minimum match() recursion limit = 6  Minimum match() recursion limit = 7
4434   0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazz   0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazz
4435   1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa   1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
4436    aaaaaaaaaaaaaz\M    aaaaaaaaaaaaaz\M
4437  Minimum match() limit = 32768  Minimum match() limit = 32768
4438  Minimum match() recursion limit = 42  Minimum match() recursion limit = 43
4439  No match  No match
4440    
4441  /(aaa(?C1)bbb|ab)/I  /(aaa(?C1)bbb|ab)/I
# Line 4536  Need char = ']' Line 4597  Need char = ']'
4597          a          a
4598          CBra 2          CBra 2
4599          b          b
         Once  
4600          Recurse          Recurse
         Ket  
4601          c          c
4602          Ket          Ket
4603          Ket          Ket
# Line 4558  No need char Line 4617  No need char
4617          a          a
4618          CBra 2          CBra 2
4619          b          b
         Once  
4620          Recurse          Recurse
         Ket  
4621          c          c
4622          Ket          Ket
4623          KetRmax          KetRmax
# Line 4581  No need char Line 4638  No need char
4638          a          a
4639          CBra 2          CBra 2
4640          b          b
         Once  
4641          Recurse          Recurse
         Ket  
4642          c          c
4643          Ket          Ket
4644          Ket          Ket
# Line 4592  No need char Line 4647  No need char
4647          a          a
4648          CBra 2          CBra 2
4649          b          b
         Once  
4650          Recurse          Recurse
         Ket  
4651          c          c
4652          Ket          Ket
4653          Ket          Ket
# Line 4733  Need char = 'e' Line 4786  Need char = 'e'
4786   +4 ^   ^      e   +4 ^   ^      e
4787  No match  No match
4788    
4789  /a*b/ICDZ  /a*b/ICDZS
4790    ------------------------------------------------------------------
4791            Bra
4792            Callout 255 0 2
4793            a*+
4794            Callout 255 2 1
4795            b
4796            Callout 255 3 0
4797            Ket
4798            End
4799    ------------------------------------------------------------------
4800    Capturing subpattern count = 0
4801    Options:
4802    No first char
4803    Need char = 'b'
4804    Subject length lower bound = 1
4805    Starting byte set: a b
4806      ab
4807    --->ab
4808     +0 ^      a*
4809     +2 ^^     b
4810     +3 ^ ^
4811     0: ab
4812      aaaab
4813    --->aaaab
4814     +0 ^         a*
4815     +2 ^   ^     b
4816     +3 ^    ^
4817     0: aaaab
4818      aaaacb
4819    --->aaaacb
4820     +0 ^          a*
4821     +2 ^   ^      b
4822     +0  ^         a*
4823     +2  ^  ^      b
4824     +0   ^        a*
4825     +2   ^ ^      b
4826     +0    ^       a*
4827     +2    ^^      b
4828     +0      ^     a*
4829     +2      ^     b
4830     +3      ^^
4831     0: b
4832    
4833    /a*b/ICDZSS
4834  ------------------------------------------------------------------  ------------------------------------------------------------------
4835          Bra          Bra
4836          Callout 255 0 2          Callout 255 0 2
# Line 4816  Need char = 'b' Line 4913  Need char = 'b'
4913   +2    ^^      b   +2    ^^      b
4914  No match  No match
4915    
4916  /(abc|def)x/ICDZ  /(abc|def)x/ICDZS
4917    ------------------------------------------------------------------
4918            Bra
4919            Callout 255 0 9
4920            CBra 1
4921            Callout 255 1 1
4922            a
4923            Callout 255 2 1
4924            b
4925            Callout 255 3 1
4926            c
4927            Callout 255 4 0
4928            Alt
4929            Callout 255 5 1
4930            d
4931            Callout 255 6 1
4932            e
4933            Callout 255 7 1
4934            f
4935            Callout 255 8 0
4936            Ket
4937            Callout 255 9 1
4938            x
4939            Callout 255 10 0
4940            Ket
4941            End
4942    ------------------------------------------------------------------
4943    Capturing subpattern count = 1
4944    Options:
4945    No first char
4946    Need char = 'x'
4947    Subject length lower bound = 4
4948    Starting byte set: a d
4949      abcx
4950    --->abcx
4951     +0 ^        (abc|def)
4952     +1 ^        a
4953     +2 ^^       b
4954     +3 ^ ^      c
4955     +4 ^  ^     |
4956     +9 ^  ^     x
4957    +10 ^   ^
4958     0: abcx
4959     1: abc
4960      defx
4961    --->defx
4962     +0 ^        (abc|def)
4963     +1 ^        a
4964     +5 ^        d
4965     +6 ^^       e
4966     +7 ^ ^      f
4967     +8 ^  ^     )
4968     +9 ^  ^     x
4969    +10 ^   ^
4970     0: defx
4971     1: def
4972      ** Failers
4973    No match
4974      abcdefzx
4975    --->abcdefzx
4976     +0 ^            (abc|def)
4977     +1 ^            a
4978     +2 ^^           b
4979     +3 ^ ^          c
4980     +4 ^  ^         |
4981     +9 ^  ^         x
4982     +5 ^            d
4983     +0    ^         (abc|def)
4984     +1    ^         a
4985     +5    ^         d
4986     +6    ^^        e
4987     +7    ^ ^       f
4988     +8    ^  ^      )
4989     +9    ^  ^      x
4990    No match
4991    
4992    /(abc|def)x/ICDZSS
4993  ------------------------------------------------------------------  ------------------------------------------------------------------
4994          Bra          Bra
4995          Callout 255 0 9          Callout 255 0 9
# Line 4870  Need char = 'x' Line 5043  Need char = 'x'
5043  +10 ^   ^  +10 ^   ^
5044   0: defx   0: defx
5045   1: def   1: def
5046      ** Failers
5047    No match
5048    abcdefzx    abcdefzx
5049  --->abcdefzx  --->abcdefzx
5050   +0 ^            (abc|def)   +0 ^            (abc|def)
# Line 4970  No need char Line 5145  No need char
5145   0: abcdcdcd   0: abcdcdcd
5146   1: cd   1: cd
5147    
5148  /([ab]{,4}c|xy)/ICDZ  /([ab]{,4}c|xy)/ICDZS
5149    ------------------------------------------------------------------
5150            Bra
5151            Callout 255 0 14
5152            CBra 1
5153            Callout 255 1 4
5154            [ab]
5155            Callout 255 5 1
5156            {
5157            Callout 255 6 1
5158            ,
5159            Callout 255 7 1
5160            4
5161            Callout 255 8 1
5162            }
5163            Callout 255 9 1
5164            c
5165            Callout 255 10 0
5166            Alt
5167            Callout 255 11 1
5168            x
5169            Callout 255 12 1
5170            y
5171            Callout 255 13 0
5172            Ket
5173            Callout 255 14 0
5174            Ket
5175            End
5176    ------------------------------------------------------------------
5177    Capturing subpattern count = 1
5178    Options:
5179    No first char
5180    No need char
5181    Subject length lower bound = 2
5182    Starting byte set: a b x
5183        Note: that { does NOT introduce a quantifier
5184    --->Note: that { does NOT introduce a quantifier
5185     +0         ^                                        ([ab]{,4}c|xy)
5186     +1         ^                                        [ab]
5187     +5         ^^                                       {
5188    +11         ^                                        x
5189     +0                                 ^                ([ab]{,4}c|xy)
5190     +1                                 ^                [ab]
5191     +5                                 ^^               {
5192    +11                                 ^                x
5193     +0                                     ^            ([ab]{,4}c|xy)
5194     +1                                     ^            [ab]
5195     +5                                     ^^           {
5196    +11                                     ^            x
5197    No match
5198    
5199    /([ab]{,4}c|xy)/ICDZSS
5200  ------------------------------------------------------------------  ------------------------------------------------------------------
5201          Bra          Bra
5202          Callout 255 0 14          Callout 255 0 14
# Line 5422  No match Line 5648  No match
5648      123456\P      123456\P
5649  No match  No match
5650    
5651  /abc/I>testsavedregex  /abc/IS>testsavedregex
5652  Capturing subpattern count = 0  Capturing subpattern count = 0
5653  No options  No options
5654  First char = 'a'  First char = 'a'
5655  Need char = 'c'  Need char = 'c'
5656  Compiled regex written to testsavedregex  Subject length lower bound = 3
5657    No set of starting bytes
5658    Compiled pattern written to testsavedregex
5659    Study data written to testsavedregex
5660  <testsavedregex  <testsavedregex
5661  Compiled regex loaded from testsavedregex  Compiled pattern loaded from testsavedregex
5662  No study data  Study data loaded from testsavedregex
5663      abc      abc
5664   0: abc   0: abc
5665      ** Failers      ** Failers
# Line 5438  No match Line 5667  No match
5667      bca      bca
5668  No match  No match
5669    
5670  /abc/IF>testsavedregex  /abc/ISS>testsavedregex
5671  Capturing subpattern count = 0  Capturing subpattern count = 0
5672  No options  No options
5673  First char = 'a'  First char = 'a'
5674  Need char = 'c'  Need char = 'c'
5675  Compiled regex written to testsavedregex  Compiled pattern written to testsavedregex
5676  <testsavedregex  <testsavedregex
5677  Compiled regex (byte-inverted) loaded from testsavedregex  Compiled pattern loaded from testsavedregex
5678  No study data  No study data
5679      abc      abc
5680   0: abc   0: abc
# Line 5454  No match Line 5683  No match
5683      bca      bca
5684  No match  No match
5685    
5686  /(a|b)/IS>testsavedregex  /abc/IFS>testsavedregex
5687  Capturing subpattern count = 1  Capturing subpattern count = 0
5688  No options  No options
5689  No first char  First char = 'a'
5690  No need char  Need char = 'c'
5691  Subject length lower bound = 1  Subject length lower bound = 3
5692  Starting byte set: a b  No set of starting bytes
5693  Compiled regex written to testsavedregex  Compiled pattern written to testsavedregex
5694  Study data written to testsavedregex  Study data written to testsavedregex
5695  <testsavedregex  <testsavedregex
5696  Compiled regex loaded from testsavedregex  Compiled pattern (byte-inverted) loaded from testsavedregex
5697    Study data loaded from testsavedregex
5698        abc
5699     0: abc
5700        ** Failers
5701    No match
5702        bca
5703    No match
5704    
5705    /abc/IFSS>testsavedregex
5706    Capturing subpattern count = 0
5707    No options
5708    First char = 'a'
5709    Need char = 'c'
5710    Compiled pattern written to testsavedregex
5711    <testsavedregex
5712    Compiled pattern (byte-inverted) loaded from testsavedregex
5713    No study data
5714        abc
5715     0: abc
5716        ** Failers
5717    No match
5718        bca
5719    No match
5720    
5721    /(a|b)/IS>testsavedregex
5722    Capturing subpattern count = 1
5723    No options
5724    No first char
5725    No need char
5726    Subject length lower bound = 1
5727    Starting byte set: a b
5728    Compiled pattern written to testsavedregex
5729    Study data written to testsavedregex
5730    <testsavedregex
5731    Compiled pattern loaded from testsavedregex
5732  Study data loaded from testsavedregex  Study data loaded from testsavedregex
5733      abc      abc
5734   0: a   0: a
# Line 5475  Study data loaded from testsavedregex Line 5739  Study data loaded from testsavedregex
5739      def      def
5740  No match  No match
5741    
5742    /(a|b)/ISS>testsavedregex
5743    Capturing subpattern count = 1
5744    No options
5745    No first char
5746    No need char
5747    Compiled pattern written to testsavedregex
5748    <testsavedregex
5749    Compiled pattern loaded from testsavedregex
5750    No study data
5751        abc
5752     0: a
5753     1: a
5754        ** Failers
5755     0: a
5756     1: a
5757        def
5758    No match
5759    
5760  /(a|b)/ISF>testsavedregex  /(a|b)/ISF>testsavedregex
5761  Capturing subpattern count = 1  Capturing subpattern count = 1
5762  No options  No options
# Line 5482  No first char Line 5764  No first char
5764  No need char  No need char
5765  Subject length lower bound = 1  Subject length lower bound = 1
5766  Starting byte set: a b  Starting byte set: a b
5767  Compiled regex written to testsavedregex  Compiled pattern written to testsavedregex
5768  Study data written to testsavedregex  Study data written to testsavedregex
5769  <testsavedregex  <testsavedregex
5770  Compiled regex (byte-inverted) loaded from testsavedregex  Compiled pattern (byte-inverted) loaded from testsavedregex
5771  Study data loaded from testsavedregex  Study data loaded from testsavedregex
5772      abc      abc
5773   0: a   0: a
# Line 5496  Study data loaded from testsavedregex Line 5778  Study data loaded from testsavedregex
5778      def      def
5779  No match  No match
5780    
5781    /(a|b)/ISSF>testsavedregex
5782    Capturing subpattern count = 1
5783    No options
5784    No first char
5785    No need char
5786    Compiled pattern written to testsavedregex
5787    <testsavedregex
5788    Compiled pattern (byte-inverted) loaded from testsavedregex
5789    No study data
5790        abc
5791     0: a
5792     1: a
5793        ** Failers
5794     0: a
5795     1: a
5796        def
5797    No match
5798    
5799  ~<(\w+)/?>(.)*</(\1)>~smgI  ~<(\w+)/?>(.)*</(\1)>~smgI
5800  Capturing subpattern count = 3  Capturing subpattern count = 3
5801  Max back reference = 1  Max back reference = 1
# Line 6366  No first char Line 6666  No first char
6666  No need char  No need char
6667     /* this is a C style comment */\M     /* this is a C style comment */\M
6668  Minimum match() limit = 120  Minimum match() limit = 120
6669  Minimum match() recursion limit = 6  Minimum match() recursion limit = 35
6670   0: /* this is a C style comment */   0: /* this is a C style comment */
6671   1: /* this is a C style comment */   1: /* this is a C style comment */
6672    
# Line 6619  No match Line 6919  No match
6919  ------------------------------------------------------------------  ------------------------------------------------------------------
6920          Bra          Bra
6921          ^          ^
6922          a*       /i a*
6923       NC A       /i A
6924          \d          \d
6925          Ket          Ket
6926          End          End
# Line 7248  Matched, but too many substrings Line 7548  Matched, but too many substrings
7548  /[^a]+a/BZi  /[^a]+a/BZi
7549  ------------------------------------------------------------------  ------------------------------------------------------------------
7550          Bra          Bra
7551          [^A]++       /i [^A]++
7552       NC a       /i a
7553          Ket          Ket
7554          End          End
7555  ------------------------------------------------------------------  ------------------------------------------------------------------
# Line 7257  Matched, but too many substrings Line 7557  Matched, but too many substrings
7557  /[^a]+A/BZi  /[^a]+A/BZi
7558  ------------------------------------------------------------------  ------------------------------------------------------------------
7559          Bra          Bra
7560          [^A]++       /i [^A]++
7561       NC A       /i A
7562          Ket          Ket
7563          End          End
7564  ------------------------------------------------------------------  ------------------------------------------------------------------
# Line 7453  No match Line 7753  No match
7753  ------------------------------------------------------------------  ------------------------------------------------------------------
7754          Bra          Bra
7755          ^          ^
         Once  
7756          Recurse          Recurse
         Ket  
7757          [()]          [()]
7758          CBra 1          CBra 1
7759          Ket          Ket
# Line 7469  No match Line 7767  No match
7767          ^          ^
7768          CBra 1          CBra 1
7769          Cond          Cond
7770        2 Cond ref        2 Cond nref
7771          y          y
7772          Ket          Ket
7773          [()]          [()]
# Line 7489  No match Line 7787  No match
7787  ------------------------------------------------------------------  ------------------------------------------------------------------
7788          Bra          Bra
7789          ^          ^
         Once  
7790          Recurse          Recurse
         Ket  
7791          ()          ()
7792          CBra 1          CBra 1
7793          Ket          Ket
# Line 7503  No match Line 7799  No match
7799  ------------------------------------------------------------------  ------------------------------------------------------------------
7800          Bra          Bra
7801          ^          ^
         Once  
7802          Recurse          Recurse
         Ket  
7803          [(\]a]          [(\]a]
7804          CBra 1          CBra 1
7805          Ket          Ket
# Line 7518  No match Line 7812  No match
7812  ------------------------------------------------------------------  ------------------------------------------------------------------
7813          Bra          Bra
7814          ^          ^
         Once  
7815          Recurse          Recurse
         Ket  
7816          CBra 1          CBra 1
7817          Ket          Ket
7818          Ket          Ket
# Line 7972  No match Line 8264  No match
8264          Alt          Alt
8265          c          c
8266          Ket          Ket
         Once  
8267          Recurse          Recurse
8268          Ket          Ket
         Ket  
8269          End          End
8270  ------------------------------------------------------------------  ------------------------------------------------------------------
8271      abc      abc
# Line 7986  No match Line 8276  No match
8276  ------------------------------------------------------------------  ------------------------------------------------------------------
8277          Bra          Bra
8278          xy          xy
         Once  
8279          Recurse          Recurse
         Ket  
8280          CBra 1          CBra 1
8281          abc          abc
8282          Ket          Ket
# Line 8642  No match Line 8930  No match
8930  +13   ^  ^      (*FAIL)  +13   ^  ^      (*FAIL)
8931  No match  No match
8932    
 /a(*PRUNE:XXX)b/  
 Failed: (*VERB) with an argument is not supported at offset 8  
   
8933  /a(*MARK)b/  /a(*MARK)b/
8934  Failed: (*VERB) not recognized at offset 7  Failed: (*MARK) must have an argument at offset 7
8935    
8936  /(?i:A{1,}\6666666666)/  /(?i:A{1,}\6666666666)/
8937  Failed: number is too big at offset 19  Failed: number is too big at offset 19
# Line 8735  No match Line 9020  No match
9020  No match  No match
9021      a\x85b      a\x85b
9022  No match  No match
9023    
9024    /(*ANY).*/g
9025        abc\r\ndef
9026     0: abc
9027     0:
9028     0: def
9029     0:
9030    
9031    /(*ANYCRLF).*/g
9032        abc\r\ndef
9033     0: abc
9034     0:
9035     0: def
9036     0:
9037    
9038    /(*CRLF).*/g
9039        abc\r\ndef
9040     0: abc
9041     0:
9042     0: def
9043     0:
9044    
9045  /a\Rb/I<bsr_anycrlf>  /a\Rb/I<bsr_anycrlf>
9046  Capturing subpattern count = 0  Capturing subpattern count = 0
# Line 9221  No match Line 9527  No match
9527   +0        ^     x   +0        ^     x
9528   +0         ^    x   +0         ^    x
9529  No match  No match
9530    
9531    /(*NO_START_OPT)xyz/C
9532      abcxyz
9533    --->abcxyz
9534    +15 ^          x
9535    +15  ^         x
9536    +15   ^        x
9537    +15    ^       x
9538    +16    ^^      y
9539    +17    ^ ^     z
9540    +18    ^  ^
9541     0: xyz
9542    
9543    /xyz/CY
9544      abcxyz
9545    --->abcxyz
9546     +0 ^          x
9547     +0  ^         x
9548     +0   ^        x
9549     +0    ^       x
9550     +1    ^^      y
9551     +2    ^ ^     z
9552     +3    ^  ^
9553     0: xyz
9554    
9555  /^"((?(?=[a])[^"])|b)*"$/C  /^"((?(?=[a])[^"])|b)*"$/C
9556      "ab"      "ab"
# Line 9574  Partial match: +ab Line 9904  Partial match: +ab
9904  /(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/BZ  /(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/BZ
9905  ------------------------------------------------------------------  ------------------------------------------------------------------
9906          Bra          Bra
         Once  
9907          Recurse          Recurse
         Ket  
         Once  
9908          Recurse          Recurse
         Ket  
9909          Cond          Cond
9910          Cond def          Cond def
9911          CBra 1          CBra 1
# Line 9600  Partial match: +ab Line 9926  Partial match: +ab
9926  /(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/BZ  /(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/BZ
9927  ------------------------------------------------------------------  ------------------------------------------------------------------
9928          Bra          Bra
         Once  
9929          Recurse          Recurse
         Ket  
         Once  
9930          Recurse          Recurse
         Ket  
9931          Cond          Cond
9932          Cond def          Cond def
9933          CBra 1          CBra 1
# Line 10220  Need char = ':' Line 10542  Need char = ':'
10542  Subject length lower bound = 2  Subject length lower bound = 2
10543  No set of starting bytes  No set of starting bytes
10544    
10545    /(?|(?<a>A)|(?<a>B))/I
10546    Capturing subpattern count = 1
10547    Named capturing subpatterns:
10548      a   1
10549      a   1
10550    No options
10551    No first char
10552    No need char
10553        AB\Ca
10554     0: A
10555     1: A
10556      C A (1) a
10557        BA\Ca
10558     0: B
10559     1: B
10560      C B (1) a
10561    
10562    /(?|(?<a>A)|(?<b>B))/
10563    Failed: different names for subpatterns of the same number are not allowed at offset 15
10564    
10565    /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |
10566        b(?<quote> (?<apostrophe>')|(?<realquote>")) )
10567        (?('quote')[a-z]+|[0-9]+)/JIx
10568    Capturing subpattern count = 6
10569    Named capturing subpatterns:
10570      apostrophe   2
10571      apostrophe   5
10572      quote        1
10573      quote        4
10574      realquote    3
10575      realquote    6
10576    Options: extended dupnames
10577    No first char
10578    No need char
10579        a"aaaaa
10580     0: a"aaaaa
10581     1: "
10582     2: <unset>
10583     3: "
10584        b"aaaaa
10585     0: b"aaaaa
10586     1: <unset>
10587     2: <unset>
10588     3: <unset>
10589     4: "
10590     5: <unset>
10591     6: "
10592        ** Failers
10593    No match
10594        b"11111
10595    No match
10596        a"11111
10597    No match
10598    
10599    /^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/JDZx
10600    ------------------------------------------------------------------
10601            Bra
10602            ^
10603            Bra
10604            CBra 1
10605            a
10606            Ket
10607            CBra 2
10608            b
10609            Ket
10610            CBra 3
10611            c
10612            Ket
10613            CBra 4
10614            d
10615            Ket
10616            Alt
10617            CBra 1
10618            e
10619            Ket
10620            Ket
10621            Cond
10622          4 Cond nref
10623            X
10624            Alt
10625            Y
10626            Ket
10627            Ket
10628            End
10629    ------------------------------------------------------------------
10630    Capturing subpattern count = 4
10631    Named capturing subpatterns:
10632      D   4
10633      D   1
10634    Options: anchored extended dupnames
10635    No first char
10636    No need char
10637        abcdX
10638     0: abcdX
10639     1: a
10640     2: b
10641     3: c
10642     4: d
10643        eX
10644     0: eX
10645     1: e
10646        ** Failers
10647    No match
10648        abcdY
10649    No match
10650        ey
10651    No match
10652    
10653    /(?<A>a) (b)(c)  (?<A>d  (?(R&A)$ | (?4)) )/JDZx
10654    ------------------------------------------------------------------
10655            Bra
10656            CBra 1
10657            a
10658            Ket
10659            CBra 2
10660            b
10661            Ket
10662            CBra 3
10663            c
10664            Ket
10665            CBra 4
10666            d
10667            Cond
10668            Cond nrecurse 1
10669            $
10670            Alt
10671            Recurse
10672            Ket
10673            Ket
10674            Ket
10675            End
10676    ------------------------------------------------------------------
10677    Capturing subpattern count = 4
10678    Named capturing subpatterns:
10679      A   1
10680      A   4
10681    Options: extended dupnames
10682    First char = 'a'
10683    Need char = 'd'
10684        abcdd
10685     0: abcdd
10686     1: a
10687     2: b
10688     3: c
10689     4: dd
10690        ** Failers
10691    No match
10692        abcdde
10693    No match
10694    
10695    /abcd*/
10696        xxxxabcd\P
10697     0: abcd
10698        xxxxabcd\P\P
10699    Partial match: abcd
10700    
10701    /abcd*/i
10702        xxxxabcd\P
10703     0: abcd
10704        xxxxabcd\P\P
10705    Partial match: abcd
10706        XXXXABCD\P
10707     0: ABCD
10708        XXXXABCD\P\P
10709    Partial match: ABCD
10710    
10711    /abc\d*/
10712        xxxxabc1\P
10713     0: abc1
10714        xxxxabc1\P\P
10715    Partial match: abc1
10716    
10717    /(a)bc\1*/
10718        xxxxabca\P
10719     0: abca
10720     1: a
10721        xxxxabca\P\P
10722    Partial match: abca
10723    
10724    /abc[de]*/
10725        xxxxabcde\P
10726     0: abcde
10727        xxxxabcde\P\P
10728    Partial match: abcde
10729    
10730    /-- This is not in the Perl >= 5.10 test because Perl seems currently to be
10731        broken and not behaving as specified in that it *does* bumpalong after
10732        hitting (*COMMIT). --/
10733    
10734    /(?1)(A(*COMMIT)|B)D/
10735        ABD
10736     0: ABD
10737     1: B
10738        XABD
10739     0: ABD
10740     1: B
10741        BAD
10742     0: BAD
10743     1: A
10744        ABXABD
10745     0: ABD
10746     1: B
10747        ** Failers
10748    No match
10749        ABX
10750    No match
10751        BAXBAD
10752    No match
10753    
10754    /(\3)(\1)(a)/<JS>
10755        cat
10756     0: a
10757     1:
10758     2:
10759     3: a
10760    
10761    /(\3)(\1)(a)/SI<JS>
10762    Capturing subpattern count = 3
10763    Max back reference = 3
10764    Options:
10765    No first char
10766    Need char = 'a'
10767    Subject length lower bound = 1
10768    No set of starting bytes
10769        cat
10770     0: a
10771     1:
10772     2:
10773     3: a
10774    
10775    /(\3)(\1)(a)/SI
10776    Capturing subpattern count = 3
10777    Max back reference = 3
10778    No options
10779    No first char
10780    Need char = 'a'
10781    Subject length lower bound = 3
10782    No set of starting bytes
10783        cat
10784    No match
10785    
10786    /i(?(DEFINE)(?<s>a))/SI
10787    Capturing subpattern count = 1
10788    Named capturing subpatterns:
10789      s   1
10790    No options
10791    First char = 'i'
10792    No need char
10793    Subject length lower bound = 1
10794    No set of starting bytes
10795        i
10796     0: i
10797    
10798    /()i(?(1)a)/SI
10799    Capturing subpattern count = 1
10800    No options
10801    No first char
10802    Need char = 'i'
10803    Subject length lower bound = 1
10804    Starting byte set: i
10805        ia
10806     0: ia
10807     1:
10808    
10809    /(?i)a(?-i)b|c/BZ
10810    ------------------------------------------------------------------
10811            Bra
10812         /i a
10813            b
10814            Alt
10815            c
10816            Ket
10817            End
10818    ------------------------------------------------------------------
10819        XabX
10820     0: ab
10821        XAbX
10822     0: Ab
10823        CcC
10824     0: c
10825        ** Failers
10826    No match
10827        XABX
10828    No match
10829    
10830    /(?i)a(?s)b|c/BZ
10831    ------------------------------------------------------------------
10832            Bra
10833         /i ab
10834            Alt
10835         /i c
10836            Ket
10837            End
10838    ------------------------------------------------------------------
10839    
10840    /(?i)a(?s-i)b|c/BZ
10841    ------------------------------------------------------------------
10842            Bra
10843         /i a
10844            b
10845            Alt
10846            c
10847            Ket
10848            End
10849    ------------------------------------------------------------------
10850    
10851    /^(ab(c\1)d|x){2}$/BZ
10852    ------------------------------------------------------------------
10853            Bra
10854            ^
10855            Once
10856            CBra 1
10857            ab
10858            CBra 2
10859            c
10860            \1
10861            Ket
10862            d
10863            Alt
10864            x
10865            Ket
10866            Ket
10867            Once
10868            CBra 1
10869            ab
10870            CBra 2
10871            c
10872            \1
10873            Ket
10874            d
10875            Alt
10876            x
10877            Ket
10878            Ket
10879            $
10880            Ket
10881            End
10882    ------------------------------------------------------------------
10883        xabcxd
10884     0: xabcxd
10885     1: abcxd
10886     2: cx
10887    
10888    /^(?&t)*+(?(DEFINE)(?<t>.))$/BZ
10889    ------------------------------------------------------------------
10890            Bra
10891            ^
10892            Braposzero
10893            SBraPos
10894            Recurse
10895            KetRpos
10896            Cond
10897            Cond def
10898            CBra 1
10899            Any
10900            Ket
10901            Ket
10902            $
10903            Ket
10904            End
10905    ------------------------------------------------------------------
10906    
10907    /^(?&t)*(?(DEFINE)(?<t>.))$/BZ
10908    ------------------------------------------------------------------
10909            Bra
10910            ^
10911            Brazero
10912            Once
10913            Recurse
10914            KetRmax
10915            Cond
10916            Cond def
10917            CBra 1
10918            Any
10919            Ket
10920            Ket
10921            $
10922            Ket
10923            End
10924    ------------------------------------------------------------------
10925    
10926    / -- The first four of these are not in the Perl >= 5.10 test because Perl
10927         documents that the use of \K in assertions is "not well defined". The
10928         last is here because Perl gives the match as "b" rather than "ab". I
10929         believe this to be a Perl bug. --/
10930    
10931    /(?=a\Kb)ab/
10932        ab
10933     0: b
10934    
10935    /(?!a\Kb)ac/
10936        ac
10937     0: ac
10938    
10939    /^abc(?<=b\Kc)d/
10940        abcd
10941     0: cd
10942    
10943    /^abc(?<!b\Kq)d/
10944        abcd
10945     0: abcd
10946    
10947    /(?>a\Kb)z|(ab)/
10948        ab
10949     0: ab
10950     1: ab
10951    
10952    /----------------------/
10953    
10954    /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
10955    Failed: recursive call could loop indefinitely at offset 31
10956    
10957    /abc(*MARK:)pqr/
10958    Failed: (*MARK) must have an argument at offset 10
10959    
10960    /abc(*:)pqr/
10961    Failed: (*MARK) must have an argument at offset 6
10962    
10963    /abc(*FAIL:123)xyz/
10964    Failed: an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT) at offset 13
10965    
10966    /--- This should, and does, fail. In Perl, it does not, which I think is a
10967         bug because replacing the B in the pattern by (B|D) does make it fail. ---/
10968    
10969    /A(*COMMIT)B/+K
10970        ACABX
10971    No match
10972    
10973    /--- These should be different, but in Perl 5.11 are not, which I think
10974         is a bug in Perl. ---/
10975    
10976    /A(*THEN)B|A(*THEN)C/K
10977        AC
10978     0: AC
10979    
10980    /A(*PRUNE)B|A(*PRUNE)C/K
10981        AC
10982    No match
10983    
10984    /--- A whole lot of tests of verbs with arguments are here rather than in test
10985         11 because Perl doesn't seem to follow its specification entirely
10986         correctly. ---/
10987    
10988    /--- Perl 5.11 sets $REGERROR on the AC failure case here; PCRE does not. It is
10989         not clear how Perl defines "involved in the failure of the match". ---/
10990    
10991    /^(A(*THEN:A)B|C(*THEN:B)D)/K
10992        AB
10993     0: AB
10994     1: AB
10995        CD
10996     0: CD
10997     1: CD
10998        ** Failers
10999    No match
11000        AC
11001    No match
11002        CB
11003    No match, mark = B
11004    
11005    /--- Check the use of names for success and failure. PCRE doesn't show these
11006    names for success, though Perl does, contrary to its spec. ---/
11007    
11008    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
11009        AB
11010     0: AB
11011     1: AB
11012        CD
11013     0: CD
11014     1: CD
11015        ** Failers
11016    No match
11017        AC
11018    No match, mark = A
11019        CB
11020    No match, mark = B
11021    
11022    /--- An empty name does not pass back an empty string. It is the same as if no
11023    name were given. ---/
11024    
11025    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/K
11026        AB
11027     0: AB
11028     1: AB
11029        CD
11030     0: CD
11031     1: CD
11032    
11033    /--- PRUNE goes to next bumpalong; COMMIT does not. ---/
11034    
11035    /A(*PRUNE:A)B/K
11036        ACAB
11037     0: AB
11038    
11039    /(*MARK:A)(*PRUNE:B)(C|X)/KS
11040        C
11041     0: C
11042     1: C
11043    MK: A
11044        D
11045    No match
11046    
11047    /(*MARK:A)(*PRUNE:B)(C|X)/KSS
11048        C
11049     0: C
11050     1: C
11051    MK: A
11052        D
11053    No match, mark = B
11054    
11055    /(*MARK:A)(*THEN:B)(C|X)/KS
11056        C
11057     0: C
11058     1: C
11059    MK: A
11060        D
11061    No match
11062    
11063    /(*MARK:A)(*THEN:B)(C|X)/KSS
11064        C
11065     0: C
11066     1: C
11067    MK: A
11068        D
11069    No match, mark = B
11070    
11071    /--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/
11072    
11073    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK
11074        AAAC
11075    No match
11076    
11077    /--- Same --/
11078    
11079    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK
11080        AAAC
11081    No match
11082    
11083    /--- This should fail; the SKIP advances by one, but when we get to AC, the
11084         PRUNE kills it. ---/
11085    
11086    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
11087        AAAC
11088    No match
11089    
11090    /A(*:A)A+(*SKIP)(B|Z) | AC/xK
11091        AAAC
11092    No match
11093    
11094    /--- This should fail, as a null name is the same as no name ---/
11095    
11096    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK
11097        AAAC
11098    No match
11099    
11100    /--- This fails in PCRE, and I think that is in accordance with Perl's
11101         documentation, though in Perl it succeeds. ---/
11102    
11103    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK
11104        AAAC
11105    No match
11106    
11107    /--- Mark names can be duplicated ---/
11108    
11109    /A(*:A)B|X(*:A)Y/K
11110        AABC
11111     0: AB
11112    MK: A
11113        XXYZ
11114     0: XY
11115    MK: A
11116    
11117    /^A(*:A)B|^X(*:A)Y/K
11118        ** Failers
11119    No match
11120        XAQQ
11121    No match, mark = A
11122    
11123    /--- A check on what happens after hitting a mark and them bumping along to
11124    something that does not even start. Perl reports tags after the failures here,
11125    though it does not when the individual letters are made into something
11126    more complicated. ---/
11127    
11128    /A(*:A)B|XX(*:B)Y/K
11129        AABC
11130     0: AB
11131    MK: A
11132        XXYZ
11133     0: XXY
11134    MK: B
11135        ** Failers
11136    No match
11137        XAQQ
11138    No match
11139        XAQQXZZ
11140    No match
11141        AXQQQ
11142    No match
11143        AXXQQQ
11144    No match
11145    
11146    /--- COMMIT at the start of a pattern should be the same as an anchor. Perl
11147    optimizations defeat this. So does the PCRE optimization unless we disable it
11148    with \Y. ---/
11149    
11150    /(*COMMIT)ABC/
11151        ABCDEFG
11152     0: ABC
11153        ** Failers
11154    No match
11155        DEFGABC\Y
11156    No match
11157    
11158    /--- Repeat some tests with added studying. ---/
11159    
11160    /A(*COMMIT)B/+KS
11161        ACABX
11162    No match
11163    
11164    /A(*THEN)B|A(*THEN)C/KS
11165        AC
11166     0: AC
11167    
11168    /A(*PRUNE)B|A(*PRUNE)C/KS
11169        AC
11170    No match
11171    
11172    /^(A(*THEN:A)B|C(*THEN:B)D)/KS
11173        AB
11174     0: AB
11175     1: AB
11176        CD
11177     0: CD
11178     1: CD
11179        ** Failers
11180    No match
11181        AC
11182    No match
11183        CB
11184    No match, mark = B
11185    
11186    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/KS
11187        AB
11188     0: AB
11189     1: AB
11190        CD
11191     0: CD
11192     1: CD
11193        ** Failers
11194    No match
11195        AC
11196    No match, mark = A
11197        CB
11198    No match, mark = B
11199    
11200    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/KS
11201        AB
11202     0: AB
11203     1: AB
11204        CD
11205     0: CD
11206     1: CD
11207    
11208    /A(*PRUNE:A)B/KS
11209        ACAB
11210     0: AB
11211    
11212    /(*MARK:A)(*PRUNE:B)(C|X)/KS
11213        C
11214     0: C
11215     1: C
11216    MK: A
11217        D
11218    No match
11219    
11220    /(*MARK:A)(*THEN:B)(C|X)/KS
11221        C
11222     0: C
11223     1: C
11224    MK: A
11225        D
11226    No match
11227    
11228    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xKS
11229        AAAC
11230    No match
11231    
11232    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xKS
11233        AAAC
11234    No match
11235    
11236    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xKS
11237        AAAC
11238    No match
11239    
11240    /A(*:A)A+(*SKIP)(B|Z) | AC/xKS
11241        AAAC
11242    No match
11243    
11244    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xKS
11245        AAAC
11246    No match
11247    
11248    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xKS
11249        AAAC
11250    No match
11251    
11252    /A(*:A)B|XX(*:B)Y/KS
11253        AABC
11254     0: AB
11255    MK: A
11256        XXYZ
11257     0: XXY
11258    MK: B
11259        ** Failers
11260    No match
11261        XAQQ
11262    No match
11263        XAQQXZZ
11264    No match
11265        AXQQQ
11266    No match
11267        AXXQQQ
11268    No match
11269    
11270    /(*COMMIT)ABC/
11271        ABCDEFG
11272     0: ABC
11273        ** Failers
11274    No match
11275        DEFGABC\Y
11276    No match
11277    
11278    /^(ab (c+(*THEN)cd) | xyz)/x
11279        abcccd
11280    No match
11281    
11282    /^(ab (c+(*PRUNE)cd) | xyz)/x
11283        abcccd
11284    No match
11285    
11286    /^(ab (c+(*FAIL)cd) | xyz)/x
11287        abcccd
11288    No match
11289    
11290    /--- Perl 5.11 gets some of these wrong ---/
11291    
11292    /(?>.(*ACCEPT))*?5/
11293        abcde
11294     0: a
11295    
11296    /(.(*ACCEPT))*?5/
11297        abcde
11298     0: a
11299     1: a
11300    
11301    /(.(*ACCEPT))5/
11302        abcde
11303     0: a
11304     1: a
11305    
11306    /(.(*ACCEPT))*5/
11307        abcde
11308     0: a
11309     1: a
11310    
11311    /A\NB./BZ
11312    ------------------------------------------------------------------
11313            Bra
11314            A
11315            Any
11316            B
11317            Any
11318            Ket
11319            End
11320    ------------------------------------------------------------------
11321        ACBD
11322     0: ACBD
11323        *** Failers
11324    No match
11325        A\nB
11326    No match
11327        ACB\n
11328    No match
11329    
11330    /A\NB./sBZ
11331    ------------------------------------------------------------------
11332            Bra
11333            A
11334            Any
11335            B
11336            AllAny
11337            Ket
11338            End
11339    ------------------------------------------------------------------
11340        ACBD
11341     0: ACBD
11342        ACB\n
11343     0: ACB\x0a
11344        *** Failers
11345    No match
11346        A\nB
11347    No match
11348    
11349    /A\NB/<crlf>
11350        A\nB
11351     0: A\x0aB
11352        A\rB
11353     0: A\x0dB
11354        ** Failers
11355    No match
11356        A\r\nB
11357    No match
11358    
11359    /\R+b/BZ
11360    ------------------------------------------------------------------
11361            Bra
11362            \R++
11363            b
11364            Ket
11365            End
11366    ------------------------------------------------------------------
11367    
11368    /\R+\n/BZ
11369    ------------------------------------------------------------------
11370            Bra
11371            \R+
11372            \x0a
11373            Ket
11374            End
11375    ------------------------------------------------------------------
11376    
11377    /\R+\d/BZ
11378    ------------------------------------------------------------------
11379            Bra
11380            \R++
11381            \d
11382            Ket
11383            End
11384    ------------------------------------------------------------------
11385    
11386    /\d*\R/BZ
11387    ------------------------------------------------------------------
11388            Bra
11389            \d*+
11390            \R
11391            Ket
11392            End
11393    ------------------------------------------------------------------
11394    
11395    /\s*\R/BZ
11396    ------------------------------------------------------------------
11397            Bra
11398            \s*+
11399            \R
11400            Ket
11401            End
11402    ------------------------------------------------------------------
11403    
11404    /-- Perl treats this one differently, not failing the second string. I believe
11405        that is a bug in Perl. --/
11406    
11407    /^((abc|abcx)(*THEN)y|abcd)/
11408        abcd
11409     0: abcd
11410     1: abcd
11411        *** Failers
11412    No match
11413        abcxy
11414    No match
11415    
11416    /(?<=abc)def/
11417        abc\P\P
11418    Partial match: abc
11419    
11420    /abc$/
11421        abc
11422     0: abc
11423        abc\P
11424     0: abc
11425        abc\P\P
11426    Partial match: abc
11427    
11428    /abc$/m
11429        abc
11430     0: abc
11431        abc\n
11432     0: abc
11433        abc\P\P
11434    Partial match: abc
11435        abc\n\P\P
11436     0: abc
11437        abc\P
11438     0: abc
11439        abc\n\P
11440     0: abc
11441    
11442    /abc\z/
11443        abc
11444     0: abc
11445        abc\P
11446     0: abc
11447        abc\P\P
11448    Partial match: abc
11449    
11450    /abc\Z/
11451        abc
11452     0: abc
11453        abc\P
11454     0: abc
11455        abc\P\P
11456    Partial match: abc
11457    
11458    /abc\b/
11459        abc
11460     0: abc
11461        abc\P
11462     0: abc
11463        abc\P\P
11464    Partial match: abc
11465    
11466    /abc\B/
11467        abc
11468    No match
11469        abc\P
11470    Partial match: abc
11471        abc\P\P
11472    Partial match: abc
11473    
11474    /.+/
11475        abc\>0
11476     0: abc
11477        abc\>1
11478     0: bc
11479        abc\>2
11480     0: c
11481        abc\>3
11482    No match
11483        abc\>4
11484    Error -24 (bad offset value)
11485        abc\>-4
11486    Error -24 (bad offset value)
11487    
11488    /^\cģ/
11489    Failed: \c must be followed by an ASCII character at offset 3
11490    
11491    /(?P<abn>(?P=abn)xxx)/BZ
11492    ------------------------------------------------------------------
11493            Bra
11494            Once
11495            CBra 1
11496            \1
11497            xxx
11498            Ket
11499            Ket
11500            Ket
11501            End
11502    ------------------------------------------------------------------
11503    
11504    /(a\1z)/BZ
11505    ------------------------------------------------------------------
11506            Bra
11507            Once
11508            CBra 1
11509            a
11510            \1
11511            z
11512            Ket
11513            Ket
11514            Ket
11515            End
11516    ------------------------------------------------------------------
11517    
11518    /(?P<abn>(?P=abn)(?<badstufxxx)/BZ
11519    Failed: syntax error in subpattern name (missing terminator) at offset 29
11520    
11521    /(?P<abn>(?P=axn)xxx)/BZ
11522    Failed: reference to non-existent subpattern at offset 15
11523    
11524    /(?P<abn>(?P=axn)xxx)(?<axn>yy)/BZ
11525    ------------------------------------------------------------------
11526            Bra
11527            CBra 1
11528            \2
11529            xxx
11530            Ket
11531            CBra 2
11532            yy
11533            Ket
11534            Ket
11535            End
11536    ------------------------------------------------------------------
11537    
11538    /-- These tests are here because Perl gets the first one wrong. --/
11539    
11540    /(\R*)(.)/s
11541        \r\n
11542     0: \x0d
11543     1:
11544     2: \x0d
11545        \r\r\n\n\r
11546     0: \x0d\x0d\x0a\x0a\x0d
11547     1: \x0d\x0d\x0a\x0a
11548     2: \x0d
11549        \r\r\n\n\r\n
11550     0: \x0d\x0d\x0a\x0a\x0d
11551     1: \x0d\x0d\x0a\x0a
11552     2: \x0d
11553    
11554    /(\R)*(.)/s
11555        \r\n
11556     0: \x0d
11557     1: <unset>
11558     2: \x0d
11559        \r\r\n\n\r
11560     0: \x0d\x0d\x0a\x0a\x0d
11561     1: \x0a
11562     2: \x0d
11563        \r\r\n\n\r\n
11564     0: \x0d\x0d\x0a\x0a\x0d
11565     1: \x0a
11566     2: \x0d
11567    
11568    /((?>\r\n|\n|\x0b|\f|\r|\x85)*)(.)/s
11569        \r\n
11570     0: \x0d
11571     1:
11572     2: \x0d
11573        \r\r\n\n\r
11574     0: \x0d\x0d\x0a\x0a\x0d
11575     1: \x0d\x0d\x0a\x0a
11576     2: \x0d
11577        \r\r\n\n\r\n
11578     0: \x0d\x0d\x0a\x0a\x0d
11579     1: \x0d\x0d\x0a\x0a
11580     2: \x0d
11581    
11582    /-- --/
11583    
11584    /^abc$/BZ
11585    ------------------------------------------------------------------
11586            Bra
11587            ^
11588            abc
11589            $
11590            Ket
11591            End
11592    ------------------------------------------------------------------
11593    
11594    /^abc$/BZm
11595    ------------------------------------------------------------------
11596            Bra
11597         /m ^
11598            abc
11599         /m $
11600            Ket
11601            End
11602    ------------------------------------------------------------------
11603    
11604    /^(a)*+(\w)/S
11605        aaaaX
11606     0: aaaaX
11607     1: a
11608     2: X
11609        ** Failers
11610    No match
11611        aaaa
11612    No match
11613    
11614    /^(?:a)*+(\w)/S
11615        aaaaX
11616     0: aaaaX
11617     1: X
11618        ** Failers
11619    No match
11620        aaaa
11621    No match
11622    
11623    /(a)++1234/SDZ
11624    ------------------------------------------------------------------
11625            Bra
11626            CBraPos 1
11627            a
11628            KetRpos
11629            1234
11630            Ket
11631            End
11632    ------------------------------------------------------------------
11633    Capturing subpattern count = 1
11634    No options
11635    First char = 'a'
11636    Need char = '4'
11637    Subject length lower bound = 5
11638    No set of starting bytes
11639    
11640    /([abc])++1234/SI
11641    Capturing subpattern count = 1
11642    No options
11643    No first char
11644    Need char = '4'
11645    Subject length lower bound = 5
11646    Starting byte set: a b c
11647    
11648    /(?<=(abc)+)X/
11649    Failed: lookbehind assertion is not fixed length at offset 10
11650    
11651    /(^ab)/I
11652    Capturing subpattern count = 1
11653    Options: anchored
11654    No first char
11655    No need char
11656    
11657    /(^ab)++/I
11658    Capturing subpattern count = 1
11659    Options: anchored
11660    No first char
11661    No need char
11662    
11663    /(^ab|^)+/I
11664    Capturing subpattern count = 1
11665    Options: anchored
11666    No first char
11667    No need char
11668    
11669    /(^ab|^)++/I
11670    Capturing subpattern count = 1
11671    Options: anchored
11672    No first char
11673    No need char
11674    
11675    /(?:^ab)/I
11676    Capturing subpattern count = 0
11677    Options: anchored
11678    No first char
11679    No need char
11680    
11681    /(?:^ab)++/I
11682    Capturing subpattern count = 0
11683    Options: anchored
11684    No first char
11685    No need char
11686    
11687    /(?:^ab|^)+/I
11688    Capturing subpattern count = 0
11689    Options: anchored
11690    No first char
11691    No need char
11692    
11693    /(?:^ab|^)++/I
11694    Capturing subpattern count = 0
11695    Options: anchored
11696    No first char
11697    No need char
11698    
11699    /(.*ab)/I
11700    Capturing subpattern count = 1
11701    No options
11702    First char at start or follows newline
11703    Need char = 'b'
11704    
11705    /(.*ab)++/I
11706    Capturing subpattern count = 1
11707    No options
11708    First char at start or follows newline
11709    Need char = 'b'
11710    
11711    /(.*ab|.*)+/I
11712    Capturing subpattern count = 1
11713    No options
11714    First char at start or follows newline
11715    No need char
11716    
11717    /(.*ab|.*)++/I
11718    Capturing subpattern count = 1
11719    No options
11720    First char at start or follows newline
11721    No need char
11722    
11723    /(?:.*ab)/I
11724    Capturing subpattern count = 0
11725    No options
11726    First char at start or follows newline
11727    Need char = 'b'
11728    
11729    /(?:.*ab)++/I
11730    Capturing subpattern count = 0
11731    No options
11732    First char at start or follows newline
11733    Need char = 'b'
11734    
11735    /(?:.*ab|.*)+/I
11736    Capturing subpattern count = 0
11737    No options
11738    First char at start or follows newline
11739    No need char
11740    
11741    /(?:.*ab|.*)++/I
11742    Capturing subpattern count = 0
11743    No options
11744    First char at start or follows newline
11745    No need char
11746    
11747    /(?=a)[bcd]/I
11748    Capturing subpattern count = 0
11749    No options
11750    First char = 'a'
11751    No need char
11752    
11753    /((?=a))[bcd]/I
11754    Capturing subpattern count = 1
11755    No options
11756    First char = 'a'
11757    No need char
11758    
11759    /((?=a))+[bcd]/I
11760    Capturing subpattern count = 1
11761    No options
11762    First char = 'a'
11763    No need char
11764    
11765    /((?=a))++[bcd]/I
11766    Capturing subpattern count = 1
11767    No options
11768    First char = 'a'
11769    No need char
11770    
11771    /(?=a+)[bcd]/iI
11772    Capturing subpattern count = 0
11773    Options: caseless
11774    First char = 'a' (caseless)
11775    No need char
11776    
11777    /(?=a+?)[bcd]/iI
11778    Capturing subpattern count = 0
11779    Options: caseless
11780    First char = 'a' (caseless)
11781    No need char
11782    
11783    /(?=a++)[bcd]/iI
11784    Capturing subpattern count = 0
11785    Options: caseless
11786    First char = 'a' (caseless)
11787    No need char
11788    
11789    /(?=a{3})[bcd]/iI
11790    Capturing subpattern count = 0
11791    Options: caseless
11792    First char = 'a' (caseless)
11793    Need char = 'a' (caseless)
11794    
11795    /(abc)\1+/S
11796    
11797    /-- Perl doesn't get these right IMO (the 3rd is PCRE-specific) --/
11798    
11799    /(?1)(?:(b(*ACCEPT))){0}/
11800        b
11801     0: b
11802    
11803    /(?1)(?:(b(*ACCEPT))){0}c/
11804        bc
11805     0: bc
11806        ** Failers
11807    No match
11808        b
11809    No match
11810    
11811    /(?1)(?:((*ACCEPT))){0}c/
11812        c
11813     0: c
11814        c\N
11815     0: c
11816    
11817    /^.*?(?(?=a)a|b(*THEN)c)/
11818        ba
11819     0: ba
11820    
11821    /^.*?(?(?=a)a|bc)/
11822        ba
11823     0: ba
11824    
11825    /-- --/
11826    
11827    /-- These studied versions are here because they are not Perl-compatible; the
11828        studying means the mark is not seen. --/
11829    
11830    /(*MARK:A)(*SKIP:B)(C|X)/KS
11831        C
11832     0: C
11833     1: C
11834    MK: A
11835        D
11836    No match
11837    
11838    /(*:A)A+(*SKIP:A)(B|Z)/KS
11839        AAAC
11840    No match
11841    
11842    /-- --/
11843    
11844    "(?=a*(*ACCEPT)b)c"
11845        c
11846     0: c
11847        c\N
11848     0: c
11849    
11850    /(?1)c(?(DEFINE)((*ACCEPT)b))/
11851        c
11852     0: c
11853        c\N
11854     0: c
11855    
11856    /(?>(*ACCEPT)b)c/
11857        c
11858     0:
11859        c\N
11860    No match
11861    
11862    /(?:(?>(a)))+a%/++
11863        %aa%
11864     0: aa%
11865     0+
11866     1: a
11867     1+ a%
11868    
11869    /(a)b|ac/++
11870        ac\O3
11871    Matched, but too many substrings
11872     0: ac
11873     0+
11874    
11875    /(?(DEFINE)(a(?2)|b)(b(?1)|a))(?:(?1)|(?2))/SI
11876    Capturing subpattern count = 2
11877    No options
11878    No first char
11879    No need char
11880    Subject length lower bound = 1
11881    No set of starting bytes
11882    
11883    /(a(?2)|b)(b(?1)|a)(?:(?1)|(?2))/SI
11884    Capturing subpattern count = 2
11885    No options
11886    No first char
11887    No need char
11888    Subject length lower bound = 3
11889    Starting byte set: a b
11890    
11891    /(a(?2)|b)(b(?1)|a)(?1)(?2)/SI
11892    Capturing subpattern count = 2
11893    No options
11894    No first char
11895    No need char
11896    Subject length lower bound = 4
11897    Starting byte set: a b
11898    
11899    /(abc)(?1)/SI
11900    Capturing subpattern count = 1
11901    No options
11902    First char = 'a'
11903    Need char = 'c'
11904    Subject length lower bound = 6
11905    No set of starting bytes
11906    
11907    /^(?>a)++/
11908        aa\M
11909    Minimum match() limit = 5
11910    Minimum match() recursion limit = 3
11911     0: aa
11912        aaaaaaaaa\M
11913    Minimum match() limit = 12
11914    Minimum match() recursion limit = 3
11915     0: aaaaaaaaa
11916    
11917    /(a)(?1)++/
11918        aa\M
11919    Minimum match() limit = 7
11920    Minimum match() recursion limit = 5
11921     0: aa
11922     1: a
11923        aaaaaaaaa\M
11924    Minimum match() limit = 21
11925    Minimum match() recursion limit = 5
11926     0: aaaaaaaaa
11927     1: a
11928    
11929  /-- End of testinput2 --/  /-- End of testinput2 --/

Legend:
Removed from v.455  
changed lines
  Added in v.621

  ViewVC Help
Powered by ViewVC 1.1.5