/[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 640 by ph10, Mon Jul 25 10:50:28 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 7676  Options: extended Line 7944  Options: extended
7944  First char = 'x'  First char = 'x'
7945  Need char = 'z'  Need char = 'z'
7946    
 /(?(DEFINE) abc){3} xyz/x  
 Failed: repeating a DEFINE group is not allowed at offset 17  
   
7947  /(a|)*\d/  /(a|)*\d/
7948    \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa    \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
7949  No match  No match
# Line 7844  Need char = 'P' Line 8109  Need char = 'P'
8109   0: PXP   0: PXP
8110   1: P   1: P
8111    
 /(?(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  
   
8112  /(?:a(?&abc)b)*(?<abc>x)/  /(?:a(?&abc)b)*(?<abc>x)/
8113      123axbaxbaxbx456      123axbaxbaxbx456
8114   0: axbaxbaxbx   0: axbaxbaxbx
# Line 7921  No match Line 8146  No match
8146     DEFabcABCXYZ     DEFabcABCXYZ
8147  No match  No match
8148    
 /^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/  
     ababababbbabZXXXX  
  0: ababababbbabZ  
  1: ab  
  2: b  
   
8149  /^(a)\g-2/  /^(a)\g-2/
8150  Failed: reference to non-existent subpattern at offset 7  Failed: reference to non-existent subpattern at offset 7
8151    
# Line 8042  No match Line 8261  No match
8261          Alt          Alt
8262          c          c
8263          Ket          Ket
         Once  
8264          Recurse          Recurse
8265          Ket          Ket
         Ket  
8266          End          End
8267  ------------------------------------------------------------------  ------------------------------------------------------------------
8268      abc      abc
# Line 8056  No match Line 8273  No match
8273  ------------------------------------------------------------------  ------------------------------------------------------------------
8274          Bra          Bra
8275          xy          xy
         Once  
8276          Recurse          Recurse
         Ket  
8277          CBra 1          CBra 1
8278          abc          abc
8279          Ket          Ket
# Line 8182  Failed: reference to non-existent subpat Line 8397  Failed: reference to non-existent subpat
8397   0: Y!   0: Y!
8398   1: !   1: !
8399    
 /(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  
   
8400  /(?<A>tom|bon)-\k{A}/  /(?<A>tom|bon)-\k{A}/
8401      tom-tom      tom-tom
8402   0: tom-tom   0: tom-tom
# Line 8214  No match Line 8409  No match
8409      tom-bon      tom-bon
8410  No match  No match
8411    
 /(?<A>tom|bon)-\g{A}/  
     tom-tom  
  0: tom-tom  
  1: tom  
     bon-bon  
  0: bon-bon  
  1: bon  
   
8412  /\g{A/  /\g{A/
8413  Failed: syntax error in subpattern name (missing terminator) at offset 4  Failed: syntax error in subpattern name (missing terminator) at offset 4
8414    
# Line 8316  Failed: syntax error in subpattern name Line 8503  Failed: syntax error in subpattern name
8503   3: <unset>   3: <unset>
8504   4: x   4: x
8505    
 /(?|(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  
   
8506  /[\h]/BZ  /[\h]/BZ
8507  ------------------------------------------------------------------  ------------------------------------------------------------------
8508          Bra          Bra
# Line 8688  Failed: missing terminating ] for charac Line 8799  Failed: missing terminating ] for charac
8799          End          End
8800  ------------------------------------------------------------------  ------------------------------------------------------------------
8801    
8802  /^a+(*FAIL)/  /^a+(*FAIL)/C
8803      aaaaaa      aaaaaa
8804    --->aaaaaa
8805     +0 ^          ^
8806     +1 ^          a+
8807     +3 ^     ^    (*FAIL)
8808     +3 ^    ^     (*FAIL)
8809     +3 ^   ^      (*FAIL)
8810     +3 ^  ^       (*FAIL)
8811     +3 ^ ^        (*FAIL)
8812     +3 ^^         (*FAIL)
8813  No match  No match
8814    
8815  /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  
8816      aaabccc      aaabccc
8817  --->aaabccc  --->aaabccc
8818   +0 ^           a+   +0 ^           a+
# Line 8897  No match Line 8927  No match
8927  +13   ^  ^      (*FAIL)  +13   ^  ^      (*FAIL)
8928  No match  No match
8929    
 /a(*PRUNE:XXX)b/  
 Failed: (*VERB) with an argument is not supported at offset 8  
   
8930  /a(*MARK)b/  /a(*MARK)b/
8931  Failed: (*VERB) not recognized at offset 7  Failed: (*MARK) must have an argument at offset 7
8932    
8933  /(?i:A{1,}\6666666666)/  /(?i:A{1,}\6666666666)/
8934  Failed: number is too big at offset 19  Failed: number is too big at offset 19
# Line 8909  Failed: number is too big at offset 19 Line 8936  Failed: number is too big at offset 19
8936  /\g6666666666/  /\g6666666666/
8937  Failed: number is too big at offset 11  Failed: number is too big at offset 11
8938    
8939  /[\g6666666666]/  /[\g6666666666]/BZ
8940  Failed: number is too big at offset 12  ------------------------------------------------------------------
8941            Bra
8942            [6g]
8943            Ket
8944            End
8945    ------------------------------------------------------------------
8946    
8947  /(?1)\c[/  /(?1)\c[/
8948  Failed: reference to non-existent subpattern at offset 3  Failed: reference to non-existent subpattern at offset 3
# Line 8990  No match Line 9022  No match
9022  No match  No match
9023      a\x85b      a\x85b
9024  No match  No match
9025    
9026    /(*ANY).*/g
9027        abc\r\ndef
9028     0: abc
9029     0:
9030     0: def
9031     0:
9032    
9033    /(*ANYCRLF).*/g
9034        abc\r\ndef
9035     0: abc
9036     0:
9037     0: def
9038     0:
9039    
9040    /(*CRLF).*/g
9041        abc\r\ndef
9042     0: abc
9043     0:
9044     0: def
9045     0:
9046    
9047  /a\Rb/I<bsr_anycrlf>  /a\Rb/I<bsr_anycrlf>
9048  Capturing subpattern count = 0  Capturing subpattern count = 0
# Line 9195  Failed: subpattern name expected at offs Line 9248  Failed: subpattern name expected at offs
9248  /\k{}/  /\k{}/
9249  Failed: subpattern name expected at offset 3  Failed: subpattern name expected at offset 3
9250    
9251    /\k/
9252    Failed: \k is not followed by a braced, angle-bracketed, or quoted name at offset 2
9253    
9254    /\kabc/
9255    Failed: \k is not followed by a braced, angle-bracketed, or quoted name at offset 5
9256    
9257  /(?P=)/  /(?P=)/
9258  Failed: subpattern name expected at offset 4  Failed: subpattern name expected at offset 4
9259    
# Line 9240  Failed: unknown POSIX class name at offs Line 9299  Failed: unknown POSIX class name at offs
9299  /[[:a\dz:]]/  /[[:a\dz:]]/
9300  Failed: unknown POSIX class name at offset 3  Failed: unknown POSIX class name at offset 3
9301    
 /^(?<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  
   
9302  /(^(a|b\g<-1'c))/  /(^(a|b\g<-1'c))/
9303  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
9304    
 /(^(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  
   
9305  /^(?+1)(?<a>x|y){0}z/  /^(?+1)(?<a>x|y){0}z/
9306      xzxx      xzxx
9307   0: xz   0: xz
  1: <unset>  
9308      yzyy      yzyy
9309   0: yz   0: yz
  1: <unset>  
9310      ** Failers      ** Failers
9311  No match  No match
9312      xxz      xxz
# Line 9491  Capturing subpattern count = 1 Line 9421  Capturing subpattern count = 1
9421  No options  No options
9422  No first char  No first char
9423  No need char  No need char
9424    Subject length lower bound = 1
9425  Starting byte set: x y z  Starting byte set: x y z
9426    
9427  /(?(?=.*b)b|^)/CI  /(?(?=.*b)b|^)/CI
# Line 9604  No match Line 9535  No match
9535   +0        ^     x   +0        ^     x
9536   +0         ^    x   +0         ^    x
9537  No match  No match
9538    
9539    /(*NO_START_OPT)xyz/C
9540      abcxyz
9541    --->abcxyz
9542    +15 ^          x
9543    +15  ^         x
9544    +15   ^        x
9545    +15    ^       x
9546    +16    ^^      y
9547    +17    ^ ^     z
9548    +18    ^  ^
9549     0: xyz
9550    
9551    /xyz/CY
9552      abcxyz
9553    --->abcxyz
9554     +0 ^          x
9555     +0  ^         x
9556     +0   ^        x
9557     +0    ^       x
9558     +1    ^^      y
9559     +2    ^ ^     z
9560     +3    ^  ^
9561     0: xyz
9562    
9563  /^"((?(?=[a])[^"])|b)*"$/C  /^"((?(?=[a])[^"])|b)*"$/C
9564      "ab"      "ab"
# Line 9638  No match Line 9593  No match
9593   0: "ab"   0: "ab"
9594   1:   1:
9595    
 /^X(?5)(a)(?|(b)|(q))(c)(d)(Y)/  
     XYabcdY  
  0: XYabcdY  
  1: a  
  2: b  
  3: c  
  4: d  
  5: Y  
   
9596  /^X(?5)(a)(?|(b)|(q))(c)(d)Y/  /^X(?5)(a)(?|(b)|(q))(c)(d)Y/
9597  Failed: reference to non-existent subpattern at offset 5  Failed: reference to non-existent subpattern at offset 5
9598    
# Line 9659  Failed: reference to non-existent subpat Line 9605  Failed: reference to non-existent subpat
9605   4: d   4: d
9606   5: Y   5: Y
9607    
 /^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  
   
9608  /Xa{2,4}b/  /Xa{2,4}b/
9609      X\P      X\P
9610  Partial match: X  Partial match: X
# Line 9918  Partial match: 123999 Line 9831  Partial match: 123999
9831    
9832  /Z(*F)/  /Z(*F)/
9833      Z\P      Z\P
9834  Partial match: Z  No match
9835      ZA\P      ZA\P
9836  No match  No match
9837    
9838  /Z(?!)/  /Z(?!)/
9839      Z\P      Z\P
9840  Partial match: Z  No match
9841      ZA\P      ZA\P
9842  No match  No match
9843    
9844  / End of testinput2 /  /dog(sbody)?/
9845        dogs\P
9846     0: dog
9847        dogs\P\P
9848    Partial match: dogs
9849    
9850    /dog(sbody)??/
9851        dogs\P
9852     0: dog
9853        dogs\P\P
9854     0: dog
9855    
9856    /dog|dogsbody/
9857        dogs\P
9858     0: dog
9859        dogs\P\P
9860     0: dog
9861    
9862    /dogsbody|dog/
9863        dogs\P
9864     0: dog
9865        dogs\P\P
9866    Partial match: dogs
9867    
9868    /\bthe cat\b/
9869        the cat\P
9870     0: the cat
9871        the cat\P\P
9872    Partial match: the cat
9873    
9874    /abc/
9875       abc\P
9876     0: abc
9877       abc\P\P
9878     0: abc
9879    
9880    /\w+A/P
9881       CDAAAAB
9882     0: CDAAAA
9883    
9884    /\w+A/PU
9885       CDAAAAB
9886     0: CDA
9887    
9888    /abc\K123/
9889        xyzabc123pqr
9890     0: 123
9891        xyzabc12\P
9892    Partial match: abc12
9893        xyzabc12\P\P
9894    Partial match: abc12
9895    
9896    /(?<=abc)123/
9897        xyzabc123pqr
9898     0: 123
9899        xyzabc12\P
9900    Partial match: abc12
9901        xyzabc12\P\P
9902    Partial match: abc12
9903    
9904    /\babc\b/
9905        +++abc+++
9906     0: abc
9907        +++ab\P
9908    Partial match: +ab
9909        +++ab\P\P
9910    Partial match: +ab
9911    
9912    /(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/BZ
9913    ------------------------------------------------------------------
9914            Bra
9915            Recurse
9916            Recurse
9917            Cond
9918            Cond def
9919            CBra 1
9920            <
9921            [^m]
9922            [^>]
9923            >
9924            [^<]
9925            Ket
9926            CBra 2
9927            \w*+
9928            Ket
9929            Ket
9930            Ket
9931            End
9932    ------------------------------------------------------------------
9933    
9934    /(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/BZ
9935    ------------------------------------------------------------------
9936            Bra
9937            Recurse
9938            Recurse
9939            Cond
9940            Cond def
9941            CBra 1
9942            <
9943            [\x00-/:-\xff] (neg)
9944            [^>]
9945            >
9946            [^<]
9947            Ket
9948            CBra 2
9949            \w*+
9950            Ket
9951            Ket
9952            Ket
9953            End
9954    ------------------------------------------------------------------
9955    
9956    /(ab)(x(y)z(cd(*ACCEPT)))pq/BZ
9957    ------------------------------------------------------------------
9958            Bra
9959            CBra 1
9960            ab
9961            Ket
9962            CBra 2
9963            x
9964            CBra 3
9965            y
9966            Ket
9967            z
9968            CBra 4
9969            cd
9970            Close 4
9971            Close 2
9972            *ACCEPT
9973            Ket
9974            Ket
9975            pq
9976            Ket
9977            End
9978    ------------------------------------------------------------------
9979    
9980    /abc\K/+
9981        abcdef
9982     0:
9983     0+ def
9984        abcdef\N\N
9985     0:
9986     0+ def
9987        xyzabcdef\N\N
9988     0:
9989     0+ def
9990        ** Failers
9991    No match
9992        abcdef\N
9993    No match
9994        xyzabcdef\N
9995    No match
9996    
9997    /^(?:(?=abc)|abc\K)/+
9998        abcdef
9999     0:
10000     0+ abcdef
10001        abcdef\N\N
10002     0:
10003     0+ def
10004        ** Failers
10005    No match
10006        abcdef\N
10007    No match
10008    
10009    /a?b?/+
10010        xyz
10011     0:
10012     0+ xyz
10013        xyzabc
10014     0:
10015     0+ xyzabc
10016        xyzabc\N
10017     0: ab
10018     0+ c
10019        xyzabc\N\N
10020     0:
10021     0+ yzabc
10022        xyz\N\N
10023     0:
10024     0+ yz
10025        ** Failers
10026     0:
10027     0+ ** Failers
10028        xyz\N
10029    No match
10030    
10031    /^a?b?/+
10032        xyz
10033     0:
10034     0+ xyz
10035        xyzabc
10036     0:
10037     0+ xyzabc
10038        ** Failers
10039     0:
10040     0+ ** Failers
10041        xyzabc\N
10042    No match
10043        xyzabc\N\N
10044    No match
10045        xyz\N\N
10046    No match
10047        xyz\N
10048    No match
10049    
10050    /^(?<name>a|b\g<name>c)/
10051        aaaa
10052     0: a
10053     1: a
10054        bacxxx
10055     0: bac
10056     1: bac
10057        bbaccxxx
10058     0: bbacc
10059     1: bbacc
10060        bbbacccxx
10061     0: bbbaccc
10062     1: bbbaccc
10063    
10064    /^(?<name>a|b\g'name'c)/
10065        aaaa
10066     0: a
10067     1: a
10068        bacxxx
10069     0: bac
10070     1: bac
10071        bbaccxxx
10072     0: bbacc
10073     1: bbacc
10074        bbbacccxx
10075     0: bbbaccc
10076     1: bbbaccc
10077    
10078    /^(a|b\g<1>c)/
10079        aaaa
10080     0: a
10081     1: a
10082        bacxxx
10083     0: bac
10084     1: bac
10085        bbaccxxx
10086     0: bbacc
10087     1: bbacc
10088        bbbacccxx
10089     0: bbbaccc
10090     1: bbbaccc
10091    
10092    /^(a|b\g'1'c)/
10093        aaaa
10094     0: a
10095     1: a
10096        bacxxx
10097     0: bac
10098     1: bac
10099        bbaccxxx
10100     0: bbacc
10101     1: bbacc
10102        bbbacccxx
10103     0: bbbaccc
10104     1: bbbaccc
10105    
10106    /^(a|b\g'-1'c)/
10107        aaaa
10108     0: a
10109     1: a
10110        bacxxx
10111     0: bac
10112     1: bac
10113        bbaccxxx
10114     0: bbacc
10115     1: bbacc
10116        bbbacccxx
10117     0: bbbaccc
10118     1: bbbaccc
10119    
10120    /(^(a|b\g<-1>c))/
10121        aaaa
10122     0: a
10123     1: a
10124     2: a
10125        bacxxx
10126     0: bac
10127     1: bac
10128     2: bac
10129        bbaccxxx
10130     0: bbacc
10131     1: bbacc
10132     2: bbacc
10133        bbbacccxx
10134     0: bbbaccc
10135     1: bbbaccc
10136     2: bbbaccc
10137    
10138    /(?-i:\g<name>)(?i:(?<name>a))/
10139        XaaX
10140     0: aa
10141     1: a
10142        XAAX
10143     0: AA
10144     1: A
10145    
10146    /(?i:\g<name>)(?-i:(?<name>a))/
10147        XaaX
10148     0: aa
10149     1: a
10150        ** Failers
10151    No match
10152        XAAX
10153    No match
10154    
10155    /(?-i:\g<+1>)(?i:(a))/
10156        XaaX
10157     0: aa
10158     1: a
10159        XAAX
10160     0: AA
10161     1: A
10162    
10163    /(?=(?<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>\})\}))\{/
10164    
10165    /(?<n>a|b|c)\g<n>*/
10166       abc
10167     0: abc
10168     1: a
10169       accccbbb
10170     0: accccbbb
10171     1: a
10172    
10173    /^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/
10174        XYabcdY
10175     0: XYabcdY
10176     1: a
10177     2: b
10178     3: <unset>
10179     4: <unset>
10180     5: c
10181     6: d
10182     7: Y
10183    
10184    /(?<=b(?1)|zzz)(a)/
10185        xbaax
10186     0: a
10187     1: a
10188        xzzzax
10189     0: a
10190     1: a
10191    
10192    /(a)(?<=b\1)/
10193    Failed: lookbehind assertion is not fixed length at offset 10
10194    
10195    /(a)(?<=b+(?1))/
10196    Failed: lookbehind assertion is not fixed length at offset 13
10197    
10198    /(a+)(?<=b(?1))/
10199    Failed: lookbehind assertion is not fixed length at offset 14
10200    
10201    /(a(?<=b(?1)))/
10202    Failed: lookbehind assertion is not fixed length at offset 13
10203    
10204    /(?<=b(?1))xyz/
10205    Failed: reference to non-existent subpattern at offset 8
10206    
10207    /(?<=b(?1))xyz(b+)pqrstuvew/
10208    Failed: lookbehind assertion is not fixed length at offset 26
10209    
10210    /(a|bc)\1/SI
10211    Capturing subpattern count = 1
10212    Max back reference = 1
10213    No options
10214    No first char
10215    No need char
10216    Subject length lower bound = 2
10217    Starting byte set: a b
10218    
10219    /(a|bc)\1{2,3}/SI
10220    Capturing subpattern count = 1
10221    Max back reference = 1
10222    No options
10223    No first char
10224    No need char
10225    Subject length lower bound = 3
10226    Starting byte set: a b
10227    
10228    /(a|bc)(?1)/SI
10229    Capturing subpattern count = 1
10230    No options
10231    No first char
10232    No need char
10233    Subject length lower bound = 2
10234    Starting byte set: a b
10235    
10236    /(a|b\1)(a|b\1)/SI
10237    Capturing subpattern count = 2
10238    Max back reference = 1
10239    No options
10240    No first char
10241    No need char
10242    Subject length lower bound = 2
10243    Starting byte set: a b
10244    
10245    /(a|b\1){2}/SI
10246    Capturing subpattern count = 1
10247    Max back reference = 1
10248    No options
10249    No first char
10250    No need char
10251    Subject length lower bound = 2
10252    Starting byte set: a b
10253    
10254    /(a|bbbb\1)(a|bbbb\1)/SI
10255    Capturing subpattern count = 2
10256    Max back reference = 1
10257    No options
10258    No first char
10259    No need char
10260    Subject length lower bound = 2
10261    Starting byte set: a b
10262    
10263    /(a|bbbb\1){2}/SI
10264    Capturing subpattern count = 1
10265    Max back reference = 1
10266    No options
10267    No first char
10268    No need char
10269    Subject length lower bound = 2
10270    Starting byte set: a b
10271    
10272    /^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
10273    Capturing subpattern count = 1
10274    Options: anchored
10275    No first char
10276    Need char = ':'
10277    Subject length lower bound = 22
10278    No set of starting bytes
10279    
10280    /  (?: [\040\t] |  \(
10281    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10282    \)  )*                          # optional leading comment
10283    (?:    (?:
10284    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10285    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10286    |
10287    " (?:                      # opening quote...
10288    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
10289    |                     #    or
10290    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10291    )* "  # closing quote
10292    )                    # initial word
10293    (?:  (?: [\040\t] |  \(
10294    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10295    \)  )*  \.  (?: [\040\t] |  \(
10296    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10297    \)  )*   (?:
10298    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10299    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10300    |
10301    " (?:                      # opening quote...
10302    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
10303    |                     #    or
10304    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10305    )* "  # closing quote
10306    )  )* # further okay, if led by a period
10307    (?: [\040\t] |  \(
10308    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10309    \)  )*  @  (?: [\040\t] |  \(
10310    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10311    \)  )*    (?:
10312    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10313    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10314    |   \[                         # [
10315    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10316    \]                        #           ]
10317    )                           # initial subdomain
10318    (?:                                  #
10319    (?: [\040\t] |  \(
10320    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10321    \)  )*  \.                        # if led by a period...
10322    (?: [\040\t] |  \(
10323    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10324    \)  )*   (?:
10325    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10326    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10327    |   \[                         # [
10328    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10329    \]                        #           ]
10330    )                     #   ...further okay
10331    )*
10332    # address
10333    |                     #  or
10334    (?:
10335    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10336    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10337    |
10338    " (?:                      # opening quote...
10339    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
10340    |                     #    or
10341    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10342    )* "  # closing quote
10343    )             # one word, optionally followed by....
10344    (?:
10345    [^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037]  |  # atom and space parts, or...
10346    \(
10347    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10348    \)       |  # comments, or...
10349    
10350    " (?:                      # opening quote...
10351    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
10352    |                     #    or
10353    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10354    )* "  # closing quote
10355    # quoted strings
10356    )*
10357    <  (?: [\040\t] |  \(
10358    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10359    \)  )*                     # leading <
10360    (?:  @  (?: [\040\t] |  \(
10361    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10362    \)  )*    (?:
10363    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10364    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10365    |   \[                         # [
10366    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10367    \]                        #           ]
10368    )                           # initial subdomain
10369    (?:                                  #
10370    (?: [\040\t] |  \(
10371    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10372    \)  )*  \.                        # if led by a period...
10373    (?: [\040\t] |  \(
10374    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10375    \)  )*   (?:
10376    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10377    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10378    |   \[                         # [
10379    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10380    \]                        #           ]
10381    )                     #   ...further okay
10382    )*
10383    
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    \)  )*  @  (?: [\040\t] |  \(
10389    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10390    \)  )*    (?:
10391    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10392    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10393    |   \[                         # [
10394    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10395    \]                        #           ]
10396    )                           # initial subdomain
10397    (?:                                  #
10398    (?: [\040\t] |  \(
10399    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10400    \)  )*  \.                        # if led by a period...
10401    (?: [\040\t] |  \(
10402    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10403    \)  )*   (?:
10404    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10405    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10406    |   \[                         # [
10407    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10408    \]                        #           ]
10409    )                     #   ...further okay
10410    )*
10411    )* # further okay, if led by comma
10412    :                                # closing colon
10413    (?: [\040\t] |  \(
10414    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10415    \)  )*  )? #       optional route
10416    (?:
10417    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10418    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10419    |
10420    " (?:                      # opening quote...
10421    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
10422    |                     #    or
10423    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10424    )* "  # closing quote
10425    )                    # initial word
10426    (?:  (?: [\040\t] |  \(
10427    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10428    \)  )*  \.  (?: [\040\t] |  \(
10429    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10430    \)  )*   (?:
10431    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10432    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10433    |
10434    " (?:                      # opening quote...
10435    [^\\\x80-\xff\n\015"]                #   Anything except backslash and quote
10436    |                     #    or
10437    \\ [^\x80-\xff]           #   Escaped something (something != CR)
10438    )* "  # closing quote
10439    )  )* # further okay, if led by a period
10440    (?: [\040\t] |  \(
10441    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10442    \)  )*  @  (?: [\040\t] |  \(
10443    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10444    \)  )*    (?:
10445    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10446    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10447    |   \[                         # [
10448    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10449    \]                        #           ]
10450    )                           # initial subdomain
10451    (?:                                  #
10452    (?: [\040\t] |  \(
10453    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10454    \)  )*  \.                        # if led by a period...
10455    (?: [\040\t] |  \(
10456    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10457    \)  )*   (?:
10458    [^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+    # some number of atom characters...
10459    (?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom
10460    |   \[                         # [
10461    (?: [^\\\x80-\xff\n\015\[\]] |  \\ [^\x80-\xff]  )*    #    stuff
10462    \]                        #           ]
10463    )                     #   ...further okay
10464    )*
10465    #       address spec
10466    (?: [\040\t] |  \(
10467    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10468    \)  )*  > #                  trailing >
10469    # name and address
10470    )  (?: [\040\t] |  \(
10471    (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  |  \( (?:  [^\\\x80-\xff\n\015()]  |  \\ [^\x80-\xff]  )* \)  )*
10472    \)  )*                       # optional trailing comment
10473    /xSI
10474    Capturing subpattern count = 0
10475    Contains explicit CR or LF match
10476    Options: extended
10477    No first char
10478    No need char
10479    Subject length lower bound = 3
10480    Starting byte set: \x09 \x20 ! " # $ % & ' ( * + - / 0 1 2 3 4 5 6 7 8
10481      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
10482      f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f
10483    
10484    /<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
10485    Capturing subpattern count = 11
10486    Options: caseless dotall
10487    First char = '<'
10488    Need char = '>'
10489    Subject length lower bound = 47
10490    No set of starting bytes
10491    
10492    "(?>.*/)foo"SI
10493    Capturing subpattern count = 0
10494    No options
10495    First char at start or follows newline
10496    Need char = 'o'
10497    Subject length lower bound = 4
10498    No set of starting bytes
10499    
10500    /(?(?=[^a-z]+[a-z])  \d{2}-[a-z]{3}-\d{2}  |  \d{2}-\d{2}-\d{2} ) /xSI
10501    Capturing subpattern count = 0
10502    Options: extended
10503    No first char
10504    Need char = '-'
10505    Subject length lower bound = 8
10506    No set of starting bytes
10507    
10508    /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/iSI
10509    Capturing subpattern count = 1
10510    Options: caseless
10511    No first char
10512    No need char
10513    Subject length lower bound = 1
10514    Starting byte set: A B C a b c
10515    
10516    /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/SI
10517    Capturing subpattern count = 0
10518    No options
10519    No first char
10520    Need char = 'b'
10521    Subject length lower bound = 41
10522    Starting byte set: c d
10523    
10524    /<a[\s]+href[\s]*=[\s]*          # find <a href=
10525     ([\"\'])?                       # find single or double quote
10526     (?(1) (.*?)\1 | ([^\s]+))       # if quote found, match up to next matching
10527                                     # quote, otherwise match up to next space
10528    /isxSI
10529    Capturing subpattern count = 3
10530    Max back reference = 1
10531    Options: caseless extended dotall
10532    First char = '<'
10533    Need char = '='
10534    Subject length lower bound = 9
10535    No set of starting bytes
10536    
10537    /^(?!:)                       # colon disallowed at start
10538      (?:                         # start of item
10539        (?: [0-9a-f]{1,4} |       # 1-4 hex digits or
10540        (?(1)0 | () ) )           # if null previously matched, fail; else null
10541        :                         # followed by colon
10542      ){1,7}                      # end item; 1-7 of them required
10543      [0-9a-f]{1,4} $             # final hex number at end of string
10544      (?(1)|.)                    # check that there was an empty component
10545      /xiIS
10546    Capturing subpattern count = 1
10547    Options: anchored caseless extended
10548    No first char
10549    Need char = ':'
10550    Subject length lower bound = 2
10551    No set of starting bytes
10552    
10553    /(?|(?<a>A)|(?<a>B))/I
10554    Capturing subpattern count = 1
10555    Named capturing subpatterns:
10556      a   1
10557      a   1
10558    No options
10559    No first char
10560    No need char
10561        AB\Ca
10562     0: A
10563     1: A
10564      C A (1) a
10565        BA\Ca
10566     0: B
10567     1: B
10568      C B (1) a
10569    
10570    /(?|(?<a>A)|(?<b>B))/
10571    Failed: different names for subpatterns of the same number are not allowed at offset 15
10572    
10573    /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |
10574        b(?<quote> (?<apostrophe>')|(?<realquote>")) )
10575        (?('quote')[a-z]+|[0-9]+)/JIx
10576    Capturing subpattern count = 6
10577    Named capturing subpatterns:
10578      apostrophe   2
10579      apostrophe   5
10580      quote        1
10581      quote        4
10582      realquote    3
10583      realquote    6
10584    Options: extended dupnames
10585    No first char
10586    No need char
10587        a"aaaaa
10588     0: a"aaaaa
10589     1: "
10590     2: <unset>
10591     3: "
10592        b"aaaaa
10593     0: b"aaaaa
10594     1: <unset>
10595     2: <unset>
10596     3: <unset>
10597     4: "
10598     5: <unset>
10599     6: "
10600        ** Failers
10601    No match
10602        b"11111
10603    No match
10604        a"11111
10605    No match
10606    
10607    /^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/JDZx
10608    ------------------------------------------------------------------
10609            Bra
10610            ^
10611            Bra
10612            CBra 1
10613            a
10614            Ket
10615            CBra 2
10616            b
10617            Ket
10618            CBra 3
10619            c
10620            Ket
10621            CBra 4
10622            d
10623            Ket
10624            Alt
10625            CBra 1
10626            e
10627            Ket
10628            Ket
10629            Cond
10630          4 Cond nref
10631            X
10632            Alt
10633            Y
10634            Ket
10635            Ket
10636            End
10637    ------------------------------------------------------------------
10638    Capturing subpattern count = 4
10639    Named capturing subpatterns:
10640      D   4
10641      D   1
10642    Options: anchored extended dupnames
10643    No first char
10644    No need char
10645        abcdX
10646     0: abcdX
10647     1: a
10648     2: b
10649     3: c
10650     4: d
10651        eX
10652     0: eX
10653     1: e
10654        ** Failers
10655    No match
10656        abcdY
10657    No match
10658        ey
10659    No match
10660    
10661    /(?<A>a) (b)(c)  (?<A>d  (?(R&A)$ | (?4)) )/JDZx
10662    ------------------------------------------------------------------
10663            Bra
10664            CBra 1
10665            a
10666            Ket
10667            CBra 2
10668            b
10669            Ket
10670            CBra 3
10671            c
10672            Ket
10673            CBra 4
10674            d
10675            Cond
10676            Cond nrecurse 1
10677            $
10678            Alt
10679            Recurse
10680            Ket
10681            Ket
10682            Ket
10683            End
10684    ------------------------------------------------------------------
10685    Capturing subpattern count = 4
10686    Named capturing subpatterns:
10687      A   1
10688      A   4
10689    Options: extended dupnames
10690    First char = 'a'
10691    Need char = 'd'
10692        abcdd
10693     0: abcdd
10694     1: a
10695     2: b
10696     3: c
10697     4: dd
10698        ** Failers
10699    No match
10700        abcdde
10701    No match
10702    
10703    /abcd*/
10704        xxxxabcd\P
10705     0: abcd
10706        xxxxabcd\P\P
10707    Partial match: abcd
10708    
10709    /abcd*/i
10710        xxxxabcd\P
10711     0: abcd
10712        xxxxabcd\P\P
10713    Partial match: abcd
10714        XXXXABCD\P
10715     0: ABCD
10716        XXXXABCD\P\P
10717    Partial match: ABCD
10718    
10719    /abc\d*/
10720        xxxxabc1\P
10721     0: abc1
10722        xxxxabc1\P\P
10723    Partial match: abc1
10724    
10725    /(a)bc\1*/
10726        xxxxabca\P
10727     0: abca
10728     1: a
10729        xxxxabca\P\P
10730    Partial match: abca
10731    
10732    /abc[de]*/
10733        xxxxabcde\P
10734     0: abcde
10735        xxxxabcde\P\P
10736    Partial match: abcde
10737    
10738    /-- This is not in the Perl >= 5.10 test because Perl seems currently to be
10739        broken and not behaving as specified in that it *does* bumpalong after
10740        hitting (*COMMIT). --/
10741    
10742    /(?1)(A(*COMMIT)|B)D/
10743        ABD
10744     0: ABD
10745     1: B
10746        XABD
10747     0: ABD
10748     1: B
10749        BAD
10750     0: BAD
10751     1: A
10752        ABXABD
10753     0: ABD
10754     1: B
10755        ** Failers
10756    No match
10757        ABX
10758    No match
10759        BAXBAD
10760    No match
10761    
10762    /(\3)(\1)(a)/<JS>
10763        cat
10764     0: a
10765     1:
10766     2:
10767     3: a
10768    
10769    /(\3)(\1)(a)/SI<JS>
10770    Capturing subpattern count = 3
10771    Max back reference = 3
10772    Options:
10773    No first char
10774    Need char = 'a'
10775    Subject length lower bound = 1
10776    No set of starting bytes
10777        cat
10778     0: a
10779     1:
10780     2:
10781     3: a
10782    
10783    /(\3)(\1)(a)/SI
10784    Capturing subpattern count = 3
10785    Max back reference = 3
10786    No options
10787    No first char
10788    Need char = 'a'
10789    Subject length lower bound = 3
10790    No set of starting bytes
10791        cat
10792    No match
10793    
10794    /i(?(DEFINE)(?<s>a))/SI
10795    Capturing subpattern count = 1
10796    Named capturing subpatterns:
10797      s   1
10798    No options
10799    First char = 'i'
10800    No need char
10801    Subject length lower bound = 1
10802    No set of starting bytes
10803        i
10804     0: i
10805    
10806    /()i(?(1)a)/SI
10807    Capturing subpattern count = 1
10808    No options
10809    No first char
10810    Need char = 'i'
10811    Subject length lower bound = 1
10812    Starting byte set: i
10813        ia
10814     0: ia
10815     1:
10816    
10817    /(?i)a(?-i)b|c/BZ
10818    ------------------------------------------------------------------
10819            Bra
10820         /i a
10821            b
10822            Alt
10823            c
10824            Ket
10825            End
10826    ------------------------------------------------------------------
10827        XabX
10828     0: ab
10829        XAbX
10830     0: Ab
10831        CcC
10832     0: c
10833        ** Failers
10834    No match
10835        XABX
10836    No match
10837    
10838    /(?i)a(?s)b|c/BZ
10839    ------------------------------------------------------------------
10840            Bra
10841         /i ab
10842            Alt
10843         /i c
10844            Ket
10845            End
10846    ------------------------------------------------------------------
10847    
10848    /(?i)a(?s-i)b|c/BZ
10849    ------------------------------------------------------------------
10850            Bra
10851         /i a
10852            b
10853            Alt
10854            c
10855            Ket
10856            End
10857    ------------------------------------------------------------------
10858    
10859    /^(ab(c\1)d|x){2}$/BZ
10860    ------------------------------------------------------------------
10861            Bra
10862            ^
10863            Once
10864            CBra 1
10865            ab
10866            CBra 2
10867            c
10868            \1
10869            Ket
10870            d
10871            Alt
10872            x
10873            Ket
10874            Ket
10875            Once
10876            CBra 1
10877            ab
10878            CBra 2
10879            c
10880            \1
10881            Ket
10882            d
10883            Alt
10884            x
10885            Ket
10886            Ket
10887            $
10888            Ket
10889            End
10890    ------------------------------------------------------------------
10891        xabcxd
10892     0: xabcxd
10893     1: abcxd
10894     2: cx
10895    
10896    /^(?&t)*+(?(DEFINE)(?<t>.))$/BZ
10897    ------------------------------------------------------------------
10898            Bra
10899            ^
10900            Braposzero
10901            SBraPos
10902            Recurse
10903            KetRpos
10904            Cond
10905            Cond def
10906            CBra 1
10907            Any
10908            Ket
10909            Ket
10910            $
10911            Ket
10912            End
10913    ------------------------------------------------------------------
10914    
10915    /^(?&t)*(?(DEFINE)(?<t>.))$/BZ
10916    ------------------------------------------------------------------
10917            Bra
10918            ^
10919            Brazero
10920            Once
10921            Recurse
10922            KetRmax
10923            Cond
10924            Cond def
10925            CBra 1
10926            Any
10927            Ket
10928            Ket
10929            $
10930            Ket
10931            End
10932    ------------------------------------------------------------------
10933    
10934    / -- The first four of these are not in the Perl >= 5.10 test because Perl
10935         documents that the use of \K in assertions is "not well defined". The
10936         last is here because Perl gives the match as "b" rather than "ab". I
10937         believe this to be a Perl bug. --/
10938    
10939    /(?=a\Kb)ab/
10940        ab
10941     0: b
10942    
10943    /(?!a\Kb)ac/
10944        ac
10945     0: ac
10946    
10947    /^abc(?<=b\Kc)d/
10948        abcd
10949     0: cd
10950    
10951    /^abc(?<!b\Kq)d/
10952        abcd
10953     0: abcd
10954    
10955    /(?>a\Kb)z|(ab)/
10956        ab
10957     0: ab
10958     1: ab
10959    
10960    /----------------------/
10961    
10962    /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
10963    Failed: recursive call could loop indefinitely at offset 31
10964    
10965    /abc(*MARK:)pqr/
10966    Failed: (*MARK) must have an argument at offset 10
10967    
10968    /abc(*:)pqr/
10969    Failed: (*MARK) must have an argument at offset 6
10970    
10971    /abc(*FAIL:123)xyz/
10972    Failed: an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT) at offset 13
10973    
10974    /--- This should, and does, fail. In Perl, it does not, which I think is a
10975         bug because replacing the B in the pattern by (B|D) does make it fail. ---/
10976    
10977    /A(*COMMIT)B/+K
10978        ACABX
10979    No match
10980    
10981    /--- These should be different, but in Perl 5.11 are not, which I think
10982         is a bug in Perl. ---/
10983    
10984    /A(*THEN)B|A(*THEN)C/K
10985        AC
10986     0: AC
10987    
10988    /A(*PRUNE)B|A(*PRUNE)C/K
10989        AC
10990    No match
10991    
10992    /--- A whole lot of tests of verbs with arguments are here rather than in test
10993         11 because Perl doesn't seem to follow its specification entirely
10994         correctly. ---/
10995    
10996    /--- Perl 5.11 sets $REGERROR on the AC failure case here; PCRE does not. It is
10997         not clear how Perl defines "involved in the failure of the match". ---/
10998    
10999    /^(A(*THEN:A)B|C(*THEN:B)D)/K
11000        AB
11001     0: AB
11002     1: AB
11003        CD
11004     0: CD
11005     1: CD
11006        ** Failers
11007    No match
11008        AC
11009    No match
11010        CB
11011    No match, mark = B
11012    
11013    /--- Check the use of names for success and failure. PCRE doesn't show these
11014    names for success, though Perl does, contrary to its spec. ---/
11015    
11016    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
11017        AB
11018     0: AB
11019     1: AB
11020        CD
11021     0: CD
11022     1: CD
11023        ** Failers
11024    No match
11025        AC
11026    No match, mark = A
11027        CB
11028    No match, mark = B
11029    
11030    /--- An empty name does not pass back an empty string. It is the same as if no
11031    name were given. ---/
11032    
11033    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/K
11034        AB
11035     0: AB
11036     1: AB
11037        CD
11038     0: CD
11039     1: CD
11040    
11041    /--- PRUNE goes to next bumpalong; COMMIT does not. ---/
11042    
11043    /A(*PRUNE:A)B/K
11044        ACAB
11045     0: AB
11046    
11047    /(*MARK:A)(*PRUNE:B)(C|X)/KS
11048        C
11049     0: C
11050     1: C
11051    MK: A
11052        D
11053    No match
11054    
11055    /(*MARK:A)(*PRUNE:B)(C|X)/KSS
11056        C
11057     0: C
11058     1: C
11059    MK: A
11060        D
11061    No match, mark = B
11062    
11063    /(*MARK:A)(*THEN:B)(C|X)/KS
11064        C
11065     0: C
11066     1: C
11067    MK: A
11068        D
11069    No match
11070    
11071    /(*MARK:A)(*THEN:B)(C|X)/KSS
11072        C
11073     0: C
11074     1: C
11075    MK: A
11076        D
11077    No match, mark = B
11078    
11079    /--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/
11080    
11081    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK
11082        AAAC
11083    No match
11084    
11085    /--- Same --/
11086    
11087    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK
11088        AAAC
11089    No match
11090    
11091    /--- This should fail; the SKIP advances by one, but when we get to AC, the
11092         PRUNE kills it. ---/
11093    
11094    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
11095        AAAC
11096    No match
11097    
11098    /A(*:A)A+(*SKIP)(B|Z) | AC/xK
11099        AAAC
11100    No match
11101    
11102    /--- This should fail, as a null name is the same as no name ---/
11103    
11104    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK
11105        AAAC
11106    No match
11107    
11108    /--- This fails in PCRE, and I think that is in accordance with Perl's
11109         documentation, though in Perl it succeeds. ---/
11110    
11111    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK
11112        AAAC
11113    No match
11114    
11115    /--- Mark names can be duplicated ---/
11116    
11117    /A(*:A)B|X(*:A)Y/K
11118        AABC
11119     0: AB
11120    MK: A
11121        XXYZ
11122     0: XY
11123    MK: A
11124    
11125    /^A(*:A)B|^X(*:A)Y/K
11126        ** Failers
11127    No match
11128        XAQQ
11129    No match, mark = A
11130    
11131    /--- A check on what happens after hitting a mark and them bumping along to
11132    something that does not even start. Perl reports tags after the failures here,
11133    though it does not when the individual letters are made into something
11134    more complicated. ---/
11135    
11136    /A(*:A)B|XX(*:B)Y/K
11137        AABC
11138     0: AB
11139    MK: A
11140        XXYZ
11141     0: XXY
11142    MK: B
11143        ** Failers
11144    No match
11145        XAQQ
11146    No match
11147        XAQQXZZ
11148    No match
11149        AXQQQ
11150    No match
11151        AXXQQQ
11152    No match
11153    
11154    /--- COMMIT at the start of a pattern should be the same as an anchor. Perl
11155    optimizations defeat this. So does the PCRE optimization unless we disable it
11156    with \Y. ---/
11157    
11158    /(*COMMIT)ABC/
11159        ABCDEFG
11160     0: ABC
11161        ** Failers
11162    No match
11163        DEFGABC\Y
11164    No match
11165    
11166    /--- Repeat some tests with added studying. ---/
11167    
11168    /A(*COMMIT)B/+KS
11169        ACABX
11170    No match
11171    
11172    /A(*THEN)B|A(*THEN)C/KS
11173        AC
11174     0: AC
11175    
11176    /A(*PRUNE)B|A(*PRUNE)C/KS
11177        AC
11178    No match
11179    
11180    /^(A(*THEN:A)B|C(*THEN:B)D)/KS
11181        AB
11182     0: AB
11183     1: AB
11184        CD
11185     0: CD
11186     1: CD
11187        ** Failers
11188    No match
11189        AC
11190    No match
11191        CB
11192    No match, mark = B
11193    
11194    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/KS
11195        AB
11196     0: AB
11197     1: AB
11198        CD
11199     0: CD
11200     1: CD
11201        ** Failers
11202    No match
11203        AC
11204    No match, mark = A
11205        CB
11206    No match, mark = B
11207    
11208    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/KS
11209        AB
11210     0: AB
11211     1: AB
11212        CD
11213     0: CD
11214     1: CD
11215    
11216    /A(*PRUNE:A)B/KS
11217        ACAB
11218     0: AB
11219    
11220    /(*MARK:A)(*PRUNE:B)(C|X)/KS
11221        C
11222     0: C
11223     1: C
11224    MK: A
11225        D
11226    No match
11227    
11228    /(*MARK:A)(*THEN:B)(C|X)/KS
11229        C
11230     0: C
11231     1: C
11232    MK: A
11233        D
11234    No match
11235    
11236    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xKS
11237        AAAC
11238    No match
11239    
11240    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xKS
11241        AAAC
11242    No match
11243    
11244    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xKS
11245        AAAC
11246    No match
11247    
11248    /A(*:A)A+(*SKIP)(B|Z) | AC/xKS
11249        AAAC
11250    No match
11251    
11252    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xKS
11253        AAAC
11254    No match
11255    
11256    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xKS
11257        AAAC
11258    No match
11259    
11260    /A(*:A)B|XX(*:B)Y/KS
11261        AABC
11262     0: AB
11263    MK: A
11264        XXYZ
11265     0: XXY
11266    MK: B
11267        ** Failers
11268    No match
11269        XAQQ
11270    No match
11271        XAQQXZZ
11272    No match
11273        AXQQQ
11274    No match
11275        AXXQQQ
11276    No match
11277    
11278    /(*COMMIT)ABC/
11279        ABCDEFG
11280     0: ABC
11281        ** Failers
11282    No match
11283        DEFGABC\Y
11284    No match
11285    
11286    /^(ab (c+(*THEN)cd) | xyz)/x
11287        abcccd
11288    No match
11289    
11290    /^(ab (c+(*PRUNE)cd) | xyz)/x
11291        abcccd
11292    No match
11293    
11294    /^(ab (c+(*FAIL)cd) | xyz)/x
11295        abcccd
11296    No match
11297    
11298    /--- Perl 5.11 gets some of these wrong ---/
11299    
11300    /(?>.(*ACCEPT))*?5/
11301        abcde
11302     0: a
11303    
11304    /(.(*ACCEPT))*?5/
11305        abcde
11306     0: a
11307     1: a
11308    
11309    /(.(*ACCEPT))5/
11310        abcde
11311     0: a
11312     1: a
11313    
11314    /(.(*ACCEPT))*5/
11315        abcde
11316     0: a
11317     1: a
11318    
11319    /A\NB./BZ
11320    ------------------------------------------------------------------
11321            Bra
11322            A
11323            Any
11324            B
11325            Any
11326            Ket
11327            End
11328    ------------------------------------------------------------------
11329        ACBD
11330     0: ACBD
11331        *** Failers
11332    No match
11333        A\nB
11334    No match
11335        ACB\n
11336    No match
11337    
11338    /A\NB./sBZ
11339    ------------------------------------------------------------------
11340            Bra
11341            A
11342            Any
11343            B
11344            AllAny
11345            Ket
11346            End
11347    ------------------------------------------------------------------
11348        ACBD
11349     0: ACBD
11350        ACB\n
11351     0: ACB\x0a
11352        *** Failers
11353    No match
11354        A\nB
11355    No match
11356    
11357    /A\NB/<crlf>
11358        A\nB
11359     0: A\x0aB
11360        A\rB
11361     0: A\x0dB
11362        ** Failers
11363    No match
11364        A\r\nB
11365    No match
11366    
11367    /\R+b/BZ
11368    ------------------------------------------------------------------
11369            Bra
11370            \R++
11371            b
11372            Ket
11373            End
11374    ------------------------------------------------------------------
11375    
11376    /\R+\n/BZ
11377    ------------------------------------------------------------------
11378            Bra
11379            \R+
11380            \x0a
11381            Ket
11382            End
11383    ------------------------------------------------------------------
11384    
11385    /\R+\d/BZ
11386    ------------------------------------------------------------------
11387            Bra
11388            \R++
11389            \d
11390            Ket
11391            End
11392    ------------------------------------------------------------------
11393    
11394    /\d*\R/BZ
11395    ------------------------------------------------------------------
11396            Bra
11397            \d*+
11398            \R
11399            Ket
11400            End
11401    ------------------------------------------------------------------
11402    
11403    /\s*\R/BZ
11404    ------------------------------------------------------------------
11405            Bra
11406            \s*+
11407            \R
11408            Ket
11409            End
11410    ------------------------------------------------------------------
11411    
11412    /-- Perl treats this one differently, not failing the second string. I believe
11413        that is a bug in Perl. --/
11414    
11415    /^((abc|abcx)(*THEN)y|abcd)/
11416        abcd
11417     0: abcd
11418     1: abcd
11419        *** Failers
11420    No match
11421        abcxy
11422    No match
11423    
11424    /(?<=abc)def/
11425        abc\P\P
11426    Partial match: abc
11427    
11428    /abc$/
11429        abc
11430     0: abc
11431        abc\P
11432     0: abc
11433        abc\P\P
11434    Partial match: abc
11435    
11436    /abc$/m
11437        abc
11438     0: abc
11439        abc\n
11440     0: abc
11441        abc\P\P
11442    Partial match: abc
11443        abc\n\P\P
11444     0: abc
11445        abc\P
11446     0: abc
11447        abc\n\P
11448     0: abc
11449    
11450    /abc\z/
11451        abc
11452     0: abc
11453        abc\P
11454     0: abc
11455        abc\P\P
11456    Partial match: abc
11457    
11458    /abc\Z/
11459        abc
11460     0: abc
11461        abc\P
11462     0: abc
11463        abc\P\P
11464    Partial match: abc
11465    
11466    /abc\b/
11467        abc
11468     0: abc
11469        abc\P
11470     0: abc
11471        abc\P\P
11472    Partial match: abc
11473    
11474    /abc\B/
11475        abc
11476    No match
11477        abc\P
11478    Partial match: abc
11479        abc\P\P
11480    Partial match: abc
11481    
11482    /.+/
11483        abc\>0
11484     0: abc
11485        abc\>1
11486     0: bc
11487        abc\>2
11488     0: c
11489        abc\>3
11490    No match
11491        abc\>4
11492    Error -24 (bad offset value)
11493        abc\>-4
11494    Error -24 (bad offset value)
11495    
11496    /^\cģ/
11497    Failed: \c must be followed by an ASCII character at offset 3
11498    
11499    /(?P<abn>(?P=abn)xxx)/BZ
11500    ------------------------------------------------------------------
11501            Bra
11502            Once
11503            CBra 1
11504            \1
11505            xxx
11506            Ket
11507            Ket
11508            Ket
11509            End
11510    ------------------------------------------------------------------
11511    
11512    /(a\1z)/BZ
11513    ------------------------------------------------------------------
11514            Bra
11515            Once
11516            CBra 1
11517            a
11518            \1
11519            z
11520            Ket
11521            Ket
11522            Ket
11523            End
11524    ------------------------------------------------------------------
11525    
11526    /(?P<abn>(?P=abn)(?<badstufxxx)/BZ
11527    Failed: syntax error in subpattern name (missing terminator) at offset 29
11528    
11529    /(?P<abn>(?P=axn)xxx)/BZ
11530    Failed: reference to non-existent subpattern at offset 15
11531    
11532    /(?P<abn>(?P=axn)xxx)(?<axn>yy)/BZ
11533    ------------------------------------------------------------------
11534            Bra
11535            CBra 1
11536            \2
11537            xxx
11538            Ket
11539            CBra 2
11540            yy
11541            Ket
11542            Ket
11543            End
11544    ------------------------------------------------------------------
11545    
11546    /-- These tests are here because Perl gets the first one wrong. --/
11547    
11548    /(\R*)(.)/s
11549        \r\n
11550     0: \x0d
11551     1:
11552     2: \x0d
11553        \r\r\n\n\r
11554     0: \x0d\x0d\x0a\x0a\x0d
11555     1: \x0d\x0d\x0a\x0a
11556     2: \x0d
11557        \r\r\n\n\r\n
11558     0: \x0d\x0d\x0a\x0a\x0d
11559     1: \x0d\x0d\x0a\x0a
11560     2: \x0d
11561    
11562    /(\R)*(.)/s
11563        \r\n
11564     0: \x0d
11565     1: <unset>
11566     2: \x0d
11567        \r\r\n\n\r
11568     0: \x0d\x0d\x0a\x0a\x0d
11569     1: \x0a
11570     2: \x0d
11571        \r\r\n\n\r\n
11572     0: \x0d\x0d\x0a\x0a\x0d
11573     1: \x0a
11574     2: \x0d
11575    
11576    /((?>\r\n|\n|\x0b|\f|\r|\x85)*)(.)/s
11577        \r\n
11578     0: \x0d
11579     1:
11580     2: \x0d
11581        \r\r\n\n\r
11582     0: \x0d\x0d\x0a\x0a\x0d
11583     1: \x0d\x0d\x0a\x0a
11584     2: \x0d
11585        \r\r\n\n\r\n
11586     0: \x0d\x0d\x0a\x0a\x0d
11587     1: \x0d\x0d\x0a\x0a
11588     2: \x0d
11589    
11590    /-- --/
11591    
11592    /^abc$/BZ
11593    ------------------------------------------------------------------
11594            Bra
11595            ^
11596            abc
11597            $
11598            Ket
11599            End
11600    ------------------------------------------------------------------
11601    
11602    /^abc$/BZm
11603    ------------------------------------------------------------------
11604            Bra
11605         /m ^
11606            abc
11607         /m $
11608            Ket
11609            End
11610    ------------------------------------------------------------------
11611    
11612    /^(a)*+(\w)/S
11613        aaaaX
11614     0: aaaaX
11615     1: a
11616     2: X
11617        ** Failers
11618    No match
11619        aaaa
11620    No match
11621    
11622    /^(?:a)*+(\w)/S
11623        aaaaX
11624     0: aaaaX
11625     1: X
11626        ** Failers
11627    No match
11628        aaaa
11629    No match
11630    
11631    /(a)++1234/SDZ
11632    ------------------------------------------------------------------
11633            Bra
11634            CBraPos 1
11635            a
11636            KetRpos
11637            1234
11638            Ket
11639            End
11640    ------------------------------------------------------------------
11641    Capturing subpattern count = 1
11642    No options
11643    First char = 'a'
11644    Need char = '4'
11645    Subject length lower bound = 5
11646    No set of starting bytes
11647    
11648    /([abc])++1234/SI
11649    Capturing subpattern count = 1
11650    No options
11651    No first char
11652    Need char = '4'
11653    Subject length lower bound = 5
11654    Starting byte set: a b c
11655    
11656    /(?<=(abc)+)X/
11657    Failed: lookbehind assertion is not fixed length at offset 10
11658    
11659    /(^ab)/I
11660    Capturing subpattern count = 1
11661    Options: anchored
11662    No first char
11663    No need char
11664    
11665    /(^ab)++/I
11666    Capturing subpattern count = 1
11667    Options: anchored
11668    No first char
11669    No need char
11670    
11671    /(^ab|^)+/I
11672    Capturing subpattern count = 1
11673    Options: anchored
11674    No first char
11675    No need char
11676    
11677    /(^ab|^)++/I
11678    Capturing subpattern count = 1
11679    Options: anchored
11680    No first char
11681    No need char
11682    
11683    /(?:^ab)/I
11684    Capturing subpattern count = 0
11685    Options: anchored
11686    No first char
11687    No need char
11688    
11689    /(?:^ab)++/I
11690    Capturing subpattern count = 0
11691    Options: anchored
11692    No first char
11693    No need char
11694    
11695    /(?:^ab|^)+/I
11696    Capturing subpattern count = 0
11697    Options: anchored
11698    No first char
11699    No need char
11700    
11701    /(?:^ab|^)++/I
11702    Capturing subpattern count = 0
11703    Options: anchored
11704    No first char
11705    No need char
11706    
11707    /(.*ab)/I
11708    Capturing subpattern count = 1
11709    No options
11710    First char at start or follows newline
11711    Need char = 'b'
11712    
11713    /(.*ab)++/I
11714    Capturing subpattern count = 1
11715    No options
11716    First char at start or follows newline
11717    Need char = 'b'
11718    
11719    /(.*ab|.*)+/I
11720    Capturing subpattern count = 1
11721    No options
11722    First char at start or follows newline
11723    No need char
11724    
11725    /(.*ab|.*)++/I
11726    Capturing subpattern count = 1
11727    No options
11728    First char at start or follows newline
11729    No need char
11730    
11731    /(?:.*ab)/I
11732    Capturing subpattern count = 0
11733    No options
11734    First char at start or follows newline
11735    Need char = 'b'
11736    
11737    /(?:.*ab)++/I
11738    Capturing subpattern count = 0
11739    No options
11740    First char at start or follows newline
11741    Need char = 'b'
11742    
11743    /(?:.*ab|.*)+/I
11744    Capturing subpattern count = 0
11745    No options
11746    First char at start or follows newline
11747    No need char
11748    
11749    /(?:.*ab|.*)++/I
11750    Capturing subpattern count = 0
11751    No options
11752    First char at start or follows newline
11753    No need char
11754    
11755    /(?=a)[bcd]/I
11756    Capturing subpattern count = 0
11757    No options
11758    First char = 'a'
11759    No need char
11760    
11761    /((?=a))[bcd]/I
11762    Capturing subpattern count = 1
11763    No options
11764    First char = 'a'
11765    No need char
11766    
11767    /((?=a))+[bcd]/I
11768    Capturing subpattern count = 1
11769    No options
11770    First char = 'a'
11771    No need char
11772    
11773    /((?=a))++[bcd]/I
11774    Capturing subpattern count = 1
11775    No options
11776    First char = 'a'
11777    No need char
11778    
11779    /(?=a+)[bcd]/iI
11780    Capturing subpattern count = 0
11781    Options: caseless
11782    First char = 'a' (caseless)
11783    No need char
11784    
11785    /(?=a+?)[bcd]/iI
11786    Capturing subpattern count = 0
11787    Options: caseless
11788    First char = 'a' (caseless)
11789    No need char
11790    
11791    /(?=a++)[bcd]/iI
11792    Capturing subpattern count = 0
11793    Options: caseless
11794    First char = 'a' (caseless)
11795    No need char
11796    
11797    /(?=a{3})[bcd]/iI
11798    Capturing subpattern count = 0
11799    Options: caseless
11800    First char = 'a' (caseless)
11801    Need char = 'a' (caseless)
11802    
11803    /(abc)\1+/S
11804    
11805    /-- Perl doesn't get these right IMO (the 3rd is PCRE-specific) --/
11806    
11807    /(?1)(?:(b(*ACCEPT))){0}/
11808        b
11809     0: b
11810    
11811    /(?1)(?:(b(*ACCEPT))){0}c/
11812        bc
11813     0: bc
11814        ** Failers
11815    No match
11816        b
11817    No match
11818    
11819    /(?1)(?:((*ACCEPT))){0}c/
11820        c
11821     0: c
11822        c\N
11823     0: c
11824    
11825    /^.*?(?(?=a)a|b(*THEN)c)/
11826        ba
11827     0: ba
11828    
11829    /^.*?(?(?=a)a|bc)/
11830        ba
11831     0: ba
11832    
11833    /-- --/
11834    
11835    /-- These studied versions are here because they are not Perl-compatible; the
11836        studying means the mark is not seen. --/
11837    
11838    /(*MARK:A)(*SKIP:B)(C|X)/KS
11839        C
11840     0: C
11841     1: C
11842    MK: A
11843        D
11844    No match
11845    
11846    /(*:A)A+(*SKIP:A)(B|Z)/KS
11847        AAAC
11848    No match
11849    
11850    /-- --/
11851    
11852    "(?=a*(*ACCEPT)b)c"
11853        c
11854     0: c
11855        c\N
11856     0: c
11857    
11858    /(?1)c(?(DEFINE)((*ACCEPT)b))/
11859        c
11860     0: c
11861        c\N
11862     0: c