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