/[pcre]/code/trunk/testdata/testoutput2
ViewVC logotype

Diff of /code/trunk/testdata/testoutput2

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

<
revision 426 by ph10, Wed Aug 26 15:38:32 2009 UTC revision 629 by ph10, Fri Jul 22 09:18:11 2011 UTC
# Line 1  Line 1 
1    /-- This set of tests is not Perl-compatible. It checks on special features
2        of PCRE's API, error diagnostics, and the compiled code of some patterns.
3        It also checks the non-Perl syntax the PCRE supports (Python, .NET,
4        Oniguruma). Finally, there are some tests where PCRE and Perl differ,
5        either because PCRE can't be compatible, or there is a possible Perl
6        bug. --/
7    
8    /-- Originally, the Perl >= 5.10 things were in here too, but now I have
9        separated many (most?) of them out into test 11. However, there may still
10        be some that were overlooked. --/
11    
12  /(a)b|/I  /(a)b|/I
13  Capturing subpattern count = 1  Capturing subpattern count = 1
14  No options  No options
# Line 92  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 134  Capturing subpattern count = 0 Line 175  Capturing subpattern count = 0
175  No options  No options
176  No first char  No first char
177  No need char  No need char
178    Subject length lower bound = 3
179  Starting byte set: c d e  Starting byte set: c d e
180      this sentence eventually mentions a cat      this sentence eventually mentions a cat
181   0: cat   0: cat
# Line 145  Capturing subpattern count = 0 Line 187  Capturing subpattern count = 0
187  Options: caseless  Options: caseless
188  No first char  No first char
189  No need char  No need char
190    Subject length lower bound = 3
191  Starting byte set: C D E c d e  Starting byte set: C D E c d e
192      this sentence eventually mentions a CAT cat      this sentence eventually mentions a CAT cat
193   0: CAT   0: CAT
# Line 156  Capturing subpattern count = 0 Line 199  Capturing subpattern count = 0
199  No options  No options
200  No first char  No first char
201  No need char  No need char
202    Subject length lower bound = 1
203  Starting byte set: a b c d  Starting byte set: a b c d
204    
205  /(a|[^\dZ])/IS  /(a|[^\dZ])/IS
# Line 163  Capturing subpattern count = 1 Line 207  Capturing subpattern count = 1
207  No options  No options
208  No first char  No first char
209  No need char  No need char
210    Subject length lower bound = 1
211  Starting byte set: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a  Starting byte set: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
212    \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19    \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
213    \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / : ; < = >    \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / : ; < = >
# Line 183  Capturing subpattern count = 1 Line 228  Capturing subpattern count = 1
228  No options  No options
229  No first char  No first char
230  No need char  No need char
231    Subject length lower bound = 1
232  Starting byte set: \x09 \x0a \x0c \x0d \x20 a b  Starting byte set: \x09 \x0a \x0c \x0d \x20 a b
233    
234  /(ab\2)/  /(ab\2)/
# Line 331  No need char Line 377  No need char
377   2: <unset>   2: <unset>
378   3: def   3: def
379    
380  /abc/IP  /abc/P
381      abc      abc
382   0: abc   0: abc
383      *** Failers      *** Failers
384  No match: POSIX code 17: match failed  No match: POSIX code 17: match failed
385    
386  /^abc|def/IP  /^abc|def/P
387      abcdef      abcdef
388   0: abc   0: abc
389      abcdef\B      abcdef\B
390   0: def   0: def
391    
392  /.*((abc)$|(def))/IP  /.*((abc)$|(def))/P
393      defabc      defabc
394   0: defabc   0: defabc
395   1: abc   1: abc
# Line 353  No match: POSIX code 17: match failed Line 399  No match: POSIX code 17: match failed
399   1: def   1: def
400   3: def   3: def
401    
402  /the quick brown fox/IP  /the quick brown fox/P
403      the quick brown fox      the quick brown fox
404   0: the quick brown fox   0: the quick brown fox
405      *** Failers      *** Failers
# Line 361  No match: POSIX code 17: match failed Line 407  No match: POSIX code 17: match failed
407      The Quick Brown Fox      The Quick Brown Fox
408  No match: POSIX code 17: match failed  No match: POSIX code 17: match failed
409    
410  /the quick brown fox/IPi  /the quick brown fox/Pi
411      the quick brown fox      the quick brown fox
412   0: the quick brown fox   0: the quick brown fox
413      The Quick Brown Fox      The Quick Brown Fox
414   0: The Quick Brown Fox   0: The Quick Brown Fox
415    
416  /abc.def/IP  /abc.def/P
417      *** Failers      *** Failers
418  No match: POSIX code 17: match failed  No match: POSIX code 17: match failed
419      abc\ndef      abc\ndef
420  No match: POSIX code 17: match failed  No match: POSIX code 17: match failed
421    
422  /abc$/IP  /abc$/P
423      abc      abc
424   0: abc   0: abc
425      abc\n      abc\n
426   0: abc   0: abc
427    
428  /(abc)\2/IP  /(abc)\2/P
429  Failed: POSIX code 15: bad back reference at offset 7  Failed: POSIX code 15: bad back reference at offset 7
430    
431  /(abc\1)/IP  /(abc\1)/P
432      abc      abc
433  No match: POSIX code 17: match failed  No match: POSIX code 17: match failed
434    
# Line 516  Capturing subpattern count = 0 Line 562  Capturing subpattern count = 0
562  No options  No options
563  No first char  No first char
564  No need char  No need char
565    Subject length lower bound = 1
566  Starting byte set: a b c d  Starting byte set: a b c d
567    
568  /(?i)[abcd]/IS  /(?i)[abcd]/IS
# Line 523  Capturing subpattern count = 0 Line 570  Capturing subpattern count = 0
570  Options: caseless  Options: caseless
571  No first char  No first char
572  No need char  No need char
573    Subject length lower bound = 1
574  Starting byte set: A B C D a b c d  Starting byte set: A B C D a b c d
575    
576  /(?m)[xy]|(b|c)/IS  /(?m)[xy]|(b|c)/IS
# Line 530  Capturing subpattern count = 1 Line 578  Capturing subpattern count = 1
578  Options: multiline  Options: multiline
579  No first char  No first char
580  No need char  No need char
581    Subject length lower bound = 1
582  Starting byte set: b c x y  Starting byte set: b c x y
583    
584  /(^a|^b)/Im  /(^a|^b)/Im
# Line 583  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 594  Capturing subpattern count = 1 Line 641  Capturing subpattern count = 1
641  No options  No options
642  First char = 'b' (caseless)  First char = 'b' (caseless)
643  No need char  No need char
644  Study returned NULL  Subject length lower bound = 1
645    No set of starting bytes
646    
647  /(a*b|(?i:c*(?-i)d))/IS  /(a*b|(?i:c*(?-i)d))/IS
648  Capturing subpattern count = 1  Capturing subpattern count = 1
649  No options  No options
650  No first char  No first char
651  No need char  No need char
652    Subject length lower bound = 1
653  Starting byte set: C a b c d  Starting byte set: C a b c d
654    
655  /a$/I  /a$/I
# Line 665  Capturing subpattern count = 0 Line 714  Capturing subpattern count = 0
714  No options  No options
715  No first char  No first char
716  No need char  No need char
717    Subject length lower bound = 1
718  Starting byte set: a b  Starting byte set: a b
719    
720  /(?<!foo)(alpha|omega)/IS  /(?<!foo)(alpha|omega)/IS
# Line 672  Capturing subpattern count = 1 Line 722  Capturing subpattern count = 1
722  No options  No options
723  No first char  No first char
724  Need char = 'a'  Need char = 'a'
725    Subject length lower bound = 5
726  Starting byte set: a o  Starting byte set: a o
727    
728  /(?!alphabet)[ab]/IS  /(?!alphabet)[ab]/IS
# Line 679  Capturing subpattern count = 0 Line 730  Capturing subpattern count = 0
730  No options  No options
731  No first char  No first char
732  No need char  No need char
733    Subject length lower bound = 1
734  Starting byte set: a b  Starting byte set: a b
735    
736  /(?<=foo\n)^bar/Im  /(?<=foo\n)^bar/Im
# Line 833  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 845  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 1168  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 1615  No need char Line 1689  No need char
1689      \Nabc      \Nabc
1690  No match  No match
1691    
1692  /a*(b+)(z)(z)/IP  /a*(b+)(z)(z)/P
1693      aaaabbbbzzzz      aaaabbbbzzzz
1694   0: aaaabbbbzz   0: aaaabbbbzz
1695   1: bbbb   1: bbbb
# Line 1647  Capturing subpattern count = 0 Line 1721  Capturing subpattern count = 0
1721  Options: anchored  Options: anchored
1722  No first char  No first char
1723  Need char = 'd'  Need char = 'd'
1724  Study returned NULL  Subject length lower bound = 4
1725    No set of starting bytes
1726    
1727  /\(             # ( at start  /\(             # ( at start
1728    (?:           # Non-capturing bracket    (?:           # Non-capturing bracket
# Line 1805  Need char = ')' Line 1880  Need char = ')'
1880   0: (abcd(xyz<p>qrs)123)   0: (abcd(xyz<p>qrs)123)
1881   1: abcd(xyz<p>qrs)123   1: abcd(xyz<p>qrs)123
1882   2: 123   2: 123
  3: <unset>  
1883    
1884  /\( ( ( (?>[^()]+) | ((?R)) )* ) \) /Ix  /\( ( ( (?>[^()]+) | ((?R)) )* ) \) /Ix
1885  Capturing subpattern count = 3  Capturing subpattern count = 3
# Line 1880  Capturing subpattern count = 0 Line 1954  Capturing subpattern count = 0
1954  No options  No options
1955  No first char  No first char
1956  No need char  No need char
1957    Subject length lower bound = 1
1958  Starting byte set: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z  Starting byte set: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
1959    _ a b c d e f g h i j k l m n o p q r s t u v w x y z    _ a b c d e f g h i j k l m n o p q r s t u v w x y z
1960    
# Line 1941  Contains explicit CR or LF match Line 2016  Contains explicit CR or LF match
2016  No options  No options
2017  No first char  No first char
2018  No need char  No need char
2019    Subject length lower bound = 1
2020  Starting byte set: \x09 \x0a \x0b \x0c \x0d \x20  Starting byte set: \x09 \x0a \x0b \x0c \x0d \x20
2021    
2022  /^[[:cntrl:]]/DZ  /^[[:cntrl:]]/DZ
# Line 2683  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 2706  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 2731  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 2744  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 2917  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 3147  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 3411  Capturing subpattern count = 0 Line 3482  Capturing subpattern count = 0
3482  No options  No options
3483  No first char  No first char
3484  No need char  No need char
3485    Subject length lower bound = 1
3486  Starting byte set: a b  Starting byte set: a b
3487    
3488  /[^a]/I  /[^a]/I
# Line 3430  Capturing subpattern count = 0 Line 3502  Capturing subpattern count = 0
3502  No options  No options
3503  No first char  No first char
3504  Need char = '6'  Need char = '6'
3505    Subject length lower bound = 4
3506  Starting byte set: 0 1 2 3 4 5 6 7 8 9  Starting byte set: 0 1 2 3 4 5 6 7 8 9
3507    
3508  /a^b/I  /a^b/I
# Line 3463  Capturing subpattern count = 0 Line 3536  Capturing subpattern count = 0
3536  Options: caseless  Options: caseless
3537  No first char  No first char
3538  No need char  No need char
3539    Subject length lower bound = 1
3540  Starting byte set: A B a b  Starting byte set: A B a b
3541    
3542  /[ab](?i)cd/IS  /[ab](?i)cd/IS
# Line 3470  Capturing subpattern count = 0 Line 3544  Capturing subpattern count = 0
3544  No options  No options
3545  No first char  No first char
3546  Need char = 'd' (caseless)  Need char = 'd' (caseless)
3547    Subject length lower bound = 3
3548  Starting byte set: a b  Starting byte set: a b
3549    
3550  /abc(?C)def/I  /abc(?C)def/I
# Line 3505  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 3820  Capturing subpattern count = 0 Line 3915  Capturing subpattern count = 0
3915  No options  No options
3916  No first char  No first char
3917  No need char  No need char
3918    Subject length lower bound = 1
3919  Starting byte set: a b  Starting byte set: a b
3920    
3921  /(?R)/I  /(?R)/I
# Line 3908  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 3939  No options Line 4033  No options
4033  First char = 'a'  First char = 'a'
4034  Need char = 'b'  Need char = 'b'
4035    
 /^\W*(?:((.)\W*(?1)\W*\2|)|((.)\W*(?3)\W*\4|\W*.\W*))\W*$/Ii  
 Capturing subpattern count = 4  
 Max back reference = 4  
 Options: anchored caseless  
 No first char  
 No need char  
     1221  
  0: 1221  
  1: 1221  
  2: 1  
     Satan, oscillate my metallic sonatas!  
  0: Satan, oscillate my metallic sonatas!  
  1: <unset>  
  2: <unset>  
  3: Satan, oscillate my metallic sonatas  
  4: S  
     A man, a plan, a canal: Panama!  
  0: A man, a plan, a canal: Panama!  
  1: <unset>  
  2: <unset>  
  3: A man, a plan, a canal: Panama  
  4: A  
     Able was I ere I saw Elba.  
  0: Able was I ere I saw Elba.  
  1: <unset>  
  2: <unset>  
  3: Able was I ere I saw Elba  
  4: A  
     *** Failers  
 No match  
     The quick brown fox  
 No match  
   
4036  /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I  /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I
4037  Capturing subpattern count = 2  Capturing subpattern count = 2
4038  Options: anchored  Options: anchored
# Line 4164  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 4371  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 4538  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 4560  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 4583  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 4594  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 4637  Capturing subpattern count = 3 Line 4688  Capturing subpattern count = 3
4688  Options: caseless  Options: caseless
4689  No first char  No first char
4690  Need char = 'g' (caseless)  Need char = 'g' (caseless)
4691  Study returned NULL  Subject length lower bound = 8
4692    No set of starting bytes
4693       Baby Bjorn Active Carrier - With free SHIPPING!!       Baby Bjorn Active Carrier - With free SHIPPING!!
4694   0: Baby Bjorn Active Carrier - With free SHIPPING!!   0: Baby Bjorn Active Carrier - With free SHIPPING!!
4695   1: Baby Bjorn Active Carrier - With free SHIPPING!!   1: Baby Bjorn Active Carrier - With free SHIPPING!!
# Line 4655  Capturing subpattern count = 0 Line 4707  Capturing subpattern count = 0
4707  No options  No options
4708  No first char  No first char
4709  Need char = 'b'  Need char = 'b'
4710  Study returned NULL  Subject length lower bound = 1
4711    No set of starting bytes
4712    
4713  /(a|b)*.?c/ISDZ  /(a|b)*.?c/ISDZ
4714  ------------------------------------------------------------------  ------------------------------------------------------------------
# Line 4675  Capturing subpattern count = 1 Line 4728  Capturing subpattern count = 1
4728  No options  No options
4729  No first char  No first char
4730  Need char = 'c'  Need char = 'c'
4731  Study returned NULL  Subject length lower bound = 1
4732    No set of starting bytes
4733    
4734  /abc(?C255)de(?C)f/DZ  /abc(?C255)de(?C)f/DZ
4735  ------------------------------------------------------------------  ------------------------------------------------------------------
# Line 4732  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 4815  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 4869  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 4969  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          Bra
5151          Callout 255 0 14          Callout 255 0 14
# Line 5002  Capturing subpattern count = 1 Line 5178  Capturing subpattern count = 1
5178  Options:  Options:
5179  No first char  No first char
5180  No need char  No need char
5181    Subject length lower bound = 2
5182    Starting byte set: a b x
5183      Note: that { does NOT introduce a quantifier      Note: that { does NOT introduce a quantifier
5184  --->Note: that { does NOT introduce a quantifier  --->Note: that { does NOT introduce a quantifier
  +0 ^                                                ([ab]{,4}c|xy)  
  +1 ^                                                [ab]  
 +11 ^                                                x  
  +0  ^                                               ([ab]{,4}c|xy)  
  +1  ^                                               [ab]  
 +11  ^                                               x  
  +0   ^                                              ([ab]{,4}c|xy)  
  +1   ^                                              [ab]  
 +11   ^                                              x  
  +0    ^                                             ([ab]{,4}c|xy)  
  +1    ^                                             [ab]  
 +11    ^                                             x  
  +0     ^                                            ([ab]{,4}c|xy)  
  +1     ^                                            [ab]  
 +11     ^                                            x  
  +0      ^                                           ([ab]{,4}c|xy)  
  +1      ^                                           [ab]  
 +11      ^                                           x  
  +0       ^                                          ([ab]{,4}c|xy)  
  +1       ^                                          [ab]  
 +11       ^                                          x  
  +0        ^                                         ([ab]{,4}c|xy)  
  +1        ^                                         [ab]  
 +11        ^                                         x  
5185   +0         ^                                        ([ab]{,4}c|xy)   +0         ^                                        ([ab]{,4}c|xy)
5186   +1         ^                                        [ab]   +1         ^                                        [ab]
5187   +5         ^^                                       {   +5         ^^                                       {
5188  +11         ^                                        x  +11         ^                                        x
5189   +0          ^                                       ([ab]{,4}c|xy)   +0                                 ^                ([ab]{,4}c|xy)
5190   +1          ^                                       [ab]   +1                                 ^                [ab]
5191  +11          ^                                       x   +5                                 ^^               {
5192   +0           ^                                      ([ab]{,4}c|xy)  +11                                 ^                x
5193   +1           ^                                      [ab]   +0                                     ^            ([ab]{,4}c|xy)
5194  +11           ^                                      x   +1                                     ^            [ab]
5195   +0            ^                                     ([ab]{,4}c|xy)   +5                                     ^^           {
5196    +11                                     ^            x
5197    No match
5198    
5199    /([ab]{,4}c|xy)/ICDZSS
5200    ------------------------------------------------------------------
5201            Bra
5202            Callout 255 0 14
5203            CBra 1
5204            Callout 255 1 4
5205            [ab]
5206            Callout 255 5 1
5207            {
5208            Callout 255 6 1
5209            ,
5210            Callout 255 7 1
5211            4
5212            Callout 255 8 1
5213            }
5214            Callout 255 9 1
5215            c
5216            Callout 255 10 0
5217            Alt
5218            Callout 255 11 1
5219            x
5220            Callout 255 12 1
5221            y
5222            Callout 255 13 0
5223            Ket
5224            Callout 255 14 0
5225            Ket
5226            End
5227    ------------------------------------------------------------------
5228    Capturing subpattern count = 1
5229    Options:
5230    No first char
5231    No need char
5232        Note: that { does NOT introduce a quantifier
5233    --->Note: that { does NOT introduce a quantifier
5234     +0 ^                                                ([ab]{,4}c|xy)
5235     +1 ^                                                [ab]
5236    +11 ^                                                x
5237     +0  ^                                               ([ab]{,4}c|xy)
5238     +1  ^                                               [ab]
5239    +11  ^                                               x
5240     +0   ^                                              ([ab]{,4}c|xy)
5241     +1   ^                                              [ab]
5242    +11   ^                                              x
5243     +0    ^                                             ([ab]{,4}c|xy)
5244     +1    ^                                             [ab]
5245    +11    ^                                             x
5246     +0     ^                                            ([ab]{,4}c|xy)
5247     +1     ^                                            [ab]
5248    +11     ^                                            x
5249     +0      ^                                           ([ab]{,4}c|xy)
5250     +1      ^                                           [ab]
5251    +11      ^                                           x
5252     +0       ^                                          ([ab]{,4}c|xy)
5253     +1       ^                                          [ab]
5254    +11       ^                                          x
5255     +0        ^                                         ([ab]{,4}c|xy)
5256     +1        ^                                         [ab]
5257    +11        ^                                         x
5258     +0         ^                                        ([ab]{,4}c|xy)
5259     +1         ^                                        [ab]
5260     +5         ^^                                       {
5261    +11         ^                                        x
5262     +0          ^                                       ([ab]{,4}c|xy)
5263     +1          ^                                       [ab]
5264    +11          ^                                       x
5265     +0           ^                                      ([ab]{,4}c|xy)
5266     +1           ^                                      [ab]
5267    +11           ^                                      x
5268     +0            ^                                     ([ab]{,4}c|xy)
5269   +1            ^                                     [ab]   +1            ^                                     [ab]
5270  +11            ^                                     x  +11            ^                                     x
5271   +0             ^                                    ([ab]{,4}c|xy)   +0             ^                                    ([ab]{,4}c|xy)
# Line 5421  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
5653    No options
5654    First char = 'a'
5655    Need char = 'c'
5656    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
5661    Compiled pattern loaded from testsavedregex
5662    Study data loaded from testsavedregex
5663        abc
5664     0: abc
5665        ** Failers
5666    No match
5667        bca
5668    No match
5669    
5670    /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 loaded from testsavedregex  Compiled pattern loaded from testsavedregex
5678  No study data  No study data
5679      abc      abc
5680   0: abc   0: abc
# Line 5437  No match Line 5683  No match
5683      bca      bca
5684  No match  No match
5685    
5686  /abc/IF>testsavedregex  /abc/IFS>testsavedregex
5687    Capturing subpattern count = 0
5688    No options
5689    First char = 'a'
5690    Need char = 'c'
5691    Subject length lower bound = 3
5692    No set of starting bytes
5693    Compiled pattern written to testsavedregex
5694    Study data written to testsavedregex
5695    <testsavedregex
5696    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  Capturing subpattern count = 0
5707  No options  No options
5708  First char = 'a'  First char = 'a'
5709  Need char = 'c'  Need char = 'c'
5710  Compiled regex written to testsavedregex  Compiled pattern written to testsavedregex
5711  <testsavedregex  <testsavedregex
5712  Compiled regex (byte-inverted) loaded from testsavedregex  Compiled pattern (byte-inverted) loaded from testsavedregex
5713  No study data  No study data
5714      abc      abc
5715   0: abc   0: abc
# Line 5458  Capturing subpattern count = 1 Line 5723  Capturing subpattern count = 1
5723  No options  No options
5724  No first char  No first char
5725  No need char  No need char
5726    Subject length lower bound = 1
5727  Starting byte set: a b  Starting byte set: a b
5728  Compiled regex written to testsavedregex  Compiled pattern written to testsavedregex
5729  Study data written to testsavedregex  Study data written to testsavedregex
5730  <testsavedregex  <testsavedregex
5731  Compiled regex loaded from testsavedregex  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 5473  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
5763  No first char  No first char
5764  No need char  No need char
5765    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 5493  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 5548  No match Line 5851  No match
5851      line one\nthis is a line\nbreak in the second line      line one\nthis is a line\nbreak in the second line
5852  No match  No match
5853    
5854  /ab.cd/IP  /ab.cd/P
5855      ab-cd      ab-cd
5856   0: ab-cd   0: ab-cd
5857      ab=cd      ab=cd
# Line 5558  No match: POSIX code 17: match failed Line 5861  No match: POSIX code 17: match failed
5861      ab\ncd      ab\ncd
5862  No match: POSIX code 17: match failed  No match: POSIX code 17: match failed
5863    
5864  /ab.cd/IPs  /ab.cd/Ps
5865      ab-cd      ab-cd
5866   0: ab-cd   0: ab-cd
5867      ab=cd      ab=cd
# Line 5858  No need char Line 6161  No need char
6161      ((this))      ((this))
6162   0: ((this))   0: ((this))
6163    
6164  /a(b)c/IPN  /a(b)c/PN
6165      abc      abc
6166  Matched with REG_NOSUB  Matched with REG_NOSUB
6167    
6168  /a(?P<name>b)c/IPN  /a(?P<name>b)c/PN
6169      abc      abc
6170  Matched with REG_NOSUB  Matched with REG_NOSUB
6171    
# Line 6190  Capturing subpattern count = 0 Line 6493  Capturing subpattern count = 0
6493  No options  No options
6494  No first char  No first char
6495  Need char = ','  Need char = ','
6496    Subject length lower bound = 1
6497  Starting byte set: \x09 \x0a \x0c \x0d \x20 ,  Starting byte set: \x09 \x0a \x0c \x0d \x20 ,
6498      \x0b,\x0b      \x0b,\x0b
6499   0: ,   0: ,
# Line 6362  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 6494  Capturing subpattern count = 1 Line 6798  Capturing subpattern count = 1
6798  No options  No options
6799  No first char  No first char
6800  No need char  No need char
6801    Subject length lower bound = 1
6802  Starting byte set: C a b c d  Starting byte set: C a b c d
6803    
6804  /()[ab]xyz/IS  /()[ab]xyz/IS
# Line 6501  Capturing subpattern count = 1 Line 6806  Capturing subpattern count = 1
6806  No options  No options
6807  No first char  No first char
6808  Need char = 'z'  Need char = 'z'
6809    Subject length lower bound = 4
6810  Starting byte set: a b  Starting byte set: a b
6811    
6812  /(|)[ab]xyz/IS  /(|)[ab]xyz/IS
# Line 6508  Capturing subpattern count = 1 Line 6814  Capturing subpattern count = 1
6814  No options  No options
6815  No first char  No first char
6816  Need char = 'z'  Need char = 'z'
6817    Subject length lower bound = 4
6818  Starting byte set: a b  Starting byte set: a b
6819    
6820  /(|c)[ab]xyz/IS  /(|c)[ab]xyz/IS
# Line 6515  Capturing subpattern count = 1 Line 6822  Capturing subpattern count = 1
6822  No options  No options
6823  No first char  No first char
6824  Need char = 'z'  Need char = 'z'
6825    Subject length lower bound = 4
6826  Starting byte set: a b c  Starting byte set: a b c
6827    
6828  /(|c?)[ab]xyz/IS  /(|c?)[ab]xyz/IS
# Line 6522  Capturing subpattern count = 1 Line 6830  Capturing subpattern count = 1
6830  No options  No options
6831  No first char  No first char
6832  Need char = 'z'  Need char = 'z'
6833    Subject length lower bound = 4
6834  Starting byte set: a b c  Starting byte set: a b c
6835    
6836  /(d?|c?)[ab]xyz/IS  /(d?|c?)[ab]xyz/IS
# Line 6529  Capturing subpattern count = 1 Line 6838  Capturing subpattern count = 1
6838  No options  No options
6839  No first char  No first char
6840  Need char = 'z'  Need char = 'z'
6841    Subject length lower bound = 4
6842  Starting byte set: a b c d  Starting byte set: a b c d
6843    
6844  /(d?|c)[ab]xyz/IS  /(d?|c)[ab]xyz/IS
# Line 6536  Capturing subpattern count = 1 Line 6846  Capturing subpattern count = 1
6846  No options  No options
6847  No first char  No first char
6848  Need char = 'z'  Need char = 'z'
6849    Subject length lower bound = 4
6850  Starting byte set: a b c d  Starting byte set: a b c d
6851    
6852  /^a*b\d/DZ  /^a*b\d/DZ
# Line 6608  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 6628  Capturing subpattern count = 1 Line 6939  Capturing subpattern count = 1
6939  No options  No options
6940  No first char  No first char
6941  No need char  No need char
6942    Subject length lower bound = 1
6943  Starting byte set: a b c d  Starting byte set: a b c d
6944    
6945  /(a+|b*)[cd]/IS  /(a+|b*)[cd]/IS
# Line 6635  Capturing subpattern count = 1 Line 6947  Capturing subpattern count = 1
6947  No options  No options
6948  No first char  No first char
6949  No need char  No need char
6950    Subject length lower bound = 1
6951  Starting byte set: a b c d  Starting byte set: a b c d
6952    
6953  /(a*|b+)[cd]/IS  /(a*|b+)[cd]/IS
# Line 6642  Capturing subpattern count = 1 Line 6955  Capturing subpattern count = 1
6955  No options  No options
6956  No first char  No first char
6957  No need char  No need char
6958    Subject length lower bound = 1
6959  Starting byte set: a b c d  Starting byte set: a b c d
6960    
6961  /(a+|b+)[cd]/IS  /(a+|b+)[cd]/IS
# Line 6649  Capturing subpattern count = 1 Line 6963  Capturing subpattern count = 1
6963  No options  No options
6964  No first char  No first char
6965  No need char  No need char
6966    Subject length lower bound = 2
6967  Starting byte set: a b  Starting byte set: a b
6968    
6969  /((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((  /((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
# Line 7233  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 7242  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 7438  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 7454  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 7474  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 7488  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 7503  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 7572  Need char = ':' Line 7879  Need char = ':'
7879   0: abcd:   0: abcd:
7880   1: abcd   1: abcd
7881    
 /(?'abc'\w+):\k<abc>{2}/  
     a:aaxyz  
  0: a:aa  
  1: a  
     ab:ababxyz  
  0: ab:abab  
  1: ab  
     ** Failers  
 No match  
     a:axyz  
 No match  
     ab:abxyz  
 No match  
   
7882  /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/J  /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/J
7883      adaa      adaa
7884   0: adaa   0: adaa
# Line 7612  No match Line 7905  No match
7905      bddd      bddd
7906  No match  No match
7907    
 /^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)/x  
     abd  
  0: abd  
  1: a  
     ce  
  0: ce  
   
7908  /(?(<bc))/  /(?(<bc))/
7909  Failed: malformed number or name after (?( at offset 6  Failed: malformed number or name after (?( at offset 6
7910    
# Line 7649  Failed: reference to non-existent subpat Line 7935  Failed: reference to non-existent subpat
7935   1: abcabc1Xabc2XabcX   1: abcabc1Xabc2XabcX
7936   2: abcabc1Xabc2XabcX   2: abcabc1Xabc2XabcX
7937    
 /^(?(DEFINE) (?<A> a) (?<B> b) )  (?&A) (?&B) /x  
     abcd  
  0: ab  
  1: <unset>  
  2: <unset>  
   
 /(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT))  
   (?(DEFINE)  
   (?<NAME_PAT>[a-z]+)  
   (?<ADDRESS_PAT>\d+)  
   )/x  
     metcalfe 33  
  0: metcalfe 33  
  1: metcalfe  
  2: 33  
  3: <unset>  
  4: <unset>  
   
7938  /^(?(DEFINE) abc | xyz ) /x  /^(?(DEFINE) abc | xyz ) /x
7939  Failed: DEFINE group contains more than one branch at offset 22  Failed: DEFINE group contains more than one branch at offset 22
7940    
# Line 7844  Need char = 'P' Line 8112  Need char = 'P'
8112   0: PXP   0: PXP
8113   1: P   1: P
8114    
 /(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))\b(?&byte)(\.(?&byte)){3}/  
     1.2.3.4  
  0: 1.2.3.4  
  1: <unset>  
  2: .4  
     131.111.10.206  
  0: 131.111.10.206  
  1: <unset>  
  2: .206  
     10.0.0.0  
  0: 10.0.0.0  
  1: <unset>  
  2: .0  
     ** Failers  
 No match  
     10.6  
 No match  
     455.3.4.5  
 No match  
   
 /\b(?&byte)(\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))/  
     1.2.3.4  
  0: 1.2.3.4  
  1: .4  
  2: <unset>  
     131.111.10.206  
  0: 131.111.10.206  
  1: .206  
  2: <unset>  
     10.0.0.0  
  0: 10.0.0.0  
  1: .0  
  2: <unset>  
     ** Failers  
 No match  
     10.6  
 No match  
     455.3.4.5  
 No match  
   
8115  /(?:a(?&abc)b)*(?<abc>x)/  /(?:a(?&abc)b)*(?<abc>x)/
8116      123axbaxbaxbx456      123axbaxbaxbx456
8117   0: axbaxbaxbx   0: axbaxbaxbx
# Line 7921  No match Line 8149  No match
8149     DEFabcABCXYZ     DEFabcABCXYZ
8150  No match  No match
8151    
 /^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/  
     ababababbbabZXXXX  
  0: ababababbbabZ  
  1: ab  
  2: b  
   
8152  /^(a)\g-2/  /^(a)\g-2/
8153  Failed: reference to non-existent subpattern at offset 7  Failed: reference to non-existent subpattern at offset 7
8154    
# Line 8042  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 8056  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 8182  Failed: reference to non-existent subpat Line 8400  Failed: reference to non-existent subpat
8400   0: Y!   0: Y!
8401   1: !   1: !
8402    
 /(foo)\Kbar/  
     foobar  
  0: bar  
  1: foo  
   
 /(foo)(\Kbar|baz)/  
     foobar  
  0: bar  
  1: foo  
  2: bar  
     foobaz  
  0: foobaz  
  1: foo  
  2: baz  
   
 /(foo\Kbar)baz/  
     foobarbaz  
  0: barbaz  
  1: foobar  
   
8403  /(?<A>tom|bon)-\k{A}/  /(?<A>tom|bon)-\k{A}/
8404      tom-tom      tom-tom
8405   0: tom-tom   0: tom-tom
# Line 8214  No match Line 8412  No match
8412      tom-bon      tom-bon
8413  No match  No match
8414    
 /(?<A>tom|bon)-\g{A}/  
     tom-tom  
  0: tom-tom  
  1: tom  
     bon-bon  
  0: bon-bon  
  1: bon  
   
8415  /\g{A/  /\g{A/
8416  Failed: syntax error in subpattern name (missing terminator) at offset 4  Failed: syntax error in subpattern name (missing terminator) at offset 4
8417    
# Line 8316  Failed: syntax error in subpattern name Line 8506  Failed: syntax error in subpattern name
8506   3: <unset>   3: <unset>
8507   4: x   4: x
8508    
 /(?|(abc)|(xyz))\1/  
     abcabc  
  0: abcabc  
  1: abc  
     xyzxyz  
  0: xyzxyz  
  1: xyz  
     ** Failers  
 No match  
     abcxyz  
 No match  
     xyzabc  
 No match  
   
 /(?|(abc)|(xyz))(?1)/  
     abcabc  
  0: abcabc  
  1: abc  
     xyzabc  
  0: xyzabc  
  1: xyz  
     ** Failers  
 No match  
     xyzxyz  
 No match  
   
 /\H\h\V\v/  
     X X\x0a  
  0: X X\x0a  
     X\x09X\x0b  
  0: X\x09X\x0b  
     ** Failers  
 No match  
     \xa0 X\x0a  
 No match  
   
 /\H*\h+\V?\v{3,4}/  
     \x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a  
  0: \x09 \xa0X\x0a\x0b\x0c\x0d  
     \x09\x20\xa0\x0a\x0b\x0c\x0d\x0a  
  0: \x09 \xa0\x0a\x0b\x0c\x0d  
     \x09\x20\xa0\x0a\x0b\x0c  
  0: \x09 \xa0\x0a\x0b\x0c  
     ** Failers  
 No match  
     \x09\x20\xa0\x0a\x0b  
 No match  
   
 /\H{3,4}/  
     XY  ABCDE  
  0: ABCD  
     XY  PQR ST  
  0: PQR  
   
 /.\h{3,4}./  
     XY  AB    PQRS  
  0: B    P  
   
 /\h*X\h?\H+Y\H?Z/  
     >XNNNYZ  
  0: XNNNYZ  
     >  X NYQZ  
  0:   X NYQZ  
     ** Failers  
 No match  
     >XYZ  
 No match  
     >  X NY Z  
 No match  
   
 /\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/  
     >XY\x0aZ\x0aA\x0bNN\x0c  
  0: XY\x0aZ\x0aA\x0bNN\x0c  
     >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c  
  0: \x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c  
   
8509  /[\h]/BZ  /[\h]/BZ
8510  ------------------------------------------------------------------  ------------------------------------------------------------------
8511          Bra          Bra
# Line 8688  Failed: missing terminating ] for charac Line 8802  Failed: missing terminating ] for charac
8802          End          End
8803  ------------------------------------------------------------------  ------------------------------------------------------------------
8804    
8805  /^a+(*FAIL)/  /^a+(*FAIL)/C
8806      aaaaaa      aaaaaa
8807    --->aaaaaa
8808     +0 ^          ^
8809     +1 ^          a+
8810     +3 ^     ^    (*FAIL)
8811     +3 ^    ^     (*FAIL)
8812     +3 ^   ^      (*FAIL)
8813     +3 ^  ^       (*FAIL)
8814     +3 ^ ^        (*FAIL)
8815     +3 ^^         (*FAIL)
8816  No match  No match
8817    
8818  /a+b?c+(*FAIL)/  /a+b?c+(*FAIL)/C
     aaabccc  
 No match  
   
 /a+b?(*PRUNE)c+(*FAIL)/  
     aaabccc  
 No match  
   
 /a+b?(*COMMIT)c+(*FAIL)/  
     aaabccc  
 No match  
   
 /a+b?(*SKIP)c+(*FAIL)/  
     aaabcccaaabccc  
 No match  
   
 /^(?:aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/  
     aaaxxxxxx  
  0: aaaxxxxxx  
     aaa++++++  
  0: aaa  
     bbbxxxxx  
  0: bbbxxxxx  
     bbb+++++  
  0: bbb  
     cccxxxx  
  0: cccxxxx  
     ccc++++  
  0: ccc  
     dddddddd  
  0: ddd  
   
 /^(aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/  
     aaaxxxxxx  
  0: aaaxxxxxx  
  1: aaaxxxxxx  
     aaa++++++  
  0: aaa  
  1: aaa  
     bbbxxxxx  
  0: bbbxxxxx  
  1: bbbxxxxx  
     bbb+++++  
  0: bbb  
  1: bbb  
     cccxxxx  
  0: cccxxxx  
  1: cccxxxx  
     ccc++++  
  0: ccc  
  1: ccc  
     dddddddd  
  0: ddd  
  1: ddd  
   
 /a+b?(*THEN)c+(*FAIL)/  
     aaabccc  
 No match  
   
 /(A (A|B(*ACCEPT)|C) D)(E)/x  
     ABX  
  0: AB  
     AADE  
  0: AADE  
  1: AAD  
  2: A  
  3: E  
     ACDE  
  0: ACDE  
  1: ACD  
  2: C  
  3: E  
     ** Failers  
 No match  
     AD  
 No match  
   
 /^a+(*FAIL)/C  
     aaaaaa  
 --->aaaaaa  
  +0 ^          ^  
  +1 ^          a+  
  +3 ^     ^    (*FAIL)  
  +3 ^    ^     (*FAIL)  
  +3 ^   ^      (*FAIL)  
  +3 ^  ^       (*FAIL)  
  +3 ^ ^        (*FAIL)  
  +3 ^^         (*FAIL)  
 No match  
   
 /a+b?c+(*FAIL)/C  
8819      aaabccc      aaabccc
8820  --->aaabccc  --->aaabccc
8821   +0 ^           a+   +0 ^           a+
# Line 8897  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 8990  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 9195  Failed: subpattern name expected at offs Line 9246  Failed: subpattern name expected at offs
9246  /\k{}/  /\k{}/
9247  Failed: subpattern name expected at offset 3  Failed: subpattern name expected at offset 3
9248    
9249    /\k/
9250    Failed: \k is not followed by a braced, angle-bracketed, or quoted name at offset 2
9251    
9252    /\kabc/
9253    Failed: \k is not followed by a braced, angle-bracketed, or quoted name at offset 5
9254    
9255  /(?P=)/  /(?P=)/
9256  Failed: subpattern name expected at offset 4  Failed: subpattern name expected at offset 4
9257    
# Line 9240  Failed: unknown POSIX class name at offs Line 9297  Failed: unknown POSIX class name at offs
9297  /[[:a\dz:]]/  /[[:a\dz:]]/
9298  Failed: unknown POSIX class name at offset 3  Failed: unknown POSIX class name at offset 3
9299    
 /^(?<name>a|b\g<name>c)/  
     aaaa  
  0: a  
  1: a  
     bacxxx  
  0: bac  
  1: bac  
     bbaccxxx  
  0: bbacc  
  1: bbacc  
     bbbacccxx  
  0: bbbaccc  
  1: bbbaccc  
   
 /^(?<name>a|b\g'name'c)/  
     aaaa  
  0: a  
  1: a  
     bacxxx  
  0: bac  
  1: bac  
     bbaccxxx  
  0: bbacc  
  1: bbacc  
     bbbacccxx  
  0: bbbaccc  
  1: bbbaccc  
   
 /^(a|b\g<1>c)/  
     aaaa  
  0: a  
  1: a  
     bacxxx  
  0: bac  
  1: bac  
     bbaccxxx  
  0: bbacc  
  1: bbacc  
     bbbacccxx  
  0: bbbaccc  
  1: bbbaccc  
   
 /^(a|b\g'1'c)/  
     aaaa  
  0: a  
  1: a  
     bacxxx  
  0: bac  
  1: bac  
     bbaccxxx  
  0: bbacc  
  1: bbacc  
     bbbacccxx  
  0: bbbaccc  
  1: bbbaccc  
   
 /^(a|b\g'-1'c)/  
     aaaa  
  0: a  
  1: a  
     bacxxx  
  0: bac  
  1: bac  
     bbaccxxx  
  0: bbacc  
  1: bbacc  
     bbbacccxx  
  0: bbbaccc  
  1: bbbaccc  
   
 /(^(a|b\g<-1>c))/  
     aaaa  
  0: a  
  1: a  
  2: a  
     bacxxx  
  0: bac  
  1: bac  
  2: bac  
     bbaccxxx  
  0: bbacc  
  1: bbacc  
  2: bbacc  
     bbbacccxx  
  0: bbbaccc  
  1: bbbaccc  
  2: bbbaccc  
   
9300  /(^(a|b\g<-1'c))/  /(^(a|b\g<-1'c))/
9301  Failed: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number at offset 15  Failed: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number at offset 15
9302    
 /(^(a|b\g{-1}))/  
     bacxxx  
 No match  
   
 /(?-i:\g<name>)(?i:(?<name>a))/  
     XaaX  
  0: aa  
  1: a  
     XAAX  
  0: AA  
  1: A  
   
 /(?i:\g<name>)(?-i:(?<name>a))/  
     XaaX  
  0: aa  
  1: a  
     ** Failers  
 No match  
     XAAX  
 No match  
   
 /(?-i:\g<+1>)(?i:(a))/  
     XaaX  
  0: aa  
  1: a  
     XAAX  
  0: AA  
  1: A  
   
 /(?=(?<regex>(?#simplesyntax)\$(?<name>[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(?:\[(?<index>[a-zA-Z0-9_\x{7f}-\x{ff}]+|\$\g<name>)\]|->\g<name>(\(.*?\))?)?|(?#simple syntax withbraces)\$\{(?:\g<name>(?<indices>\[(?:\g<index>|'(?:\\.|[^'\\])*'|"(?:\g<regex>|\\.|[^"\\])*")\])?|\g<complex>|\$\{\g<complex>\})\}|(?#complexsyntax)\{(?<complex>\$(?<segment>\g<name>(\g<indices>*|\(.*?\))?)(?:->\g<segment>)*|\$\g<complex>|\$\{\g<complex>\})\}))\{/  
   
 /(?<n>a|b|c)\g<n>*/  
    abc  
  0: abc  
  1: a  
    accccbbb  
  0: accccbbb  
  1: a  
   
9303  /^(?+1)(?<a>x|y){0}z/  /^(?+1)(?<a>x|y){0}z/
9304      xzxx      xzxx
9305   0: xz   0: xz
  1: <unset>  
9306      yzyy      yzyy
9307   0: yz   0: yz
  1: <unset>  
9308      ** Failers      ** Failers
9309  No match  No match
9310      xxz      xxz
# Line 9491  Capturing subpattern count = 1 Line 9419  Capturing subpattern count = 1
9419  No options  No options
9420  No first char  No first char
9421  No need char  No need char
9422    Subject length lower bound = 1
9423  Starting byte set: x y z  Starting byte set: x y z
9424    
9425  /(?(?=.*b)b|^)/CI  /(?(?=.*b)b|^)/CI
# Line 9604  No match Line 9533  No match
9533   +0        ^     x   +0        ^     x
9534   +0         ^    x   +0         ^    x
9535  No match  No match
9536    
9537    /(*NO_START_OPT)xyz/C
9538      abcxyz
9539    --->abcxyz
9540    +15 ^          x
9541    +15  ^         x
9542    +15   ^        x
9543    +15    ^       x
9544    +16    ^^      y
9545    +17    ^ ^     z
9546    +18    ^  ^
9547     0: xyz
9548    
9549    /xyz/CY
9550      abcxyz
9551    --->abcxyz
9552     +0 ^          x
9553     +0  ^         x
9554     +0   ^        x
9555     +0    ^       x
9556     +1    ^^      y
9557     +2    ^ ^     z
9558     +3    ^  ^
9559     0: xyz
9560    
9561  /^"((?(?=[a])[^"])|b)*"$/C  /^"((?(?=[a])[^"])|b)*"$/C
9562      "ab"      "ab"
# Line 9638  No match Line 9591  No match
9591   0: "ab"   0: "ab"
9592   1:   1:
9593    
 /^X(?5)(a)(?|(b)|(q))(c)(d)(Y)/  
     XYabcdY  
  0: XYabcdY  
  1: a  
  2: b  
  3: c  
  4: d  
  5: Y  
   
9594  /^X(?5)(a)(?|(b)|(q))(c)(d)Y/  /^X(?5)(a)(?|(b)|(q))(c)(d)Y/
9595  Failed: reference to non-existent subpattern at offset 5  Failed: reference to non-existent subpattern at offset 5
9596    
# Line 9659  Failed: reference to non-existent subpat Line 9603  Failed: reference to non-existent subpat
9603   4: d   4: d
9604   5: Y   5: Y
9605    
 /^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/  
     XYabcdY  
  0: XYabcdY  
  1: a  
  2: b  
  3: <unset>  
  4: <unset>  
  5: c  
  6: d  
  7: Y  
   
 /^X(?7)(a)(?|(b|(r)(s))|(q))(c)(d)(Y)/  
     XYabcdY  
  0: XYabcdY  
  1: a  
  2: b  
  3: <unset>  
  4: <unset>  
  5: c  
  6: d  
  7: Y  
   
 /^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)/  
     XYabcdY  
  0: XYabcdY  
  1: a  
  2: b  
  3: <unset>  
  4: <unset>  
  5: c  
  6: d  
  7: Y  
   
9606  /Xa{2,4}b/  /Xa{2,4}b/
9607      X\P      X\P
9608  Partial match: X  Partial match: X
# Line 9918  Partial match: 123999 Line 9829  Partial match: 123999
9829    
9830  /Z(*F)/  /Z(*F)/
9831      Z\P      Z\P
9832  Partial match: Z  No match
9833      ZA\P      ZA\P
9834  No match  No match
9835    
9836  /Z(?!)/  /Z(?!)/
9837      Z\P      Z\P
9838  Partial match: Z  No match
9839      ZA\P      ZA\P
9840  No match  No match
9841    
9842  / End of testinput2 /  /dog(sbody)?/
9843        dogs\P
9844     0: dog
9845        dogs\P\P
9846    Partial match: dogs
9847    
9848    /dog(sbody)??/
9849        dogs\P
9850     0: dog
9851        dogs\P\P
9852     0: dog
9853    
9854    /dog|dogsbody/
9855        dogs\P
9856     0: dog
9857        dogs\P\P
9858     0: dog
9859    
9860    /dogsbody|dog/
9861        dogs\P
9862     0: dog
9863        dogs\P\P
9864    Partial match: dogs
9865    
9866    /\bthe cat\b/
9867        the cat\P
9868     0: the cat
9869        the cat\P\P
9870    Partial match: the cat
9871    
9872    /abc/
9873       abc\P
9874     0: abc
9875       abc\P\P
9876     0: abc
9877    
9878    /\w+A/P
9879       CDAAAAB
9880     0: CDAAAA
9881    
9882    /\w+A/PU
9883       CDAAAAB
9884     0: CDA
9885    
9886    /abc\K123/
9887        xyzabc123pqr
9888     0: 123
9889        xyzabc12\P
9890    Partial match: abc12
9891        xyzabc12\P\P
9892    Partial match: abc12
9893    
9894    /(?<=abc)123/
9895        xyzabc123pqr
9896     0: 123
9897        xyzabc12\P
9898    Partial match: abc12
9899        xyzabc12\P\P
9900    Partial match: abc12
9901    
9902    /\babc\b/
9903        +++abc+++
9904     0: abc
9905        +++ab\P
9906    Partial match: +ab
9907        +++ab\P\P
9908    Partial match: +ab
9909    
9910    /(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/BZ
9911    ------------------------------------------------------------------
9912            Bra
9913            Recurse
9914            Recurse
9915            Cond
9916            Cond def
9917            CBra 1
9918            <
9919            [^m]
9920            [^>]
9921            >
9922            [^<]
9923            Ket
9924            CBra 2
9925            \w*+
9926            Ket
9927            Ket
9928            Ket
9929            End
9930    ------------------------------------------------------------------
9931    
9932    /(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/BZ
9933    ------------------------------------------------------------------
9934            Bra
9935            Recurse
9936            Recurse
9937            Cond
9938            Cond def
9939            CBra 1
9940            <
9941            [\x00-/:-\xff] (neg)
9942            [^>]
9943            >
9944            [^<]
9945            Ket
9946            CBra 2
9947            \w*+
9948            Ket
9949            Ket
9950            Ket
9951            End
9952    ------------------------------------------------------------------
9953    
9954    /(ab)(x(y)z(cd(*ACCEPT)))pq/BZ
9955    ------------------------------------------------------------------
9956            Bra
9957            CBra 1
9958            ab
9959            Ket
9960            CBra 2
9961            x
9962            CBra 3
9963            y
9964            Ket
9965            z
9966            CBra 4
9967            cd
9968            Close 4
9969            Close 2
9970            *ACCEPT
9971            Ket
9972            Ket
9973            pq
9974            Ket
9975            End
9976    ------------------------------------------------------------------
9977    
9978    /abc\K/+
9979        abcdef
9980     0:
9981     0+ def
9982        abcdef\N\N
9983     0:
9984     0+ def
9985        xyzabcdef\N\N
9986     0:
9987     0+ def
9988        ** Failers
9989    No match
9990        abcdef\N
9991    No match
9992        xyzabcdef\N
9993    No match
9994    
9995    /^(?:(?=abc)|abc\K)/+
9996        abcdef
9997     0:
9998     0+ abcdef
9999        abcdef\N\N
10000     0:
10001     0+ def
10002        ** Failers
10003    No match
10004        abcdef\N
10005    No match
10006    
10007    /a?b?/+
10008        xyz
10009     0:
10010     0+ xyz
10011        xyzabc
10012     0:
10013     0+ xyzabc
10014        xyzabc\N
10015     0: ab
10016     0+ c
10017        xyzabc\N\N
10018     0:
10019     0+ yzabc
10020        xyz\N\N
10021     0:
10022     0+ yz
10023        ** Failers
10024     0:
10025     0+ ** Failers
10026        xyz\N
10027    No match
10028    
10029    /^a?b?/+
10030        xyz
10031     0:
10032     0+ xyz
10033        xyzabc
10034     0:
10035     0+ xyzabc
10036        ** Failers
10037     0:
10038     0+ ** Failers
10039        xyzabc\N
10040    No match
10041        xyzabc\N\N
10042    No match
10043        xyz\N\N
10044    No match
10045        xyz\N
10046    No match
10047    
10048    /^(?<name>a|b\g<name>c)/
10049        aaaa
10050     0: a
10051     1: a
10052        bacxxx
10053     0: bac
10054     1: bac
10055        bbaccxxx
10056     0: bbacc
10057     1: bbacc
10058        bbbacccxx
10059     0: bbbaccc
10060     1: bbbaccc
10061    
10062    /^(?<name>a|b\g'name'c)/
10063        aaaa
10064     0: a
10065     1: a
10066        bacxxx
10067     0: bac
10068     1: bac
10069        bbaccxxx
10070     0: bbacc
10071     1: bbacc
10072        bbbacccxx
10073     0: bbbaccc
10074     1: bbbaccc
10075    
10076    /^(a|b\g<1>c)/
10077        aaaa
10078     0: a
10079     1: a
10080        bacxxx
10081     0: bac
10082     1: bac
10083        bbaccxxx
10084     0: bbacc
10085     1: bbacc
10086        bbbacccxx
10087     0: bbbaccc
10088     1: bbbaccc
10089    
10090    /^(a|b\g'1'c)/
10091        aaaa
10092     0: a
10093     1: a
10094        bacxxx
10095     0: bac
10096     1: bac
10097        bbaccxxx
10098     0: bbacc
10099     1: bbacc
10100        bbbacccxx
10101     0: bbbaccc
10102     1: bbbaccc
10103    
10104    /^(a|b\g'-1'c)/
10105        aaaa
10106     0: a
10107     1: a
10108        bacxxx
10109     0: bac
10110     1: bac
10111        bbaccxxx
10112     0: bbacc
10113     1: bbacc
10114        bbbacccxx
10115     0: bbbaccc
10116     1: bbbaccc
10117    
10118    /(^(a|b\g<-1>c))/
10119        aaaa
10120     0: a
10121     1: a
10122     2: a
10123        bacxxx
10124     0: bac
10125     1: bac
10126     2: bac
10127        bbaccxxx
10128     0: bbacc
10129     1: bbacc
10130     2: bbacc
10131        bbbacccxx
10132     0: bbbaccc
10133     1: bbbaccc
10134     2: bbbaccc
10135    
10136    /(?-i:\g<name>)(?i:(?<name>a))/
10137        XaaX
10138     0: aa
10139     1: a
10140        XAAX
10141     0: AA
10142     1: A
10143    
10144    /(?i:\g<name>)(?-i:(?<name>a))/
10145        XaaX
10146     0: aa
10147     1: a
10148        ** Failers
10149    No match
10150        XAAX
10151    No match
10152    
10153    /(?-i:\g<+1>)(?i:(a))/
10154        XaaX
10155     0: aa
10156     1: a
10157        XAAX
10158     0: AA
10159     1: A
10160    
10161    /(?=(?<regex>(?#simplesyntax)\$(?<name>[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(?:\[(?<index>[a-zA-Z0-9_\x{7f}-\x{ff}]+|\$\g<name>)\]|->\g<name>(\(.*?\))?)?|(?#simple syntax withbraces)\$\{(?:\g<name>(?<indices>\[(?:\g<index>|'(?:\\.|[^'\\])*'|"(?:\g<regex>|\\.|[^"\\])*")\])?|\g<complex>|\$\{\g<complex>\})\}|(?#complexsyntax)\{(?<complex>\$(?<segment>\g<name>(\g<indices>*|\(.*?\))?)(?:->\g<segment>)*|\$\g<complex>|\$\{\g<complex>\})\}))\{/
10162    
10163    /(?<n>a|b|c)\g<n>*/
10164       abc
10165     0: abc
10166     1: a
10167       accccbbb
10168     0: accccbbb
10169     1: a
10170    
10171    /^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/
10172        XYabcdY
10173     0: XYabcdY
10174     1: a
10175     2: b
10176     3: <unset>
10177     4: <unset>
10178     5: c
10179     6: d
10180     7: Y
10181    
10182    /(?<=b(?1)|zzz)(a)/
10183        xbaax
10184     0: a
10185     1: a
10186        xzzzax
10187     0: a
10188     1: a
10189    
10190    /(a)(?<=b\1)/
10191    Failed: lookbehind assertion is not fixed length at offset 10
10192    
10193    /(a)(?<=b+(?1))/
10194    Failed: lookbehind assertion is not fixed length at offset 13
10195    
10196    /(a+)(?<=b(?1))/
10197    Failed: lookbehind assertion is not fixed length at offset 14
10198    
10199    /(a(?<=b(?1)))/
10200    Failed: lookbehind assertion is not fixed length at offset 13
10201    
10202    /(?<=b(?1))xyz/
10203    Failed: reference to non-existent subpattern at offset 8
10204    
10205    /(?<=b(?1))xyz(b+)pqrstuvew/
10206    Failed: lookbehind assertion is not fixed length at offset 26
10207    
10208    /(a|bc)\1/SI
10209    Capturing subpattern count = 1
10210    Max back reference = 1
10211    No options
10212    No first char
10213    No need char
10214    Subject length lower bound = 2
10215    Starting byte set: a b
10216    
10217    /(a|bc)\1{2,3}/SI
10218    Capturing subpattern count = 1
10219    Max back reference = 1
10220    No options
10221    No first char
10222    No need char
10223    Subject length lower bound = 3
10224    Starting byte set: a b
10225    
10226    /(a|bc)(?1)/SI
10227    Capturing subpattern count = 1
10228    No options
10229    No first char
10230    No need char
10231    Subject length lower bound = 2
10232    Starting byte set: a b
10233    
10234    /(a|b\1)(a|b\1)/SI
10235    Capturing subpattern count = 2
10236    Max back reference = 1
10237    No options
10238    No first char
10239    No need char
10240    Subject length lower bound = 2
10241    Starting byte set: a b
10242    
10243    /(a|b\1){2}/SI
10244    Capturing subpattern count = 1
10245    Max back reference = 1
10246    No options
10247    No first char
10248    No need char
10249    Subject length lower bound = 2
10250    Starting byte set: a b
10251    
10252    /(a|bbbb\1)(a|bbbb\1)/SI
10253    Capturing subpattern count = 2
10254    Max back reference = 1
10255    No options
10256    No first char
10257    No need char
10258    Subject length lower bound = 2
10259    Starting byte set: a b
10260    
10261    /(a|bbbb\1){2}/SI
10262    Capturing subpattern count = 1
10263    Max back reference = 1
10264    No options
10265    No first char
10266    No need char
10267    Subject length lower bound = 2
10268    Starting byte set: a b
10269    
10270    /^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/SI
10271    Capturing subpattern count = 1
10272    Options: anchored
10273    No first char
10274    Need char = ':'
10275    Subject length lower bound = 22
10276    No set of starting bytes
10277    
10278    /  (?: [\040\t] |  \(
10279    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10280    \)  )*                          # optional leading comment
10281    (?:    (?:
10282    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10283    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10284    |
10285    " (?:                      # opening quote...
10286    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
10287    |                     #    or
10288    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10289    )* "  # closing quote
10290    )                    # initial word
10291    (?:  (?: [\040\t] |  \(
10292    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10293    \)  )*  \.  (?: [\040\t] |  \(
10294    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10295    \)  )*   (?:
10296    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10297    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10298    |
10299    " (?:                      # opening quote...
10300    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
10301    |                     #    or
10302    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10303    )* "  # closing quote
10304    )  )* # further okay, if led by a period
10305    (?: [\040\t] |  \(
10306    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10307    \)  )*  @  (?: [\040\t] |  \(
10308    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10309    \)  )*    (?:
10310    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10311    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10312    |   \[                         # [
10313    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10314    \]                        #           ]
10315    )                           # initial subdomain
10316    (?:                                  #
10317    (?: [\040\t] |  \(
10318    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10319    \)  )*  \.                        # if led by a period...
10320    (?: [\040\t] |  \(
10321    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10322    \)  )*   (?:
10323    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10324    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10325    |   \[                         # [
10326    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10327    \]                        #           ]
10328    )                     #   ...further okay
10329    )*
10330    # address
10331    |                     #  or
10332    (?:
10333    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10334    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10335    |
10336    " (?:                      # opening quote...
10337    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
10338    |                     #    or
10339    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10340    )* "  # closing quote
10341    )             # one word, optionally followed by....
10342    (?:
10343    [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037]  |  # atom and space parts, or...
10344    \(
10345    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10346    \)       |  # comments, or...
10347    
10348    " (?:                      # opening quote...
10349    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
10350    |                     #    or
10351    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10352    )* "  # closing quote
10353    # quoted strings
10354    )*
10355    <  (?: [\040\t] |  \(
10356    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10357    \)  )*                     # leading <
10358    (?:  @  (?: [\040\t] |  \(
10359    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10360    \)  )*    (?:
10361    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10362    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10363    |   \[                         # [
10364    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10365    \]                        #           ]
10366    )                           # initial subdomain
10367    (?:                                  #
10368    (?: [\040\t] |  \(
10369    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10370    \)  )*  \.                        # if led by a period...
10371    (?: [\040\t] |  \(
10372    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10373    \)  )*   (?:
10374    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10375    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10376    |   \[                         # [
10377    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10378    \]                        #           ]
10379    )                     #   ...further okay
10380    )*
10381    
10382    (?:  (?: [\040\t] |  \(
10383    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10384    \)  )*  ,  (?: [\040\t] |  \(
10385    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10386    \)  )*  @  (?: [\040\t] |  \(
10387    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10388    \)  )*    (?:
10389    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10390    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10391    |   \[                         # [
10392    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10393    \]                        #           ]
10394    )                           # initial subdomain
10395    (?:                                  #
10396    (?: [\040\t] |  \(
10397    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10398    \)  )*  \.                        # if led by a period...
10399    (?: [\040\t] |  \(
10400    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10401    \)  )*   (?:
10402    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10403    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10404    |   \[                         # [
10405    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10406    \]                        #           ]
10407    )                     #   ...further okay
10408    )*
10409    )* # further okay, if led by comma
10410    :                                # closing colon
10411    (?: [\040\t] |  \(
10412    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10413    \)  )*  )? #       optional route
10414    (?:
10415    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10416    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10417    |
10418    " (?:                      # opening quote...
10419    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
10420    |                     #    or
10421    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10422    )* "  # closing quote
10423    )                    # initial word
10424    (?:  (?: [\040\t] |  \(
10425    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10426    \)  )*  \.  (?: [\040\t] |  \(
10427    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10428    \)  )*   (?:
10429    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10430    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10431    |
10432    " (?:                      # opening quote...
10433    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
10434    |                     #    or
10435    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10436    )* "  # closing quote
10437    )  )* # further okay, if led by a period
10438    (?: [\040\t] |  \(
10439    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10440    \)  )*  @  (?: [\040\t] |  \(
10441    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10442    \)  )*    (?:
10443    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10444    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10445    |   \[                         # [
10446    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10447    \]                        #           ]
10448    )                           # initial subdomain
10449    (?:                                  #
10450    (?: [\040\t] |  \(
10451    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10452    \)  )*  \.                        # if led by a period...
10453    (?: [\040\t] |  \(
10454    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10455    \)  )*   (?:
10456    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10457    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10458    |   \[                         # [
10459    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10460    \]                        #           ]
10461    )                     #   ...further okay
10462    )*
10463    #       address spec
10464    (?: [\040\t] |  \(
10465    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10466    \)  )*  > #                  trailing >
10467    # name and address
10468    )  (?: [\040\t] |  \(
10469    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10470    \)  )*                       # optional trailing comment
10471    /xSI
10472    Capturing subpattern count = 0
10473    Contains explicit CR or LF match
10474    Options: extended
10475    No first char
10476    No need char
10477    Subject length lower bound = 3
10478    Starting byte set: \x09 \x20 ! " # $ % & ' ( * + - / 0 1 2 3 4 5 6 7 8
10479      9 = ? A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ^ _ ` a b c d e
10480      f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f
10481    
10482    /<tr([\w\W\s\d][^<>]{0,})><TD([\w\W\s\d][^<>]{0,})>([\d]{0,}\.)(.*)((<BR>([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/isIS
10483    Capturing subpattern count = 11
10484    Options: caseless dotall
10485    First char = '<'
10486    Need char = '>'
10487    Subject length lower bound = 47
10488    No set of starting bytes
10489    
10490    "(?>.*/)foo"SI
10491    Capturing subpattern count = 0
10492    No options
10493    First char at start or follows newline
10494    Need char = 'o'
10495    Subject length lower bound = 4
10496    No set of starting bytes
10497    
10498    /(?(?=[^a-z]+[a-z])  \d{2}-[a-z]{3}-\d{2}  |  \d{2}-\d{2}-\d{2} ) /xSI
10499    Capturing subpattern count = 0
10500    Options: extended
10501    No first char
10502    Need char = '-'
10503    Subject length lower bound = 8
10504    No set of starting bytes
10505    
10506    /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/iSI
10507    Capturing subpattern count = 1
10508    Options: caseless
10509    No first char
10510    No need char
10511    Subject length lower bound = 1
10512    Starting byte set: A B C a b c
10513    
10514    /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/SI
10515    Capturing subpattern count = 0
10516    No options
10517    No first char
10518    Need char = 'b'
10519    Subject length lower bound = 41
10520    Starting byte set: c d
10521    
10522    /<a[\s]+href[\s]*=[\s]*          # find <a href=
10523     ([\"\'])?                       # find single or double quote
10524     (?(1) (.*?)\1 | ([^\s]+))       # if quote found, match up to next matching
10525                                     # quote, otherwise match up to next space
10526    /isxSI
10527    Capturing subpattern count = 3
10528    Max back reference = 1
10529    Options: caseless extended dotall
10530    First char = '<'
10531    Need char = '='
10532    Subject length lower bound = 9
10533    No set of starting bytes
10534    
10535    /^(?!:)                       # colon disallowed at start
10536      (?:                         # start of item
10537        (?: [0-9a-f]{1,4} |       # 1-4 hex digits or
10538        (?(1)0 | () ) )           # if null previously matched, fail; else null
10539        :                         # followed by colon
10540      ){1,7}                      # end item; 1-7 of them required
10541      [0-9a-f]{1,4} $             # final hex number at end of string
10542      (?(1)|.)                    # check that there was an empty component
10543      /xiIS
10544    Capturing subpattern count = 1
10545    Options: anchored caseless extended
10546    No first char
10547    Need char = ':'
10548    Subject length lower bound = 2
10549    No set of starting bytes
10550    
10551    /(?|(?<a>A)|(?<a>B))/I
10552    Capturing subpattern count = 1
10553    Named capturing subpatterns:
10554      a   1
10555      a   1
10556    No options
10557    No first char
10558    No need char
10559        AB\Ca
10560     0: A
10561     1: A
10562      C A (1) a
10563        BA\Ca
10564     0: B
10565     1: B
10566      C B (1) a
10567    
10568    /(?|(?<a>A)|(?<b>B))/
10569    Failed: different names for subpatterns of the same number are not allowed at offset 15
10570    
10571    /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |
10572        b(?<quote> (?<apostrophe>')|(?<realquote>")) )
10573        (?('quote')[a-z]+|[0-9]+)/JIx
10574    Capturing subpattern count = 6
10575    Named capturing subpatterns:
10576      apostrophe   2
10577      apostrophe   5
10578      quote        1
10579      quote        4
10580      realquote    3
10581      realquote    6
10582    Options: extended dupnames
10583    No first char
10584    No need char
10585        a"aaaaa
10586     0: a"aaaaa
10587     1: "
10588     2: <unset>
10589     3: "
10590        b"aaaaa
10591     0: b"aaaaa
10592     1: <unset>
10593     2: <unset>
10594     3: <unset>
10595     4: "
10596     5: <unset>
10597     6: "
10598        ** Failers
10599    No match
10600        b"11111
10601    No match
10602        a"11111
10603    No match
10604    
10605    /^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/JDZx
10606    ------------------------------------------------------------------
10607            Bra
10608            ^
10609            Bra
10610            CBra 1
10611            a
10612            Ket
10613            CBra 2
10614            b
10615            Ket
10616            CBra 3
10617            c
10618            Ket
10619            CBra 4
10620            d
10621            Ket
10622            Alt
10623            CBra 1
10624            e
10625            Ket
10626            Ket
10627            Cond
10628          4 Cond nref
10629            X
10630            Alt
10631            Y
10632            Ket
10633            Ket
10634            End
10635    ------------------------------------------------------------------
10636    Capturing subpattern count = 4
10637    Named capturing subpatterns:
10638      D   4
10639      D   1
10640    Options: anchored extended dupnames
10641    No first char
10642    No need char
10643        abcdX
10644     0: abcdX
10645     1: a
10646     2: b
10647     3: c
10648     4: d
10649        eX
10650     0: eX
10651     1: e
10652        ** Failers
10653    No match
10654        abcdY
10655    No match
10656        ey
10657    No match
10658    
10659    /(?<A>a) (b)(c)  (?<A>d  (?(R&A)$ | (?4)) )/JDZx
10660    ------------------------------------------------------------------
10661            Bra
10662            CBra 1
10663            a
10664            Ket
10665            CBra 2
10666            b
10667            Ket
10668            CBra 3
10669            c
10670            Ket
10671            CBra 4
10672            d
10673            Cond
10674            Cond nrecurse 1
10675            $
10676            Alt
10677            Recurse
10678            Ket
10679            Ket
10680            Ket
10681            End
10682    ------------------------------------------------------------------
10683    Capturing subpattern count = 4
10684    Named capturing subpatterns:
10685      A   1
10686      A   4
10687    Options: extended dupnames
10688    First char = 'a'
10689    Need char = 'd'
10690        abcdd
10691     0: abcdd
10692     1: a
10693     2: b
10694     3: c
10695     4: dd
10696        ** Failers
10697    No match
10698        abcdde
10699    No match
10700    
10701    /abcd*/
10702        xxxxabcd\P
10703     0: abcd
10704        xxxxabcd\P\P
10705    Partial match: abcd
10706    
10707    /abcd*/i
10708        xxxxabcd\P
10709     0: abcd
10710        xxxxabcd\P\P
10711    Partial match: abcd
10712        XXXXABCD\P
10713     0: ABCD
10714        XXXXABCD\P\P
10715    Partial match: ABCD
10716    
10717    /abc\d*/
10718        xxxxabc1\P
10719     0: abc1
10720        xxxxabc1\P\P
10721    Partial match: abc1
10722    
10723    /(a)bc\1*/
10724        xxxxabca\P
10725     0: abca
10726     1: a
10727        xxxxabca\P\P
10728    Partial match: abca
10729    
10730    /abc[de]*/
10731        xxxxabcde\P
10732     0: abcde
10733        xxxxabcde\P\P
10734    Partial match: abcde
10735    
10736    /-- This is not in the Perl >= 5.10 test because Perl seems currently to be
10737        broken and not behaving as specified in that it *does* bumpalong after
10738        hitting (*COMMIT). --/
10739    
10740    /(?1)(A(*COMMIT)|B)D/
10741        ABD
10742     0: ABD
10743     1: B
10744        XABD
10745     0: ABD
10746     1: B
10747        BAD
10748     0: BAD
10749     1: A
10750        ABXABD
10751     0: ABD
10752     1: B
10753        ** Failers
10754    No match
10755        ABX
10756    No match
10757        BAXBAD
10758    No match
10759    
10760    /(\3)(\1)(a)/<JS>
10761        cat
10762     0: a
10763     1:
10764     2:
10765     3: a
10766    
10767    /(\3)(\1)(a)/SI<JS>
10768    Capturing subpattern count = 3
10769    Max back reference = 3
10770    Options:
10771    No first char
10772    Need char = 'a'
10773    Subject length lower bound = 1
10774    No set of starting bytes
10775        cat
10776     0: a
10777     1:
10778     2:
10779     3: a
10780    
10781    /(\3)(\1)(a)/SI
10782    Capturing subpattern count = 3
10783    Max back reference = 3
10784    No options
10785    No first char
10786    Need char = 'a'
10787    Subject length lower bound = 3
10788    No set of starting bytes
10789        cat
10790    No match
10791    
10792    /i(?(DEFINE)(?<s>a))/SI
10793    Capturing subpattern count = 1
10794    Named capturing subpatterns:
10795      s   1
10796    No options
10797    First char = 'i'
10798    No need char
10799    Subject length lower bound = 1
10800    No set of starting bytes
10801        i
10802     0: i
10803    
10804    /()i(?(1)a)/SI
10805    Capturing subpattern count = 1
10806    No options
10807    No first char
10808    Need char = 'i'
10809    Subject length lower bound = 1
10810    Starting byte set: i
10811        ia
10812     0: ia
10813     1:
10814    
10815    /(?i)a(?-i)b|c/BZ
10816    ------------------------------------------------------------------
10817            Bra
10818         /i a
10819            b
10820            Alt
10821            c
10822            Ket
10823            End
10824    ------------------------------------------------------------------
10825        XabX
10826     0: ab
10827        XAbX
10828     0: Ab
10829        CcC
10830     0: c
10831        ** Failers
10832    No match
10833        XABX
10834    No match
10835    
10836    /(?i)a(?s)b|c/BZ
10837    ------------------------------------------------------------------
10838            Bra
10839         /i ab
10840            Alt
10841         /i c
10842            Ket
10843            End
10844    ------------------------------------------------------------------
10845    
10846    /(?i)a(?s-i)b|c/BZ
10847    ------------------------------------------------------------------
10848            Bra
10849         /i a
10850            b
10851            Alt
10852            c
10853            Ket
10854            End
10855    ------------------------------------------------------------------
10856    
10857    /^(ab(c\1)d|x){2}$/BZ
10858    ------------------------------------------------------------------
10859            Bra
10860            ^
10861            Once
10862            CBra 1
10863            ab
10864            CBra 2
10865            c
10866            \1
10867            Ket
10868            d
10869            Alt
10870            x
10871            Ket
10872            Ket
10873            Once
10874            CBra 1
10875            ab
10876            CBra 2
10877            c
10878            \1
10879            Ket
10880            d
10881            Alt
10882            x
10883            Ket
10884            Ket
10885            $
10886            Ket
10887            End
10888    ------------------------------------------------------------------
10889        xabcxd
10890     0: xabcxd
10891     1: abcxd
10892     2: cx
10893    
10894    /^(?&t)*+(?(DEFINE)(?<t>.))$/BZ
10895    ------------------------------------------------------------------
10896            Bra
10897            ^
10898            Braposzero
10899            SBraPos
10900            Recurse
10901            KetRpos
10902            Cond
10903            Cond def
10904            CBra 1
10905            Any
10906            Ket
10907            Ket
10908            $
10909            Ket
10910            End
10911    ------------------------------------------------------------------
10912    
10913    /^(?&t)*(?(DEFINE)(?<t>.))$/BZ
10914    ------------------------------------------------------------------
10915            Bra
10916            ^
10917            Brazero
10918            Once
10919            Recurse
10920            KetRmax
10921            Cond
10922            Cond def
10923            CBra 1
10924            Any
10925            Ket
10926            Ket
10927            $
10928            Ket
10929            End
10930    ------------------------------------------------------------------
10931    
10932    / -- The first four of these are not in the Perl >= 5.10 test because Perl
10933         documents that the use of \K in assertions is "not well defined". The
10934         last is here because Perl gives the match as "b" rather than "ab". I
10935         believe this to be a Perl bug. --/
10936    
10937    /(?=a\Kb)ab/
10938        ab
10939     0: b
10940    
10941    /(?!a\Kb)ac/
10942        ac
10943     0: ac
10944    
10945    /^abc(?<=b\Kc)d/
10946        abcd
10947     0: cd
10948    
10949    /^abc(?<!b\Kq)d/
10950        abcd
10951     0: abcd
10952    
10953    /(?>a\Kb)z|(ab)/
10954        ab
10955     0: ab
10956     1: ab
10957    
10958    /----------------------/
10959    
10960    /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
10961    Failed: recursive call could loop indefinitely at offset 31
10962    
10963    /abc(*MARK:)pqr/
10964    Failed: (*MARK) must have an argument at offset 10
10965    
10966    /abc(*:)pqr/
10967    Failed: (*MARK) must have an argument at offset 6
10968    
10969    /abc(*FAIL:123)xyz/
10970    Failed: an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT) at offset 13
10971    
10972    /--- This should, and does, fail. In Perl, it does not, which I think is a
10973         bug because replacing the B in the pattern by (B|D) does make it fail. ---/
10974    
10975    /A(*COMMIT)B/+K
10976        ACABX
10977    No match
10978    
10979    /--- These should be different, but in Perl 5.11 are not, which I think
10980         is a bug in Perl. ---/
10981    
10982    /A(*THEN)B|A(*THEN)C/K
10983        AC
10984     0: AC
10985    
10986    /A(*PRUNE)B|A(*PRUNE)C/K
10987        AC
10988    No match
10989    
10990    /--- A whole lot of tests of verbs with arguments are here rather than in test
10991         11 because Perl doesn't seem to follow its specification entirely
10992         correctly. ---/
10993    
10994    /--- Perl 5.11 sets $REGERROR on the AC failure case here; PCRE does not. It is
10995         not clear how Perl defines "involved in the failure of the match". ---/
10996    
10997    /^(A(*THEN:A)B|C(*THEN:B)D)/K
10998        AB
10999     0: AB
11000     1: AB
11001        CD
11002     0: CD
11003     1: CD
11004        ** Failers
11005    No match
11006        AC
11007    No match
11008        CB
11009    No match, mark = B
11010    
11011    /--- Check the use of names for success and failure. PCRE doesn't show these
11012    names for success, though Perl does, contrary to its spec. ---/
11013    
11014    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
11015        AB
11016     0: AB
11017     1: AB
11018        CD
11019     0: CD
11020     1: CD
11021        ** Failers
11022    No match
11023        AC
11024    No match, mark = A
11025        CB
11026    No match, mark = B
11027    
11028    /--- An empty name does not pass back an empty string. It is the same as if no
11029    name were given. ---/
11030    
11031    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/K
11032        AB
11033     0: AB
11034     1: AB
11035        CD
11036     0: CD
11037     1: CD
11038    
11039    /--- PRUNE goes to next bumpalong; COMMIT does not. ---/
11040    
11041    /A(*PRUNE:A)B/K
11042        ACAB
11043     0: AB
11044    
11045    /(*MARK:A)(*PRUNE:B)(C|X)/KS
11046        C
11047     0: C
11048     1: C
11049    MK: A
11050        D
11051    No match
11052    
11053    /(*MARK:A)(*PRUNE:B)(C|X)/KSS
11054        C
11055     0: C
11056     1: C
11057    MK: A
11058        D
11059    No match, mark = B
11060    
11061    /(*MARK:A)(*THEN:B)(C|X)/KS
11062        C
11063     0: C
11064     1: C
11065    MK: A
11066        D
11067    No match
11068    
11069    /(*MARK:A)(*THEN:B)(C|X)/KSS
11070        C
11071     0: C
11072     1: C
11073    MK: A
11074        D
11075    No match, mark = B
11076    
11077    /--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/
11078    
11079    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK
11080        AAAC
11081    No match
11082    
11083    /--- Same --/
11084    
11085    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK
11086        AAAC
11087    No match
11088    
11089    /--- This should fail; the SKIP advances by one, but when we get to AC, the
11090         PRUNE kills it. ---/
11091    
11092    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
11093        AAAC
11094    No match
11095    
11096    /A(*:A)A+(*SKIP)(B|Z) | AC/xK
11097        AAAC
11098    No match
11099    
11100    /--- This should fail, as a null name is the same as no name ---/
11101    
11102    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK
11103        AAAC
11104    No match
11105    
11106    /--- This fails in PCRE, and I think that is in accordance with Perl's
11107         documentation, though in Perl it succeeds. ---/
11108    
11109    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK
11110        AAAC
11111    No match
11112    
11113    /--- Mark names can be duplicated ---/
11114    
11115    /A(*:A)B|X(*:A)Y/K
11116        AABC
11117     0: AB
11118    MK: A
11119        XXYZ
11120     0: XY
11121    MK: A
11122    
11123    /^A(*:A)B|^X(*:A)Y/K
11124        ** Failers
11125    No match
11126        XAQQ
11127    No match, mark = A
11128    
11129    /--- A check on what happens after hitting a mark and them bumping along to
11130    something that does not even start. Perl reports tags after the failures here,
11131    though it does not when the individual letters are made into something
11132    more complicated. ---/
11133    
11134    /A(*:A)B|XX(*:B)Y/K
11135        AABC
11136     0: AB
11137    MK: A
11138        XXYZ
11139     0: XXY
11140    MK: B
11141        ** Failers
11142    No match
11143        XAQQ
11144    No match
11145        XAQQXZZ
11146    No match
11147        AXQQQ
11148    No match
11149        AXXQQQ
11150    No match
11151    
11152    /--- COMMIT at the start of a pattern should be the same as an anchor. Perl
11153    optimizations defeat this. So does the PCRE optimization unless we disable it
11154    with \Y. ---/
11155    
11156    /(*COMMIT)ABC/
11157        ABCDEFG
11158     0: ABC
11159        ** Failers
11160    No match
11161        DEFGABC\Y
11162    No match
11163    
11164    /--- Repeat some tests with added studying. ---/
11165    
11166    /A(*COMMIT)B/+KS
11167        ACABX
11168    No match
11169    
11170    /A(*THEN)B|A(*THEN)C/KS
11171        AC
11172     0: AC
11173    
11174    /A(*PRUNE)B|A(*PRUNE)C/KS
11175        AC
11176    No match
11177    
11178    /^(A(*THEN:A)B|C(*THEN:B)D)/KS
11179        AB
11180     0: AB
11181     1: AB
11182        CD
11183     0: CD
11184     1: CD
11185        ** Failers
11186    No match
11187        AC
11188    No match
11189        CB
11190    No match, mark = B
11191    
11192    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/KS
11193        AB
11194     0: AB
11195     1: AB
11196        CD
11197     0: CD
11198     1: CD
11199        ** Failers
11200    No match
11201        AC
11202    No match, mark = A
11203        CB
11204    No match, mark = B
11205    
11206    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/KS
11207        AB
11208     0: AB
11209     1: AB
11210        CD
11211     0: CD
11212     1: CD
11213    
11214    /A(*PRUNE:A)B/KS
11215        ACAB
11216     0: AB
11217    
11218    /(*MARK:A)(*PRUNE:B)(C|X)/KS
11219        C
11220     0: C
11221     1: C
11222    MK: A
11223        D
11224    No match
11225    
11226    /(*MARK:A)(*THEN:B)(C|X)/KS
11227        C
11228     0: C
11229     1: C
11230    MK: A
11231        D
11232    No match
11233    
11234    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xKS
11235        AAAC
11236    No match
11237    
11238    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xKS
11239        AAAC
11240    No match
11241    
11242    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xKS
11243        AAAC
11244    No match
11245    
11246    /A(*:A)A+(*SKIP)(B|Z) | AC/xKS
11247        AAAC
11248    No match
11249    
11250    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xKS
11251        AAAC
11252    No match
11253    
11254    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xKS
11255        AAAC
11256    No match
11257    
11258    /A(*:A)B|XX(*:B)Y/KS
11259        AABC
11260     0: AB
11261    MK: A
11262        XXYZ
11263     0: XXY
11264    MK: B
11265        ** Failers
11266    No match
11267        XAQQ
11268    No match
11269        XAQQXZZ
11270    No match
11271        AXQQQ
11272    No match
11273        AXXQQQ
11274    No match
11275    
11276    /(*COMMIT)ABC/
11277        ABCDEFG
11278     0: ABC
11279        ** Failers
11280    No match
11281        DEFGABC\Y
11282    No match
11283    
11284    /^(ab (c+(*THEN)cd) | xyz)/x
11285        abcccd
11286    No match
11287    
11288    /^(ab (c+(*PRUNE)cd) | xyz)/x
11289        abcccd
11290    No match
11291    
11292    /^(ab (c+(*FAIL)cd) | xyz)/x
11293        abcccd
11294    No match
11295    
11296    /--- Perl 5.11 gets some of these wrong ---/
11297    
11298    /(?>.(*ACCEPT))*?5/
11299        abcde
11300     0: a
11301    
11302    /(.(*ACCEPT))*?5/
11303        abcde
11304     0: a
11305     1: a
11306    
11307    /(.(*ACCEPT))5/
11308        abcde
11309     0: a
11310     1: a
11311    
11312    /(.(*ACCEPT))*5/
11313        abcde
11314     0: a
11315     1: a
11316    
11317    /A\NB./BZ
11318    ------------------------------------------------------------------
11319            Bra
11320            A
11321            Any
11322            B
11323            Any
11324            Ket
11325            End
11326    ------------------------------------------------------------------
11327        ACBD
11328     0: ACBD
11329        *** Failers
11330    No match
11331        A\nB
11332    No match
11333        ACB\n
11334    No match
11335    
11336    /A\NB./sBZ
11337    ------------------------------------------------------------------
11338            Bra
11339            A
11340            Any
11341            B
11342            AllAny
11343            Ket
11344            End
11345    ------------------------------------------------------------------
11346        ACBD
11347     0: ACBD
11348        ACB\n
11349     0: ACB\x0a
11350        *** Failers
11351    No match
11352        A\nB
11353    No match
11354    
11355    /A\NB/<crlf>
11356        A\nB
11357     0: A\x0aB
11358        A\rB
11359     0: A\x0dB
11360        ** Failers
11361    No match
11362        A\r\nB
11363    No match
11364    
11365    /\R+b/BZ
11366    ------------------------------------------------------------------
11367            Bra
11368            \R++
11369            b
11370            Ket
11371            End
11372    ------------------------------------------------------------------
11373    
11374    /\R+\n/BZ
11375    ------------------------------------------------------------------
11376            Bra
11377            \R+
11378            \x0a
11379            Ket
11380            End
11381    ------------------------------------------------------------------
11382    
11383    /\R+\d/BZ
11384    ------------------------------------------------------------------
11385            Bra
11386            \R++
11387            \d
11388            Ket
11389            End
11390    ------------------------------------------------------------------
11391    
11392    /\d*\R/BZ
11393    ------------------------------------------------------------------
11394            Bra
11395            \d*+
11396            \R
11397            Ket
11398            End
11399    ------------------------------------------------------------------
11400    
11401    /\s*\R/BZ
11402    ------------------------------------------------------------------
11403            Bra
11404            \s*+
11405            \R
11406            Ket
11407            End
11408    ------------------------------------------------------------------
11409    
11410    /-- Perl treats this one differently, not failing the second string. I believe
11411        that is a bug in Perl. --/
11412    
11413    /^((abc|abcx)(*THEN)y|abcd)/
11414        abcd
11415     0: abcd
11416     1: abcd
11417        *** Failers
11418    No match
11419        abcxy
11420    No match
11421    
11422    /(?<=abc)def/
11423        abc\P\P
11424    Partial match: abc
11425    
11426    /abc$/
11427        abc
11428     0: abc
11429        abc\P
11430     0: abc
11431        abc\P\P
11432    Partial match: abc
11433    
11434    /abc$/m
11435        abc
11436     0: abc
11437        abc\n
11438     0: abc
11439        abc\P\P
11440    Partial match: abc
11441        abc\n\P\P
11442     0: abc
11443        abc\P
11444     0: abc
11445        abc\n\P
11446     0: abc
11447    
11448    /abc\z/
11449        abc
11450     0: abc
11451        abc\P
11452     0: abc
11453        abc\P\P
11454    Partial match: abc
11455    
11456    /abc\Z/
11457        abc
11458     0: abc
11459        abc\P
11460     0: abc
11461        abc\P\P
11462    Partial match: abc
11463    
11464    /abc\b/
11465        abc
11466     0: abc
11467        abc\P
11468     0: abc
11469        abc\P\P
11470    Partial match: abc
11471    
11472    /abc\B/
11473        abc
11474    No match
11475        abc\P
11476    Partial match: abc
11477        abc\P\P
11478    Partial match: abc
11479    
11480    /.+/
11481        abc\>0
11482     0: abc
11483        abc\>1
11484     0: bc
11485        abc\>2
11486     0: c
11487        abc\>3
11488    No match
11489        abc\>4
11490    Error -24 (bad offset value)
11491        abc\>-4
11492    Error -24 (bad offset value)
11493    
11494    /^\cģ/
11495    Failed: \c must be followed by an ASCII character at offset 3
11496    
11497    /(?P<abn>(?P=abn)xxx)/BZ
11498    ------------------------------------------------------------------
11499            Bra
11500            Once
11501            CBra 1
11502            \1
11503            xxx
11504            Ket
11505            Ket
11506            Ket
11507            End
11508    ------------------------------------------------------------------
11509    
11510    /(a\1z)/BZ
11511    ------------------------------------------------------------------
11512            Bra
11513            Once
11514            CBra 1
11515            a
11516            \1
11517            z
11518            Ket
11519            Ket
11520            Ket
11521            End
11522    ------------------------------------------------------------------
11523    
11524    /(?P<abn>(?P=abn)(?<badstufxxx)/BZ
11525    Failed: syntax error in subpattern name (missing terminator) at offset 29
11526    
11527    /(?P<abn>(?P=axn)xxx)/BZ
11528    Failed: reference to non-existent subpattern at offset 15
11529    
11530    /(?P<abn>(?P=axn)xxx)(?<axn>yy)/BZ
11531    ------------------------------------------------------------------
11532            Bra
11533            CBra 1
11534            \2
11535            xxx
11536            Ket
11537            CBra 2
11538            yy
11539            Ket
11540            Ket
11541            End
11542    ------------------------------------------------------------------
11543    
11544    /-- These tests are here because Perl gets the first one wrong. --/
11545    
11546    /(\R*)(.)/s
11547        \r\n
11548     0: \x0d
11549     1:
11550     2: \x0d
11551        \r\r\n\n\r
11552     0: \x0d\x0d\x0a\x0a\x0d
11553     1: \x0d\x0d\x0a\x0a
11554     2: \x0d
11555        \r\r\n\n\r\n
11556     0: \x0d\x0d\x0a\x0a\x0d
11557     1: \x0d\x0d\x0a\x0a
11558     2: \x0d
11559    
11560    /(\R)*(.)/s
11561        \r\n
11562     0: \x0d
11563     1: <unset>
11564     2: \x0d
11565        \r\r\n\n\r
11566     0: \x0d\x0d\x0a\x0a\x0d
11567     1: \x0a
11568     2: \x0d
11569        \r\r\n\n\r\n
11570     0: \x0d\x0d\x0a\x0a\x0d
11571     1: \x0a
11572     2: \x0d
11573    
11574    /((?>\r\n|\n|\x0b|\f|\r|\x85)*)(.)/s
11575        \r\n
11576     0: \x0d
11577     1:
11578     2: \x0d
11579        \r\r\n\n\r
11580     0: \x0d\x0d\x0a\x0a\x0d
11581     1: \x0d\x0d\x0a\x0a
11582     2: \x0d
11583        \r\r\n\n\r\n
11584     0: \x0d\x0d\x0a\x0a\x0d
11585     1: \x0d\x0d\x0a\x0a
11586     2: \x0d
11587    
11588    /-- --/
11589    
11590    /^abc$/BZ
11591    ------------------------------------------------------------------
11592            Bra
11593            ^
11594            abc
11595            $
11596            Ket
11597            End
11598    ------------------------------------------------------------------
11599    
11600    /^abc$/BZm
11601    ------------------------------------------------------------------
11602            Bra
11603         /m ^
11604            abc
11605         /m $
11606            Ket
11607            End
11608    ------------------------------------------------------------------
11609    
11610    /^(a)*+(\w)/S
11611        aaaaX
11612     0: aaaaX
11613     1: a
11614     2: X
11615        ** Failers
11616    No match
11617        aaaa
11618    No match
11619    
11620    /^(?:a)*+(\w)/S
11621        aaaaX
11622     0: aaaaX
11623     1: X
11624        ** Failers
11625    No match
11626        aaaa
11627    No match
11628    
11629    /(a)++1234/SDZ
11630    ------------------------------------------------------------------
11631            Bra
11632            CBraPos 1
11633            a
11634            KetRpos
11635            1234
11636            Ket
11637            End
11638    ------------------------------------------------------------------
11639    Capturing subpattern count = 1
11640    No options
11641    First char = 'a'
11642    Need char = '4'
11643    Subject length lower bound = 5
11644    No set of starting bytes
11645    
11646    /([abc])++1234/SI
11647    Capturing subpattern count = 1
11648    No options
11649    No first char
11650    Need char = '4'
11651    Subject length lower bound = 5
11652    Starting byte set: a b c
11653    
11654    /(?<=(abc)+)X/
11655    Failed: lookbehind assertion is not fixed length at offset 10
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 = 1
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 = 0
11701    Options: anchored
11702    No first char
11703    No need char
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    Need char = 'b'
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 = 1
11725    No options
11726    First char at start or follows newline
11727    No need char
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    Need char = 'b'
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    /(?:.*ab|.*)++/I
11748    Capturing subpattern count = 0
11749    No options
11750    First char at start or follows newline
11751    No need char
11752    
11753    /(?=a)[bcd]/I
11754    Capturing subpattern count = 0
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]/I
11772    Capturing subpattern count = 1
11773    No options
11774    First char = 'a'
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++)[bcd]/iI
11790    Capturing subpattern count = 0
11791    Options: caseless
11792    First char = 'a' (caseless)
11793    No need char
11794    
11795    /(?=a{3})[bcd]/iI
11796    Capturing subpattern count = 0
11797    Options: caseless
11798    First char = 'a' (caseless)
11799    Need char = 'a' (caseless)
11800    
11801    /(abc)\1+/S
11802    
11803    /-- Perl doesn't get these right IMO (the 3rd is PCRE-specific) --/
11804    
11805    /(?1)(?:(b(*ACCEPT))){0}/
11806        b
11807     0: b
11808    
11809    /(?1)(?:(b(*ACCEPT))){0}c/
11810        bc
11811     0: bc
11812        ** Failers
11813    No match
11814        b
11815    No match
11816    
11817    /(?1)(?:((*ACCEPT))){0}c/
11818        c
11819     0: c
11820        c\N
11821     0: c
11822    
11823    /^.*?(?(?=a)a|b(*THEN)c)/
11824        ba
11825     0: ba
11826    
11827    /^.*?(?(?=a)a|bc)/
11828        ba
11829     0: ba
11830    
11831    /-- --/
11832    
11833    /-- These studied versions are here because they are not Perl-compatible; the
11834        studying means the mark is not seen. --/
11835    
11836    /(*MARK:A)(*SKIP:B)(C|X)/KS
11837        C
11838     0: C
11839     1: C
11840    MK: A
11841        D
11842    No match
11843    
11844    /(*:A)A+(*SKIP:A)(B|Z)/KS
11845        AAAC
11846    No match
11847    
11848    /-- --/
11849    
11850    "(?=a*(*ACCEPT)b)c"
11851        c
11852     0: c
11853        c\N
11854     0: c
11855    
11856    /(?1)c(?(DEFINE)((*ACCEPT)b))/
11857        c
11858     0: c
11859        c\N
11860     0: c
11861    
11862    /(?>(*ACCEPT)b)c/
11863        c
11864     0:
11865        c\N
11866    No match
11867    
11868    /(?:(?>(a)))+a%/++
11869        %aa%
11870     0: aa%
11871     0+
11872     1: a
11873     1+ a%
11874    
11875    /(a)b|ac/++
11876        ac\O3
11877    Matched, but too many substrings
11878     0: ac
11879     0+
11880    
11881    /(?(DEFINE)(a(?2)|b)(b(?1)|a))(?:(?1)|(?2))/SI
11882    Capturing subpattern count = 2
11883    No options
11884    No first char
11885    No need char
11886