/[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 461 by ph10, Mon Oct 5 10:59:35 2009 UTC revision 637 by ph10, Sun Jul 24 17:44:12 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 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 7652  Options: extended Line 7944  Options: extended
7944  First char = 'x'  First char = 'x'
7945  Need char = 'z'  Need char = 'z'
7946    
 /(?(DEFINE) abc){3} xyz/x  
 Failed: repeating a DEFINE group is not allowed at offset 17  
   
7947  /(a|)*\d/  /(a|)*\d/
7948    \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa    \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
7949  No match  No match
# Line 7972  No match Line 8261  No match
8261          Alt          Alt
8262          c          c
8263          Ket          Ket
         Once  
8264          Recurse          Recurse
8265          Ket          Ket
         Ket  
8266          End          End
8267  ------------------------------------------------------------------  ------------------------------------------------------------------
8268      abc      abc
# Line 7986  No match Line 8273  No match
8273  ------------------------------------------------------------------  ------------------------------------------------------------------
8274          Bra          Bra
8275          xy          xy
         Once  
8276          Recurse          Recurse
         Ket  
8277          CBra 1          CBra 1
8278          abc          abc
8279          Ket          Ket
# Line 8642  No match Line 8927  No match
8927  +13   ^  ^      (*FAIL)  +13   ^  ^      (*FAIL)
8928  No match  No match
8929    
 /a(*PRUNE:XXX)b/  
 Failed: (*VERB) with an argument is not supported at offset 8  
   
8930  /a(*MARK)b/  /a(*MARK)b/
8931  Failed: (*VERB) not recognized at offset 7  Failed: (*MARK) must have an argument at offset 7
8932    
8933  /(?i:A{1,}\6666666666)/  /(?i:A{1,}\6666666666)/
8934  Failed: number is too big at offset 19  Failed: number is too big at offset 19
# Line 8735  No match Line 9017  No match
9017  No match  No match
9018      a\x85b      a\x85b
9019  No match  No match
9020    
9021    /(*ANY).*/g
9022        abc\r\ndef
9023     0: abc
9024     0:
9025     0: def
9026     0:
9027    
9028    /(*ANYCRLF).*/g
9029        abc\r\ndef
9030     0: abc
9031     0:
9032     0: def
9033     0:
9034    
9035    /(*CRLF).*/g
9036        abc\r\ndef
9037     0: abc
9038     0:
9039     0: def
9040     0:
9041    
9042  /a\Rb/I<bsr_anycrlf>  /a\Rb/I<bsr_anycrlf>
9043  Capturing subpattern count = 0  Capturing subpattern count = 0
# Line 8940  Failed: subpattern name expected at offs Line 9243  Failed: subpattern name expected at offs
9243  /\k{}/  /\k{}/
9244  Failed: subpattern name expected at offset 3  Failed: subpattern name expected at offset 3
9245    
9246    /\k/
9247    Failed: \k is not followed by a braced, angle-bracketed, or quoted name at offset 2
9248    
9249    /\kabc/
9250    Failed: \k is not followed by a braced, angle-bracketed, or quoted name at offset 5
9251    
9252  /(?P=)/  /(?P=)/
9253  Failed: subpattern name expected at offset 4  Failed: subpattern name expected at offset 4
9254    
# Line 9221  No match Line 9530  No match
9530   +0        ^     x   +0        ^     x
9531   +0         ^    x   +0         ^    x
9532  No match  No match
9533    
9534    /(*NO_START_OPT)xyz/C
9535      abcxyz
9536    --->abcxyz
9537    +15 ^          x
9538    +15  ^         x
9539    +15   ^        x
9540    +15    ^       x
9541    +16    ^^      y
9542    +17    ^ ^     z
9543    +18    ^  ^
9544     0: xyz
9545    
9546    /xyz/CY
9547      abcxyz
9548    --->abcxyz
9549     +0 ^          x
9550     +0  ^         x
9551     +0   ^        x
9552     +0    ^       x
9553     +1    ^^      y
9554     +2    ^ ^     z
9555     +3    ^  ^
9556     0: xyz
9557    
9558  /^"((?(?=[a])[^"])|b)*"$/C  /^"((?(?=[a])[^"])|b)*"$/C
9559      "ab"      "ab"
# Line 9574  Partial match: +ab Line 9907  Partial match: +ab
9907  /(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/BZ  /(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/BZ
9908  ------------------------------------------------------------------  ------------------------------------------------------------------
9909          Bra          Bra
         Once  
9910          Recurse          Recurse
         Ket  
         Once  
9911          Recurse          Recurse
         Ket  
9912          Cond          Cond
9913          Cond def          Cond def
9914          CBra 1          CBra 1
# Line 9600  Partial match: +ab Line 9929  Partial match: +ab
9929  /(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/BZ  /(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/BZ
9930  ------------------------------------------------------------------  ------------------------------------------------------------------
9931          Bra          Bra
         Once  
9932          Recurse          Recurse
         Ket  
         Once  
9933          Recurse          Recurse
         Ket  
9934          Cond          Cond
9935          Cond def          Cond def
9936          CBra 1          CBra 1
# Line 10346  No match Line 10671  No match
10671          Cond nrecurse 1          Cond nrecurse 1
10672          $          $
10673          Alt          Alt
         Once  
10674          Recurse          Recurse
10675          Ket          Ket
10676          Ket          Ket
10677          Ket          Ket
         Ket  
10678          End          End
10679  ------------------------------------------------------------------  ------------------------------------------------------------------
10680  Capturing subpattern count = 4  Capturing subpattern count = 4
# Line 10372  No match Line 10695  No match
10695      abcdde      abcdde
10696  No match  No match
10697    
10698    /abcd*/
10699        xxxxabcd\P
10700     0: abcd
10701        xxxxabcd\P\P
10702    Partial match: abcd
10703    
10704    /abcd*/i
10705        xxxxabcd\P
10706     0: abcd
10707        xxxxabcd\P\P
10708    Partial match: abcd
10709        XXXXABCD\P
10710     0: ABCD
10711        XXXXABCD\P\P
10712    Partial match: ABCD
10713    
10714    /abc\d*/
10715        xxxxabc1\P
10716     0: abc1
10717        xxxxabc1\P\P
10718    Partial match: abc1
10719    
10720    /(a)bc\1*/
10721        xxxxabca\P
10722     0: abca
10723     1: a
10724        xxxxabca\P\P
10725    Partial match: abca
10726    
10727    /abc[de]*/
10728        xxxxabcde\P
10729     0: abcde
10730        xxxxabcde\P\P
10731    Partial match: abcde
10732    
10733    /-- This is not in the Perl >= 5.10 test because Perl seems currently to be
10734        broken and not behaving as specified in that it *does* bumpalong after
10735        hitting (*COMMIT). --/
10736    
10737    /(?1)(A(*COMMIT)|B)D/
10738        ABD
10739     0: ABD
10740     1: B
10741        XABD
10742     0: ABD
10743     1: B
10744        BAD
10745     0: BAD
10746     1: A
10747        ABXABD
10748     0: ABD
10749     1: B
10750        ** Failers
10751    No match
10752        ABX
10753    No match
10754        BAXBAD
10755    No match
10756    
10757    /(\3)(\1)(a)/<JS>
10758        cat
10759     0: a
10760     1:
10761     2:
10762     3: a
10763    
10764    /(\3)(\1)(a)/SI<JS>
10765    Capturing subpattern count = 3
10766    Max back reference = 3
10767    Options:
10768    No first char
10769    Need char = 'a'
10770    Subject length lower bound = 1
10771    No set of starting bytes
10772        cat
10773     0: a
10774     1:
10775     2:
10776     3: a
10777    
10778    /(\3)(\1)(a)/SI
10779    Capturing subpattern count = 3
10780    Max back reference = 3
10781    No options
10782    No first char
10783    Need char = 'a'
10784    Subject length lower bound = 3
10785    No set of starting bytes
10786        cat
10787    No match
10788    
10789    /i(?(DEFINE)(?<s>a))/SI
10790    Capturing subpattern count = 1
10791    Named capturing subpatterns:
10792      s   1
10793    No options
10794    First char = 'i'
10795    No need char
10796    Subject length lower bound = 1
10797    No set of starting bytes
10798        i
10799     0: i
10800    
10801    /()i(?(1)a)/SI
10802    Capturing subpattern count = 1
10803    No options
10804    No first char
10805    Need char = 'i'
10806    Subject length lower bound = 1
10807    Starting byte set: i
10808        ia
10809     0: ia
10810     1:
10811    
10812    /(?i)a(?-i)b|c/BZ
10813    ------------------------------------------------------------------
10814            Bra
10815         /i a
10816            b
10817            Alt
10818            c
10819            Ket
10820            End
10821    ------------------------------------------------------------------
10822        XabX
10823     0: ab
10824        XAbX
10825     0: Ab
10826        CcC
10827     0: c
10828        ** Failers
10829    No match
10830        XABX
10831    No match
10832    
10833    /(?i)a(?s)b|c/BZ
10834    ------------------------------------------------------------------
10835            Bra
10836         /i ab
10837            Alt
10838         /i c
10839            Ket
10840            End
10841    ------------------------------------------------------------------
10842    
10843    /(?i)a(?s-i)b|c/BZ
10844    ------------------------------------------------------------------
10845            Bra
10846         /i a
10847            b
10848            Alt
10849            c
10850            Ket
10851            End
10852    ------------------------------------------------------------------
10853    
10854    /^(ab(c\1)d|x){2}$/BZ
10855    ------------------------------------------------------------------
10856            Bra
10857            ^
10858            Once
10859            CBra 1
10860            ab
10861            CBra 2
10862            c
10863            \1
10864            Ket
10865            d
10866            Alt
10867            x
10868            Ket
10869            Ket
10870            Once
10871            CBra 1
10872            ab
10873            CBra 2
10874            c
10875            \1
10876            Ket
10877            d
10878            Alt
10879            x
10880            Ket
10881            Ket
10882            $
10883            Ket
10884            End
10885    ------------------------------------------------------------------
10886        xabcxd
10887     0: xabcxd
10888     1: abcxd
10889     2: cx
10890    
10891    /^(?&t)*+(?(DEFINE)(?<t>.))$/BZ
10892    ------------------------------------------------------------------
10893            Bra
10894            ^
10895            Braposzero
10896            SBraPos
10897            Recurse
10898            KetRpos
10899            Cond
10900            Cond def
10901            CBra 1
10902            Any
10903            Ket
10904            Ket
10905            $
10906            Ket
10907            End
10908    ------------------------------------------------------------------
10909    
10910    /^(?&t)*(?(DEFINE)(?<t>.))$/BZ
10911    ------------------------------------------------------------------
10912            Bra
10913            ^
10914            Brazero
10915            Once
10916            Recurse
10917            KetRmax
10918            Cond
10919            Cond def
10920            CBra 1
10921            Any
10922            Ket
10923            Ket
10924            $
10925            Ket
10926            End
10927    ------------------------------------------------------------------
10928    
10929    / -- The first four of these are not in the Perl >= 5.10 test because Perl
10930         documents that the use of \K in assertions is "not well defined". The
10931         last is here because Perl gives the match as "b" rather than "ab". I
10932         believe this to be a Perl bug. --/
10933    
10934    /(?=a\Kb)ab/
10935        ab
10936     0: b
10937    
10938    /(?!a\Kb)ac/
10939        ac
10940     0: ac
10941    
10942    /^abc(?<=b\Kc)d/
10943        abcd
10944     0: cd
10945    
10946    /^abc(?<!b\Kq)d/
10947        abcd
10948     0: abcd
10949    
10950    /(?>a\Kb)z|(ab)/
10951        ab
10952     0: ab
10953     1: ab
10954    
10955    /----------------------/
10956    
10957    /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
10958    Failed: recursive call could loop indefinitely at offset 31
10959    
10960    /abc(*MARK:)pqr/
10961    Failed: (*MARK) must have an argument at offset 10
10962    
10963    /abc(*:)pqr/
10964    Failed: (*MARK) must have an argument at offset 6
10965    
10966    /abc(*FAIL:123)xyz/
10967    Failed: an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT) at offset 13
10968    
10969    /--- This should, and does, fail. In Perl, it does not, which I think is a
10970         bug because replacing the B in the pattern by (B|D) does make it fail. ---/
10971    
10972    /A(*COMMIT)B/+K
10973        ACABX
10974    No match
10975    
10976    /--- These should be different, but in Perl 5.11 are not, which I think
10977         is a bug in Perl. ---/
10978    
10979    /A(*THEN)B|A(*THEN)C/K
10980        AC
10981     0: AC
10982    
10983    /A(*PRUNE)B|A(*PRUNE)C/K
10984        AC
10985    No match
10986    
10987    /--- A whole lot of tests of verbs with arguments are here rather than in test
10988         11 because Perl doesn't seem to follow its specification entirely
10989         correctly. ---/
10990    
10991    /--- Perl 5.11 sets $REGERROR on the AC failure case here; PCRE does not. It is
10992         not clear how Perl defines "involved in the failure of the match". ---/
10993    
10994    /^(A(*THEN:A)B|C(*THEN:B)D)/K
10995        AB
10996     0: AB
10997     1: AB
10998        CD
10999     0: CD
11000     1: CD
11001        ** Failers
11002    No match
11003        AC
11004    No match
11005        CB
11006    No match, mark = B
11007    
11008    /--- Check the use of names for success and failure. PCRE doesn't show these
11009    names for success, though Perl does, contrary to its spec. ---/
11010    
11011    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
11012        AB
11013     0: AB
11014     1: AB
11015        CD
11016     0: CD
11017     1: CD
11018        ** Failers
11019    No match
11020        AC
11021    No match, mark = A
11022        CB
11023    No match, mark = B
11024    
11025    /--- An empty name does not pass back an empty string. It is the same as if no
11026    name were given. ---/
11027    
11028    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/K
11029        AB
11030     0: AB
11031     1: AB
11032        CD
11033     0: CD
11034     1: CD
11035    
11036    /--- PRUNE goes to next bumpalong; COMMIT does not. ---/
11037    
11038    /A(*PRUNE:A)B/K
11039        ACAB
11040     0: AB
11041    
11042    /(*MARK:A)(*PRUNE:B)(C|X)/KS
11043        C
11044     0: C
11045     1: C
11046    MK: A
11047        D
11048    No match
11049    
11050    /(*MARK:A)(*PRUNE:B)(C|X)/KSS
11051        C
11052     0: C
11053     1: C
11054    MK: A
11055        D
11056    No match, mark = B
11057    
11058    /(*MARK:A)(*THEN:B)(C|X)/KS
11059        C
11060     0: C
11061     1: C
11062    MK: A
11063        D
11064    No match
11065    
11066    /(*MARK:A)(*THEN:B)(C|X)/KSS
11067        C
11068     0: C
11069     1: C
11070    MK: A
11071        D
11072    No match, mark = B
11073    
11074    /--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/
11075    
11076    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK
11077        AAAC
11078    No match
11079    
11080    /--- Same --/
11081    
11082    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK
11083        AAAC
11084    No match
11085    
11086    /--- This should fail; the SKIP advances by one, but when we get to AC, the
11087         PRUNE kills it. ---/
11088    
11089    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
11090        AAAC
11091    No match
11092    
11093    /A(*:A)A+(*SKIP)(B|Z) | AC/xK
11094        AAAC
11095    No match
11096    
11097    /--- This should fail, as a null name is the same as no name ---/
11098    
11099    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK
11100        AAAC
11101    No match
11102    
11103    /--- This fails in PCRE, and I think that is in accordance with Perl's
11104         documentation, though in Perl it succeeds. ---/
11105    
11106    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK
11107        AAAC
11108    No match
11109    
11110    /--- Mark names can be duplicated ---/
11111    
11112    /A(*:A)B|X(*:A)Y/K
11113        AABC
11114     0: AB
11115    MK: A
11116        XXYZ
11117     0: XY
11118    MK: A
11119    
11120    /^A(*:A)B|^X(*:A)Y/K
11121        ** Failers
11122    No match
11123        XAQQ
11124    No match, mark = A
11125    
11126    /--- A check on what happens after hitting a mark and them bumping along to
11127    something that does not even start. Perl reports tags after the failures here,
11128    though it does not when the individual letters are made into something
11129    more complicated. ---/
11130    
11131    /A(*:A)B|XX(*:B)Y/K
11132        AABC
11133     0: AB
11134    MK: A
11135        XXYZ
11136     0: XXY
11137    MK: B
11138        ** Failers
11139    No match
11140        XAQQ
11141    No match
11142        XAQQXZZ
11143    No match
11144        AXQQQ
11145    No match
11146        AXXQQQ
11147    No match
11148    
11149    /--- COMMIT at the start of a pattern should be the same as an anchor. Perl
11150    optimizations defeat this. So does the PCRE optimization unless we disable it
11151    with \Y. ---/
11152    
11153    /(*COMMIT)ABC/
11154        ABCDEFG
11155     0: ABC
11156        ** Failers
11157    No match
11158        DEFGABC\Y
11159    No match
11160    
11161    /--- Repeat some tests with added studying. ---/
11162    
11163    /A(*COMMIT)B/+KS
11164        ACABX
11165    No match
11166    
11167    /A(*THEN)B|A(*THEN)C/KS
11168        AC
11169     0: AC
11170    
11171    /A(*PRUNE)B|A(*PRUNE)C/KS
11172        AC
11173    No match
11174    
11175    /^(A(*THEN:A)B|C(*THEN:B)D)/KS
11176        AB
11177     0: AB
11178     1: AB
11179        CD
11180     0: CD
11181     1: CD
11182        ** Failers
11183    No match
11184        AC
11185    No match
11186        CB
11187    No match, mark = B
11188    
11189    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/KS
11190        AB
11191     0: AB
11192     1: AB
11193        CD
11194     0: CD
11195     1: CD
11196        ** Failers
11197    No match
11198        AC
11199    No match, mark = A
11200        CB
11201    No match, mark = B
11202    
11203    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/KS
11204        AB
11205     0: AB
11206     1: AB
11207        CD
11208     0: CD
11209     1: CD
11210    
11211    /A(*PRUNE:A)B/KS
11212        ACAB
11213     0: AB
11214    
11215    /(*MARK:A)(*PRUNE:B)(C|X)/KS
11216        C
11217     0: C
11218     1: C
11219    MK: A
11220        D
11221    No match
11222    
11223    /(*MARK:A)(*THEN:B)(C|X)/KS
11224        C
11225     0: C
11226     1: C
11227    MK: A
11228        D
11229    No match
11230    
11231    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xKS
11232        AAAC
11233    No match
11234    
11235    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xKS
11236        AAAC
11237    No match
11238    
11239    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xKS
11240        AAAC
11241    No match
11242    
11243    /A(*:A)A+(*SKIP)(B|Z) | AC/xKS
11244        AAAC
11245    No match
11246    
11247    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xKS
11248        AAAC
11249    No match
11250    
11251    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xKS
11252        AAAC
11253    No match
11254    
11255    /A(*:A)B|XX(*:B)Y/KS
11256        AABC
11257     0: AB
11258    MK: A
11259        XXYZ
11260     0: XXY
11261    MK: B
11262        ** Failers
11263    No match
11264        XAQQ
11265    No match
11266        XAQQXZZ
11267    No match
11268        AXQQQ
11269    No match
11270        AXXQQQ
11271    No match
11272    
11273    /(*COMMIT)ABC/
11274        ABCDEFG
11275     0: ABC
11276        ** Failers
11277    No match
11278        DEFGABC\Y
11279    No match
11280    
11281    /^(ab (c+(*THEN)cd) | xyz)/x
11282        abcccd
11283    No match
11284    
11285    /^(ab (c+(*PRUNE)cd) | xyz)/x
11286        abcccd
11287    No match
11288    
11289    /^(ab (c+(*FAIL)cd) | xyz)/x
11290        abcccd
11291    No match
11292    
11293    /--- Perl 5.11 gets some of these wrong ---/
11294    
11295    /(?>.(*ACCEPT))*?5/
11296        abcde
11297     0: a
11298    
11299    /(.(*ACCEPT))*?5/
11300        abcde
11301     0: a
11302     1: a
11303    
11304    /(.(*ACCEPT))5/
11305        abcde
11306     0: a
11307     1: a
11308    
11309    /(.(*ACCEPT))*5/
11310        abcde
11311     0: a
11312     1: a
11313    
11314    /A\NB./BZ
11315    ------------------------------------------------------------------
11316            Bra
11317            A
11318            Any
11319            B
11320            Any
11321            Ket
11322            End
11323    ------------------------------------------------------------------
11324        ACBD
11325     0: ACBD
11326        *** Failers
11327    No match
11328        A\nB
11329    No match
11330        ACB\n
11331    No match
11332    
11333    /A\NB./sBZ
11334    ------------------------------------------------------------------
11335            Bra
11336            A
11337            Any
11338            B
11339            AllAny
11340            Ket
11341            End
11342    ------------------------------------------------------------------
11343        ACBD
11344     0: ACBD
11345        ACB\n
11346     0: ACB\x0a
11347        *** Failers
11348    No match
11349        A\nB
11350    No match
11351    
11352    /A\NB/<crlf>
11353        A\nB
11354     0: A\x0aB
11355        A\rB
11356     0: A\x0dB
11357        ** Failers
11358    No match
11359        A\r\nB
11360    No match
11361    
11362    /\R+b/BZ
11363    ------------------------------------------------------------------
11364            Bra
11365            \R++
11366            b
11367            Ket
11368            End
11369    ------------------------------------------------------------------
11370    
11371    /\R+\n/BZ
11372    ------------------------------------------------------------------
11373            Bra
11374            \R+
11375            \x0a
11376            Ket
11377            End
11378    ------------------------------------------------------------------
11379    
11380    /\R+\d/BZ
11381    ------------------------------------------------------------------
11382            Bra
11383            \R++
11384            \d
11385            Ket
11386            End
11387    ------------------------------------------------------------------
11388    
11389    /\d*\R/BZ
11390    ------------------------------------------------------------------
11391            Bra
11392            \d*+
11393            \R
11394            Ket
11395            End
11396    ------------------------------------------------------------------
11397    
11398    /\s*\R/BZ
11399    ------------------------------------------------------------------
11400            Bra
11401            \s*+
11402            \R
11403            Ket
11404            End
11405    ------------------------------------------------------------------
11406    
11407    /-- Perl treats this one differently, not failing the second string. I believe
11408        that is a bug in Perl. --/
11409    
11410    /^((abc|abcx)(*THEN)y|abcd)/
11411        abcd
11412     0: abcd
11413     1: abcd
11414        *** Failers
11415    No match
11416        abcxy
11417    No match
11418    
11419    /(?<=abc)def/
11420        abc\P\P
11421    Partial match: abc
11422    
11423    /abc$/
11424        abc
11425     0: abc
11426        abc\P
11427     0: abc
11428        abc\P\P
11429    Partial match: abc
11430    
11431    /abc$/m
11432        abc
11433     0: abc
11434        abc\n
11435     0: abc
11436        abc\P\P
11437    Partial match: abc
11438        abc\n\P\P
11439     0: abc
11440        abc\P
11441     0: abc
11442        abc\n\P
11443     0: abc
11444    
11445    /abc\z/
11446        abc
11447     0: abc
11448        abc\P
11449     0: abc
11450        abc\P\P
11451    Partial match: abc
11452    
11453    /abc\Z/
11454        abc
11455     0: abc
11456        abc\P
11457     0: abc
11458        abc\P\P
11459    Partial match: abc
11460    
11461    /abc\b/
11462        abc
11463     0: abc
11464        abc\P
11465     0: abc
11466        abc\P\P
11467    Partial match: abc
11468    
11469    /abc\B/
11470        abc
11471    No match
11472        abc\P
11473    Partial match: abc
11474        abc\P\P
11475    Partial match: abc
11476    
11477    /.+/
11478        abc\>0
11479     0: abc
11480        abc\>1
11481     0: bc
11482        abc\>2
11483     0: c
11484        abc\>3
11485    No match
11486        abc\>4
11487    Error -24 (bad offset value)
11488        abc\>-4
11489    Error -24 (bad offset value)
11490    
11491    /^\cģ/
11492    Failed: \c must be followed by an ASCII character at offset 3
11493    
11494    /(?P<abn>(?P=abn)xxx)/BZ
11495    ------------------------------------------------------------------
11496            Bra
11497            Once
11498            CBra 1
11499            \1
11500            xxx
11501            Ket
11502            Ket
11503            Ket
11504            End
11505    ------------------------------------------------------------------
11506    
11507    /(a\1z)/BZ
11508    ------------------------------------------------------------------
11509            Bra
11510            Once
11511            CBra 1
11512            a
11513            \1
11514            z
11515            Ket
11516            Ket
11517            Ket
11518            End
11519    ------------------------------------------------------------------
11520    
11521    /(?P<abn>(?P=abn)(?<badstufxxx)/BZ
11522    Failed: syntax error in subpattern name (missing terminator) at offset 29
11523    
11524    /(?P<abn>(?P=axn)xxx)/BZ
11525    Failed: reference to non-existent subpattern at offset 15
11526    
11527    /(?P<abn>(?P=axn)xxx)(?<axn>yy)/BZ
11528    ------------------------------------------------------------------
11529            Bra
11530            CBra 1
11531            \2
11532            xxx
11533            Ket
11534            CBra 2
11535            yy
11536            Ket
11537            Ket
11538            End
11539    ------------------------------------------------------------------
11540    
11541    /-- These tests are here because Perl gets the first one wrong. --/
11542    
11543    /(\R*)(.)/s
11544        \r\n
11545     0: \x0d
11546     1:
11547     2: \x0d
11548        \r\r\n\n\r
11549     0: \x0d\x0d\x0a\x0a\x0d
11550     1: \x0d\x0d\x0a\x0a
11551     2: \x0d
11552        \r\r\n\n\r\n
11553     0: \x0d\x0d\x0a\x0a\x0d
11554     1: \x0d\x0d\x0a\x0a
11555     2: \x0d
11556    
11557    /(\R)*(.)/s
11558        \r\n
11559     0: \x0d
11560     1: <unset>
11561     2: \x0d
11562        \r\r\n\n\r
11563     0: \x0d\x0d\x0a\x0a\x0d
11564     1: \x0a
11565     2: \x0d
11566        \r\r\n\n\r\n
11567     0: \x0d\x0d\x0a\x0a\x0d
11568     1: \x0a
11569     2: \x0d
11570    
11571    /((?>\r\n|\n|\x0b|\f|\r|\x85)*)(.)/s
11572        \r\n
11573     0: \x0d
11574     1:
11575     2: \x0d
11576        \r\r\n\n\r
11577     0: \x0d\x0d\x0a\x0a\x0d
11578     1: \x0d\x0d\x0a\x0a
11579     2: \x0d
11580        \r\r\n\n\r\n
11581     0: \x0d\x0d\x0a\x0a\x0d
11582     1: \x0d\x0d\x0a\x0a
11583     2: \x0d
11584    
11585    /-- --/
11586    
11587    /^abc$/BZ
11588    ------------------------------------------------------------------
11589            Bra
11590            ^
11591            abc
11592            $
11593            Ket
11594            End
11595    ------------------------------------------------------------------
11596    
11597    /^abc$/BZm
11598    ------------------------------------------------------------------
11599            Bra
11600         /m ^
11601            abc
11602         /m $
11603            Ket
11604            End
11605    ------------------------------------------------------------------
11606    
11607    /^(a)*+(\w)/S
11608        aaaaX
11609     0: aaaaX
11610     1: a
11611     2: X
11612        ** Failers
11613    No match
11614        aaaa
11615    No match
11616    
11617    /^(?:a)*+(\w)/S
11618        aaaaX
11619     0: aaaaX
11620     1: X
11621        ** Failers
11622    No match
11623        aaaa
11624    No match
11625    
11626    /(a)++1234/SDZ
11627    ------------------------------------------------------------------
11628            Bra
11629            CBraPos 1
11630            a
11631            KetRpos
11632            1234
11633            Ket
11634            End
11635    ------------------------------------------------------------------
11636    Capturing subpattern count = 1
11637    No options
11638    First char = 'a'
11639    Need char = '4'
11640    Subject length lower bound = 5
11641    No set of starting bytes
11642    
11643    /([abc])++1234/SI
11644    Capturing subpattern count = 1
11645    No options
11646    No first char
11647    Need char = '4'
11648    Subject length lower bound = 5
11649    Starting byte set: a b c
11650    
11651    /(?<=(abc)+)X/
11652    Failed: lookbehind assertion is not fixed length at offset 10
11653    
11654    /(^ab)/I
11655    Capturing subpattern count = 1
11656    Options: anchored
11657    No first char
11658    No need char
11659    
11660    /(^ab)++/I
11661    Capturing subpattern count = 1
11662    Options: anchored
11663    No first char
11664    No need char
11665    
11666    /(^ab|^)+/I
11667    Capturing subpattern count = 1
11668    Options: anchored
11669    No first char
11670    No need char
11671    
11672    /(^ab|^)++/I
11673    Capturing subpattern count = 1
11674    Options: anchored
11675    No first char
11676    No need char
11677    
11678    /(?:^ab)/I
11679    Capturing subpattern count = 0
11680    Options: anchored
11681    No first char
11682    No need char
11683    
11684    /(?:^ab)++/I
11685    Capturing subpattern count = 0
11686    Options: anchored
11687    No first char
11688    No need char
11689    
11690    /(?:^ab|^)+/I
11691    Capturing subpattern count = 0
11692    Options: anchored
11693    No first char
11694    No need char
11695    
11696    /(?:^ab|^)++/I
11697    Capturing subpattern count = 0
11698    Options: anchored
11699    No first char
11700    No need char
11701    
11702    /(.*ab)/I
11703    Capturing subpattern count = 1
11704    No options
11705    First char at start or follows newline
11706    Need char = 'b'
11707    
11708    /(.*ab)++/I
11709    Capturing subpattern count = 1
11710    No options
11711    First char at start or follows newline
11712    Need char = 'b'
11713    
11714    /(.*ab|.*)+/I
11715    Capturing subpattern count = 1
11716    No options
11717    First char at start or follows newline
11718    No need char
11719    
11720    /(.*ab|.*)++/I
11721    Capturing subpattern count = 1
11722    No options
11723    First char at start or follows newline
11724    No need char
11725    
11726    /(?:.*ab)/I
11727    Capturing subpattern count = 0
11728    No options
11729    First char at start or follows newline
11730    Need char = 'b'
11731    
11732    /(?:.*ab)++/I
11733    Capturing subpattern count = 0
11734    No options
11735    First char at start or follows newline
11736    Need char = 'b'
11737    
11738    /(?:.*ab|.*)+/I
11739    Capturing subpattern count = 0
11740    No options
11741    First char at start or follows newline
11742    No need char
11743    
11744    /(?:.*ab|.*)++/I
11745    Capturing subpattern count = 0
11746    No options
11747    First char at start or follows newline
11748    No need char
11749    
11750    /(?=a)[bcd]/I
11751    Capturing subpattern count = 0
11752    No options
11753    First char = 'a'
11754    No need char
11755    
11756    /((?=a))[bcd]/I
11757    Capturing subpattern count = 1
11758    No options
11759    First char = 'a'
11760    No need char
11761    
11762    /((?=a))+[bcd]/I
11763    Capturing subpattern count = 1
11764    No options
11765    First char = 'a'
11766    No need char
11767    
11768    /((?=a))++[bcd]/I
11769    Capturing subpattern count = 1
11770    No options
11771    First char = 'a'
11772    No need char
11773    
11774    /(?=a+)[bcd]/iI
11775    Capturing subpattern count = 0
11776    Options: caseless
11777    First char = 'a' (caseless)
11778    No need char
11779    
11780    /(?=a+?)[bcd]/iI
11781    Capturing subpattern count = 0
11782    Options: caseless
11783    First char = 'a' (caseless)
11784    No need char
11785    
11786    /(?=a++)[bcd]/iI
11787    Capturing subpattern count = 0
11788    Options: caseless
11789    First char = 'a' (caseless)
11790    No need char
11791    
11792    /(?=a{3})[bcd]/iI
11793    Capturing subpattern count = 0
11794    Options: caseless
11795    First char = 'a' (caseless)
11796    Need char = 'a' (caseless)
11797    
11798    /(abc)\1+/S
11799    
11800    /-- Perl doesn't get these right IMO (the 3rd is PCRE-specific) --/
11801    
11802    /(?1)(?:(b(*ACCEPT))){0}/
11803        b
11804     0: b
11805    
11806    /(?1)(?:(b(*ACCEPT))){0}c/
11807        bc
11808     0: bc
11809        ** Failers
11810    No match
11811        b
11812    No match
11813    
11814    /(?1)(?:((*ACCEPT))){0}c/
11815        c
11816     0: c
11817        c\N
11818     0: c
11819    
11820    /^.*?(?(?=a)a|b(*THEN)c)/
11821        ba
11822     0: ba
11823    
11824    /^.*?(?(?=a)a|bc)/
11825        ba
11826     0: ba
11827    
11828    /-- --/
11829    
11830    /-- These studied versions are here because they are not Perl-compatible; the
11831        studying means the mark is not seen. --/
11832    
11833    /(*MARK:A)(*SKIP:B)(C|X)/KS
11834        C
11835     0: C
11836     1: C
11837    MK: A
11838        D
11839    No match
11840    
11841    /(*:A)A+(*SKIP:A)(B|Z)/KS
11842        AAAC
11843    No match
11844    
11845    /-- --/
11846    
11847    "(?=a*(*ACCEPT)b)c"
11848        c
11849     0: c
11850        c\N
11851     0: c
11852    
11853    /(?1)c(?(DEFINE)((*ACCEPT)b))/
11854        c
11855     0: c
11856        c\N
11857     0: c
11858    
11859    /(?>(*ACCEPT)b)c/
11860        c
11861     0:
11862        c\N
11863    No match
11864    
11865    /(?:(?>(a)))+a%/++
11866        %aa%
11867     0: aa%
11868     0+
11869     1: a
11870     1+ a%
11871    
11872    /(a)b|ac/++
11873        ac\O3
11874    Matched, but too many substrings
11875     0: ac
11876     0+
11877    
11878    /(?(DEFINE)(a(?2)|b)(b(?1)|a))(?:(?1)|(?2))/SI
11879    Capturing subpattern count = 2
11880    No options
11881    No first char
11882    No need char
11883    Subject length lower bound = 1
11884    No set of starting bytes
11885    
11886    /(a(?2)|b)(b(?1)|a)(?:(?1)|(?2))/SI
11887    Capturing subpattern count = 2
11888    No options
11889    No first char
11890    No need char
11891    Subject length lower bound = 3
11892    Starting byte set: a b
11893    
11894    /(a(?2)|b)(b(?1)|a)(?1)(?2)/SI
11895    Capturing subpattern count = 2
11896    No options
11897    No first char
11898    No need char
11899    Subject length lower bound = 4
11900    Starting byte set: a b
11901    
11902    /(abc)(?1)/SI
11903    Capturing subpattern count = 1
11904    No options
11905    First char = 'a'
11906    Need char = 'c'
11907    Subject length lower bound = 6
11908    No set of starting bytes
11909    
11910    /^(?>a)++/
11911        aa\M
11912    Minimum match() limit = 5
11913    Minimum match() recursion limit = 3
11914     0: aa
11915        aaaaaaaaa\M
11916    Minimum match() limit = 12
11917    Minimum match() recursion limit = 3
11918     0: aaaaaaaaa
11919    
11920    /(a)(?1)++/
11921        aa\M
11922    Minimum match() limit = 7
11923    Minimum match() recursion limit = 5
11924     0: aa
11925     1: a
11926        aaaaaaaaa\M
11927    Minimum match() limit = 21
11928    Minimum match() recursion limit = 5
11929     0: aaaaaaaaa
11930     1: a
11931    
11932    /(?:(foo)|(bar)|(baz))X/=
11933        bazfooX
11934     0: fooX
11935     1: foo
11936     2: <unset>
11937     3: <unset>
11938        foobazbarX
11939     0: barX
11940     1: <unset>
11941     2: bar
11942     3: <unset>
11943        barfooX
11944     0: fooX
11945     1: foo
11946     2: <unset>
11947     3: <unset>
11948        bazX
11949     0: bazX
11950     1: <unset>
11951     2: <unset>
11952     3: baz
11953        foobarbazX
11954     0: bazX
11955     1: <unset>
11956     2: <unset>
11957     3: baz
11958        bazfooX\O0
11959    Matched, but too many substrings
11960        bazfooX\O2
11961    Matched, but too many substrings
11962     0: fooX
11963        bazfooX\O4
11964    Matched, but too many substrings
11965     0: fooX
11966     1: <unset>
11967        bazfooX\O6
11968    Matched, but too many substrings
11969     0: fooX
11970     1: foo
11971     2: <unset>
11972        bazfooX\O8
11973    Matched, but too many substrings
11974     0: fooX
11975     1: foo
11976     2: <unset>
11977     3: <unset>
11978        bazfooX\O10
11979    Matched, but too many substrings
11980     0: fooX
11981     1: foo
11982     2: <unset>
11983     3: <unset>
11984    
11985    /(?=abc){3}abc/BZ
11986    ------------------------------------------------------------------
11987            Bra
11988            Assert
11989            abc
11990            Ket
11991            abc
11992            Ket
11993            End
11994    ------------------------------------------------------------------
11995    
11996    /(?=abc)+abc/BZ
11997    ------------------------------------------------------------------
11998            Bra
11999            Assert
12000            abc
12001            Ket
12002            abc
12003            Ket
12004            End
12005    ------------------------------------------------------------------
12006    
12007    /(?=abc)++abc/BZ
12008    ------------------------------------------------------------------
12009            Bra
12010            Assert
12011            abc
12012            Ket
12013            abc
12014            Ket
12015            End
12016    ------------------------------------------------------------------
12017    
12018    /(?=abc){0}xyz/BZ
12019    ------------------------------------------------------------------
12020            Bra
12021            Skip zero
12022            Assert
12023            abc
12024            Ket
12025            xyz
12026            Ket
12027            End
12028    ------------------------------------------------------------------
12029    
12030    /(?=(a))?./BZ
12031    ------------------------------------------------------------------
12032            Bra
12033            Brazero
12034            Assert
12035            CBra 1
12036            a
12037            Ket
12038            Ket
12039            Any
12040            Ket
12041            End
12042    ------------------------------------------------------------------
12043    
12044    /(?=(a))??./BZ
12045    ------------------------------------------------------------------
12046            Bra
12047            Braminzero
12048            Assert
12049            CBra 1
12050            a
12051            Ket
12052            Ket
12053            Any
12054            Ket
12055            End
12056    ------------------------------------------------------------------
12057    
12058    /^(?=(a)){0}b(?1)/BZ
12059    ------------------------------------------------------------------
12060            Bra
12061            ^
12062            Skip zero
12063            Assert
12064            CBra 1
12065            a
12066            Ket
12067            Ket
12068            b
12069            Recurse
12070            Ket
12071            End
12072    ------------------------------------------------------------------
12073    
12074    /(?(DEFINE)(a))?b(?1)/BZ
12075    ------------------------------------------------------------------
12076            Bra
12077            Cond
12078            Cond def
12079            CBra 1
12080            a
12081            Ket
12082            Ket
12083            b
12084            Recurse
12085            Ket
12086            End
12087    ------------------------------------------------------------------
12088    
12089    /^(?=(?1))?[az]([abc])d/BZ
12090    ------------------------------------------------------------------
12091            Bra
12092            ^
12093            Brazero
12094            Assert
12095            Recurse
12096            Ket
12097            [az]
12098            CBra 1
12099            [a-c]
12100            Ket
12101            d
12102            Ket
12103            End
12104    ------------------------------------------------------------------
12105    
12106    /^(?!a){0}\w+/BZ
12107    ------------------------------------------------------------------
12108            Bra
12109            ^
12110            Skip zero
12111            Assert not
12112            a
12113            Ket
12114            \w+
12115            Ket
12116            End
12117    ------------------------------------------------------------------
12118    
12119    /(?<=(abc))?xyz/BZ
12120    ------------------------------------------------------------------
12121            Bra
12122            Brazero
12123            AssertB
12124            Reverse
12125            CBra 1
12126            abc
12127            Ket
12128            Ket
12129            xyz
12130            Ket
12131            End
12132    ------------------------------------------------------------------
12133    
12134  /-- End of testinput2 --/  /-- End of testinput2 --/

Legend:
Removed from v.461  
changed lines
  Added in v.637

  ViewVC Help
Powered by ViewVC 1.1.5