new upstream release (3.3.0); modify package compatibility for Stretch
[ossec-hids.git] / src / external / pcre2-10.32 / testdata / testoutput2
1 # This set of tests is not Perl-compatible. It checks on special features
2 # of PCRE2's API, error diagnostics, and the compiled code of some patterns.
3 # It also checks the non-Perl syntax that PCRE2 supports (Python, .NET,
4 # Oniguruma). There are also some tests where PCRE2 and Perl differ,
5 # either because PCRE2 can't be compatible, or there is a possible Perl
6 # bug.
7
8 # NOTE: This is a non-UTF set of tests. When UTF support is needed, use
9 # test 5.
10
11 #forbid_utf
12 #newline_default lf any anycrlf
13
14 # Test binary zeroes in the pattern
15
16 # /a\0B/ where 0 is a binary zero
17 /61 5c 00 62/B,hex
18 ------------------------------------------------------------------
19         Bra
20         a\x00b
21         Ket
22         End
23 ------------------------------------------------------------------
24     a\x{0}b
25  0: a\x00b
26
27 # /a0b/ where 0 is a binary zero
28 /61 00 62/B,hex
29 ------------------------------------------------------------------
30         Bra
31         a\x00b
32         Ket
33         End
34 ------------------------------------------------------------------
35     a\x{0}b
36  0: a\x00b
37
38 # /(?#B0C)DE/ where 0 is a binary zero
39 /28 3f 23 42 00 43 29 44 45/B,hex
40 ------------------------------------------------------------------
41         Bra
42         DE
43         Ket
44         End
45 ------------------------------------------------------------------
46     DE
47  0: DE
48
49 /(a)b|/I
50 Capturing subpattern count = 1
51 May match empty string
52 Subject length lower bound = 0
53
54 /abc/I
55 Capturing subpattern count = 0
56 First code unit = 'a'
57 Last code unit = 'c'
58 Subject length lower bound = 3
59     abc
60  0: abc
61     defabc
62  0: abc
63     abc\=anchored
64  0: abc
65 \= Expect no match
66     defabc\=anchored
67 No match
68     ABC
69 No match
70
71 /^abc/I
72 Capturing subpattern count = 0
73 Compile options: <none>
74 Overall options: anchored
75 First code unit = 'a'
76 Subject length lower bound = 3
77     abc
78  0: abc
79     abc\=anchored
80  0: abc
81 \= Expect no match
82     defabc
83 No match
84     defabc\=anchored
85 No match
86
87 /a+bc/I
88 Capturing subpattern count = 0
89 First code unit = 'a'
90 Last code unit = 'c'
91 Subject length lower bound = 3
92
93 /a*bc/I
94 Capturing subpattern count = 0
95 Starting code units: a b 
96 Last code unit = 'c'
97 Subject length lower bound = 2
98
99 /a{3}bc/I
100 Capturing subpattern count = 0
101 First code unit = 'a'
102 Last code unit = 'c'
103 Subject length lower bound = 5
104
105 /(abc|a+z)/I
106 Capturing subpattern count = 1
107 First code unit = 'a'
108 Subject length lower bound = 2
109
110 /^abc$/I
111 Capturing subpattern count = 0
112 Compile options: <none>
113 Overall options: anchored
114 First code unit = 'a'
115 Subject length lower bound = 3
116     abc
117  0: abc
118 \= Expect no match
119     def\nabc
120 No match
121
122 /ab\idef/
123 Failed: error 103 at offset 3: unrecognized character follows \
124
125 /(?X)ab\idef/
126 Failed: error 111 at offset 2: unrecognized character after (? or (?-
127
128 /x{5,4}/
129 Failed: error 104 at offset 5: numbers out of order in {} quantifier
130
131 /z{65536}/
132 Failed: error 105 at offset 7: number too big in {} quantifier
133
134 /[abcd/
135 Failed: error 106 at offset 5: missing terminating ] for character class
136
137 /[\B]/B
138 Failed: error 107 at offset 2: invalid escape sequence in character class
139
140 /[\R]/B
141 Failed: error 107 at offset 2: invalid escape sequence in character class
142
143 /[\X]/B
144 Failed: error 107 at offset 2: invalid escape sequence in character class
145
146 /[z-a]/
147 Failed: error 108 at offset 3: range out of order in character class
148
149 /^*/
150 Failed: error 109 at offset 1: quantifier does not follow a repeatable item
151
152 /(abc/
153 Failed: error 114 at offset 4: missing closing parenthesis
154
155 /(?# abc/
156 Failed: error 118 at offset 7: missing ) after (?# comment
157
158 /(?z)abc/
159 Failed: error 111 at offset 2: unrecognized character after (? or (?-
160
161 /.*b/I
162 Capturing subpattern count = 0
163 First code unit at start or follows newline
164 Last code unit = 'b'
165 Subject length lower bound = 1
166
167 /.*?b/I
168 Capturing subpattern count = 0
169 First code unit at start or follows newline
170 Last code unit = 'b'
171 Subject length lower bound = 1
172
173 /cat|dog|elephant/I
174 Capturing subpattern count = 0
175 Starting code units: c d e 
176 Subject length lower bound = 3
177     this sentence eventually mentions a cat
178  0: cat
179     this sentences rambles on and on for a while and then reaches elephant
180  0: elephant
181
182 /cat|dog|elephant/I
183 Capturing subpattern count = 0
184 Starting code units: c d e 
185 Subject length lower bound = 3
186     this sentence eventually mentions a cat
187  0: cat
188     this sentences rambles on and on for a while and then reaches elephant
189  0: elephant
190
191 /cat|dog|elephant/Ii
192 Capturing subpattern count = 0
193 Options: caseless
194 Starting code units: C D E c d e 
195 Subject length lower bound = 3
196     this sentence eventually mentions a CAT cat
197  0: CAT
198     this sentences rambles on and on for a while to elephant ElePhant
199  0: elephant
200
201 /a|[bcd]/I
202 Capturing subpattern count = 0
203 Starting code units: a b c d 
204 Subject length lower bound = 1
205
206 /(a|[^\dZ])/I
207 Capturing subpattern count = 1
208 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
209   \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 
210   \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / : ; < = > 
211   ? @ 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 [ \ ] ^ _ ` a b c d 
212   e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f \x80 \x81 \x82 \x83 
213   \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 
214   \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1 
215   \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0 
216   \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf 
217   \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce 
218   \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd 
219   \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec 
220   \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb 
221   \xfc \xfd \xfe \xff 
222 Subject length lower bound = 1
223
224 /(a|b)*[\s]/I
225 Capturing subpattern count = 1
226 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 a b 
227 Subject length lower bound = 1
228
229 /(ab\2)/
230 Failed: error 115 at offset 4: reference to non-existent subpattern
231
232 /{4,5}abc/
233 Failed: error 109 at offset 4: quantifier does not follow a repeatable item
234
235 /(a)(b)(c)\2/I
236 Capturing subpattern count = 3
237 Max back reference = 2
238 First code unit = 'a'
239 Last code unit = 'c'
240 Subject length lower bound = 4
241     abcb
242  0: abcb
243  1: a
244  2: b
245  3: c
246     abcb\=ovector=0
247  0: abcb
248  1: a
249  2: b
250  3: c
251     abcb\=ovector=1
252 Matched, but too many substrings
253  0: abcb
254     abcb\=ovector=2
255 Matched, but too many substrings
256  0: abcb
257  1: a
258     abcb\=ovector=3
259 Matched, but too many substrings
260  0: abcb
261  1: a
262  2: b
263     abcb\=ovector=4
264  0: abcb
265  1: a
266  2: b
267  3: c
268
269 /(a)bc|(a)(b)\2/I
270 Capturing subpattern count = 3
271 Max back reference = 2
272 First code unit = 'a'
273 Subject length lower bound = 3
274     abc
275  0: abc
276  1: a
277     abc\=ovector=0
278  0: abc
279  1: a
280     abc\=ovector=1
281 Matched, but too many substrings
282  0: abc
283     abc\=ovector=2
284  0: abc
285  1: a
286     aba
287  0: aba
288  1: <unset>
289  2: a
290  3: b
291     aba\=ovector=0
292  0: aba
293  1: <unset>
294  2: a
295  3: b
296     aba\=ovector=1
297 Matched, but too many substrings
298  0: aba
299     aba\=ovector=2
300 Matched, but too many substrings
301  0: aba
302  1: <unset>
303     aba\=ovector=3
304 Matched, but too many substrings
305  0: aba
306  1: <unset>
307  2: a
308     aba\=ovector=4
309  0: aba
310  1: <unset>
311  2: a
312  3: b
313
314 /abc$/I,dollar_endonly
315 Capturing subpattern count = 0
316 Options: dollar_endonly
317 First code unit = 'a'
318 Last code unit = 'c'
319 Subject length lower bound = 3
320     abc
321  0: abc
322 \= Expect no match
323     abc\n
324 No match
325     abc\ndef
326 No match
327
328 /(a)(b)(c)(d)(e)\6/
329 Failed: error 115 at offset 16: reference to non-existent subpattern
330
331 /the quick brown fox/I
332 Capturing subpattern count = 0
333 First code unit = 't'
334 Last code unit = 'x'
335 Subject length lower bound = 19
336     the quick brown fox
337  0: the quick brown fox
338     this is a line with the quick brown fox
339  0: the quick brown fox
340
341 /the quick brown fox/I,anchored
342 Capturing subpattern count = 0
343 Options: anchored
344 First code unit = 't'
345 Subject length lower bound = 19
346     the quick brown fox
347  0: the quick brown fox
348 \= Expect no match
349     this is a line with the quick brown fox
350 No match
351
352 /ab(?z)cd/
353 Failed: error 111 at offset 4: unrecognized character after (? or (?-
354
355 /^abc|def/I
356 Capturing subpattern count = 0
357 Starting code units: a d 
358 Subject length lower bound = 3
359     abcdef
360  0: abc
361     abcdef\=notbol
362  0: def
363
364 /.*((abc)$|(def))/I
365 Capturing subpattern count = 3
366 First code unit at start or follows newline
367 Subject length lower bound = 3
368     defabc
369  0: defabc
370  1: abc
371  2: abc
372     defabc\=noteol
373  0: def
374  1: def
375  2: <unset>
376  3: def
377
378 /)/
379 Failed: error 122 at offset 0: unmatched closing parenthesis
380
381 /a[]b/
382 Failed: error 106 at offset 4: missing terminating ] for character class
383
384 /[^aeiou ]{3,}/I
385 Capturing subpattern count = 0
386 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
387   \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 
388   \x1a \x1b \x1c \x1d \x1e \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 
389   7 8 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 [ 
390   \ ] ^ _ ` b c d f g h j k l m n p q r s t v w x y z { | } ~ \x7f \x80 \x81 
391   \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 
392   \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f 
393   \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae 
394   \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd 
395   \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc 
396   \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb 
397   \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea 
398   \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 
399   \xfa \xfb \xfc \xfd \xfe \xff 
400 Subject length lower bound = 3
401     co-processors, and for
402  0: -pr
403
404 /<.*>/I
405 Capturing subpattern count = 0
406 First code unit = '<'
407 Last code unit = '>'
408 Subject length lower bound = 2
409     abc<def>ghi<klm>nop
410  0: <def>ghi<klm>
411
412 /<.*?>/I
413 Capturing subpattern count = 0
414 First code unit = '<'
415 Last code unit = '>'
416 Subject length lower bound = 2
417     abc<def>ghi<klm>nop
418  0: <def>
419
420 /<.*>/I,ungreedy
421 Capturing subpattern count = 0
422 Options: ungreedy
423 First code unit = '<'
424 Last code unit = '>'
425 Subject length lower bound = 2
426     abc<def>ghi<klm>nop
427  0: <def>
428
429 /(?U)<.*>/I
430 Capturing subpattern count = 0
431 First code unit = '<'
432 Last code unit = '>'
433 Subject length lower bound = 2
434     abc<def>ghi<klm>nop
435  0: <def>
436
437 /<.*?>/I,ungreedy
438 Capturing subpattern count = 0
439 Options: ungreedy
440 First code unit = '<'
441 Last code unit = '>'
442 Subject length lower bound = 2
443     abc<def>ghi<klm>nop
444  0: <def>ghi<klm>
445
446 /={3,}/I,ungreedy
447 Capturing subpattern count = 0
448 Options: ungreedy
449 First code unit = '='
450 Last code unit = '='
451 Subject length lower bound = 3
452     abc========def
453  0: ===
454
455 /(?U)={3,}?/I
456 Capturing subpattern count = 0
457 First code unit = '='
458 Last code unit = '='
459 Subject length lower bound = 3
460     abc========def
461  0: ========
462
463 /(?<!bar|cattle)foo/I
464 Capturing subpattern count = 0
465 Max lookbehind = 6
466 First code unit = 'f'
467 Last code unit = 'o'
468 Subject length lower bound = 3
469     foo
470  0: foo
471     catfoo
472  0: foo
473 \= Expect no match
474     the barfoo
475 No match
476     and cattlefoo
477 No match
478
479 /abc(?<=a+)b/
480 Failed: error 125 at offset 3: lookbehind assertion is not fixed length
481
482 /12345(?<=aaa|b{0,3})b/
483 Failed: error 125 at offset 5: lookbehind assertion is not fixed length
484
485 /(?<!(foo)a\1)bar/
486
487 /(?i)abc/I
488 Capturing subpattern count = 0
489 First code unit = 'a' (caseless)
490 Last code unit = 'c' (caseless)
491 Subject length lower bound = 3
492
493 /(a|(?m)a)/I
494 Capturing subpattern count = 1
495 First code unit = 'a'
496 Subject length lower bound = 1
497
498 /(?i)^1234/I
499 Capturing subpattern count = 0
500 Compile options: <none>
501 Overall options: anchored
502 First code unit = '1'
503 Subject length lower bound = 4
504
505 /(^b|(?i)^d)/I
506 Capturing subpattern count = 1
507 Compile options: <none>
508 Overall options: anchored
509 Starting code units: D b d 
510 Subject length lower bound = 1
511
512 /(?s).*/I
513 Capturing subpattern count = 0
514 May match empty string
515 Compile options: <none>
516 Overall options: anchored
517 Subject length lower bound = 0
518
519 /[abcd]/I
520 Capturing subpattern count = 0
521 Starting code units: a b c d 
522 Subject length lower bound = 1
523
524 /(?i)[abcd]/I
525 Capturing subpattern count = 0
526 Starting code units: A B C D a b c d 
527 Subject length lower bound = 1
528
529 /(?m)[xy]|(b|c)/I
530 Capturing subpattern count = 1
531 Starting code units: b c x y 
532 Subject length lower bound = 1
533
534 /(^a|^b)/Im
535 Capturing subpattern count = 1
536 Options: multiline
537 First code unit at start or follows newline
538 Subject length lower bound = 1
539
540 /(?i)(^a|^b)/Im
541 Capturing subpattern count = 1
542 Options: multiline
543 First code unit at start or follows newline
544 Subject length lower bound = 1
545
546 /(a)(?(1)a|b|c)/
547 Failed: error 127 at offset 3: conditional group contains more than two branches
548
549 /(?(?=a)a|b|c)/
550 Failed: error 127 at offset 0: conditional group contains more than two branches
551
552 /(?(1a)/
553 Failed: error 124 at offset 4: missing closing parenthesis for condition
554
555 /(?(1a))/
556 Failed: error 124 at offset 4: missing closing parenthesis for condition
557
558 /(?(?i))/
559 Failed: error 128 at offset 2: assertion expected after (?( or (?(?C)
560
561 /(?(abc))/
562 Failed: error 115 at offset 3: reference to non-existent subpattern
563
564 /(?(?<ab))/
565 Failed: error 128 at offset 2: assertion expected after (?( or (?(?C)
566
567 /((?s)blah)\s+\1/I
568 Capturing subpattern count = 1
569 Max back reference = 1
570 First code unit = 'b'
571 Last code unit = 'h'
572 Subject length lower bound = 9
573
574 /((?i)blah)\s+\1/I
575 Capturing subpattern count = 1
576 Max back reference = 1
577 First code unit = 'b' (caseless)
578 Last code unit = 'h' (caseless)
579 Subject length lower bound = 9
580
581 /((?i)b)/IB
582 ------------------------------------------------------------------
583         Bra
584         CBra 1
585      /i b
586         Ket
587         Ket
588         End
589 ------------------------------------------------------------------
590 Capturing subpattern count = 1
591 First code unit = 'b' (caseless)
592 Subject length lower bound = 1
593
594 /(a*b|(?i:c*(?-i)d))/I
595 Capturing subpattern count = 1
596 Starting code units: C a b c d 
597 Subject length lower bound = 1
598
599 /a$/I
600 Capturing subpattern count = 0
601 First code unit = 'a'
602 Subject length lower bound = 1
603     a
604  0: a
605     a\n
606  0: a
607 \= Expect no match
608     a\=noteol
609 No match
610     a\n\=noteol
611 No match
612
613 /a$/Im
614 Capturing subpattern count = 0
615 Options: multiline
616 First code unit = 'a'
617 Subject length lower bound = 1
618     a
619  0: a
620     a\n
621  0: a
622     a\n\=noteol
623  0: a
624 \= Expect no match
625     a\=noteol
626 No match
627
628 /\Aabc/Im
629 Capturing subpattern count = 0
630 Max lookbehind = 1
631 Compile options: multiline
632 Overall options: anchored multiline
633 First code unit = 'a'
634 Subject length lower bound = 3
635
636 /^abc/Im
637 Capturing subpattern count = 0
638 Options: multiline
639 First code unit at start or follows newline
640 Last code unit = 'c'
641 Subject length lower bound = 3
642
643 /^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/I
644 Capturing subpattern count = 5
645 Compile options: <none>
646 Overall options: anchored
647 First code unit = 'a'
648 Subject length lower bound = 3
649   aaaaabbbbbcccccdef
650  0: aaaaabbbbbcccccdef
651  1: aaaaabbbbbcccccdef
652  2: aaaaa
653  3: b
654  4: bbbbccccc
655  5: def
656
657 /(?<=foo)[ab]/I
658 Capturing subpattern count = 0
659 Max lookbehind = 3
660 Starting code units: a b 
661 Subject length lower bound = 1
662
663 /(?<!foo)(alpha|omega)/I
664 Capturing subpattern count = 1
665 Max lookbehind = 3
666 Starting code units: a o 
667 Last code unit = 'a'
668 Subject length lower bound = 5
669
670 /(?!alphabet)[ab]/I
671 Capturing subpattern count = 0
672 Starting code units: a b 
673 Subject length lower bound = 1
674
675 /(?<=foo\n)^bar/Im
676 Capturing subpattern count = 0
677 Max lookbehind = 4
678 Contains explicit CR or LF match
679 Options: multiline
680 Last code unit = 'r'
681 Subject length lower bound = 3
682     foo\nbarbar
683  0: bar
684 \= Expect no match
685     rhubarb
686 No match
687     barbell
688 No match
689     abc\nbarton
690 No match
691
692 /^(?<=foo\n)bar/Im
693 Capturing subpattern count = 0
694 Max lookbehind = 4
695 Contains explicit CR or LF match
696 Options: multiline
697 First code unit at start or follows newline
698 Last code unit = 'r'
699 Subject length lower bound = 3
700     foo\nbarbar
701  0: bar
702 \= Expect no match
703     rhubarb
704 No match
705     barbell
706 No match
707     abc\nbarton
708 No match
709
710 /(?>^abc)/Im
711 Capturing subpattern count = 0
712 Options: multiline
713 First code unit at start or follows newline
714 Last code unit = 'c'
715 Subject length lower bound = 3
716     abc
717  0: abc
718     def\nabc
719  0: abc
720 \= Expect no match
721     defabc
722 No match
723
724 /(?<=ab(c+)d)ef/
725 Failed: error 125 at offset 0: lookbehind assertion is not fixed length
726
727 /(?<=ab(?<=c+)d)ef/
728 Failed: error 125 at offset 6: lookbehind assertion is not fixed length
729
730 /(?<=ab(c|de)f)g/
731 Failed: error 125 at offset 0: lookbehind assertion is not fixed length
732
733 /The next three are in testinput2 because they have variable length branches/
734
735 /(?<=bullock|donkey)-cart/I
736 Capturing subpattern count = 0
737 Max lookbehind = 7
738 First code unit = '-'
739 Last code unit = 't'
740 Subject length lower bound = 5
741     the bullock-cart
742  0: -cart
743     a donkey-cart race
744  0: -cart
745 \= Expect no match
746     cart
747 No match
748     horse-and-cart
749 No match
750
751 /(?<=ab(?i)x|y|z)/I
752 Capturing subpattern count = 0
753 Max lookbehind = 3
754 May match empty string
755 Subject length lower bound = 0
756
757 /(?>.*)(?<=(abcd)|(xyz))/I
758 Capturing subpattern count = 2
759 Max lookbehind = 4
760 May match empty string
761 Subject length lower bound = 0
762     alphabetabcd
763  0: alphabetabcd
764  1: abcd
765     endingxyz
766  0: endingxyz
767  1: <unset>
768  2: xyz
769
770 /(?<=ab(?i)x(?-i)y|(?i)z|b)ZZ/I
771 Capturing subpattern count = 0
772 Max lookbehind = 4
773 First code unit = 'Z'
774 Last code unit = 'Z'
775 Subject length lower bound = 2
776     abxyZZ
777  0: ZZ
778     abXyZZ
779  0: ZZ
780     ZZZ
781  0: ZZ
782     zZZ
783  0: ZZ
784     bZZ
785  0: ZZ
786     BZZ
787  0: ZZ
788 \= Expect no match
789     ZZ
790 No match
791     abXYZZ
792 No match
793     zzz
794 No match
795     bzz
796 No match
797
798 /(?<!(foo)a)bar/I
799 Capturing subpattern count = 1
800 Max lookbehind = 4
801 First code unit = 'b'
802 Last code unit = 'r'
803 Subject length lower bound = 3
804     bar
805  0: bar
806     foobbar
807  0: bar
808 \= Expect no match
809     fooabar
810 No match
811
812 # This one is here because Perl behaves differently; see also the following.
813
814 /^(a\1?){4}$/I
815 Capturing subpattern count = 1
816 Max back reference = 1
817 Compile options: <none>
818 Overall options: anchored
819 Starting code units: a 
820 Subject length lower bound = 4
821 \= Expect no match
822     aaaa
823 No match
824     aaaaaa
825 No match
826
827 # Perl does not fail these two for the final subjects. Neither did PCRE until
828 # release 8.01. The problem is in backtracking into a subpattern that contains
829 # a recursive reference to itself. PCRE has now made these into atomic patterns.
830
831 /^(xa|=?\1a){2}$/
832     xa=xaa
833  0: xa=xaa
834  1: =xaa
835 \= Expect no match
836     xa=xaaa
837 No match
838
839 /^(xa|=?\1a)+$/
840     xa=xaa
841  0: xa=xaa
842  1: =xaa
843 \= Expect no match
844     xa=xaaa
845 No match
846
847 # These are syntax tests from Perl 5.005
848
849 /a[b-a]/
850 Failed: error 108 at offset 4: range out of order in character class
851
852 /a[]b/
853 Failed: error 106 at offset 4: missing terminating ] for character class
854
855 /a[/
856 Failed: error 106 at offset 2: missing terminating ] for character class
857
858 /*a/
859 Failed: error 109 at offset 0: quantifier does not follow a repeatable item
860
861 /(*)b/
862 Failed: error 109 at offset 1: quantifier does not follow a repeatable item
863
864 /abc)/
865 Failed: error 122 at offset 3: unmatched closing parenthesis
866
867 /(abc/
868 Failed: error 114 at offset 4: missing closing parenthesis
869
870 /a**/
871 Failed: error 109 at offset 2: quantifier does not follow a repeatable item
872
873 /)(/
874 Failed: error 122 at offset 0: unmatched closing parenthesis
875
876 /\1/
877 Failed: error 115 at offset 1: reference to non-existent subpattern
878
879 /\2/
880 Failed: error 115 at offset 1: reference to non-existent subpattern
881
882 /(a)|\2/
883 Failed: error 115 at offset 5: reference to non-existent subpattern
884
885 /a[b-a]/Ii
886 Failed: error 108 at offset 4: range out of order in character class
887
888 /a[]b/Ii
889 Failed: error 106 at offset 4: missing terminating ] for character class
890
891 /a[/Ii
892 Failed: error 106 at offset 2: missing terminating ] for character class
893
894 /*a/Ii
895 Failed: error 109 at offset 0: quantifier does not follow a repeatable item
896
897 /(*)b/Ii
898 Failed: error 109 at offset 1: quantifier does not follow a repeatable item
899
900 /abc)/Ii
901 Failed: error 122 at offset 3: unmatched closing parenthesis
902
903 /(abc/Ii
904 Failed: error 114 at offset 4: missing closing parenthesis
905
906 /a**/Ii
907 Failed: error 109 at offset 2: quantifier does not follow a repeatable item
908
909 /)(/Ii
910 Failed: error 122 at offset 0: unmatched closing parenthesis
911
912 /:(?:/
913 Failed: error 114 at offset 4: missing closing parenthesis
914
915 /(?<%)b/
916 Failed: error 162 at offset 3: subpattern name expected
917
918 /a(?{)b/
919 Failed: error 111 at offset 3: unrecognized character after (? or (?-
920
921 /a(?{{})b/
922 Failed: error 111 at offset 3: unrecognized character after (? or (?-
923
924 /a(?{}})b/
925 Failed: error 111 at offset 3: unrecognized character after (? or (?-
926
927 /a(?{"{"})b/
928 Failed: error 111 at offset 3: unrecognized character after (? or (?-
929
930 /a(?{"{"}})b/
931 Failed: error 111 at offset 3: unrecognized character after (? or (?-
932
933 /(?(1?)a|b)/
934 Failed: error 124 at offset 4: missing closing parenthesis for condition
935
936 /[a[:xyz:/
937 Failed: error 106 at offset 8: missing terminating ] for character class
938
939 /(?<=x+)y/
940 Failed: error 125 at offset 0: lookbehind assertion is not fixed length
941
942 /a{37,17}/
943 Failed: error 104 at offset 7: numbers out of order in {} quantifier
944
945 /abc/\
946 Failed: error 101 at offset 4: \ at end of pattern
947
948 /abc/\i
949 Failed: error 101 at offset 4: \ at end of pattern
950
951 /(a)bc(d)/I
952 Capturing subpattern count = 2
953 First code unit = 'a'
954 Last code unit = 'd'
955 Subject length lower bound = 4
956     abcd
957  0: abcd
958  1: a
959  2: d
960     abcd\=copy=2
961  0: abcd
962  1: a
963  2: d
964  2C d (1)
965     abcd\=copy=5
966  0: abcd
967  1: a
968  2: d
969 Copy substring 5 failed (-49): unknown substring
970
971 /(.{20})/I
972 Capturing subpattern count = 1
973 Subject length lower bound = 20
974     abcdefghijklmnopqrstuvwxyz
975  0: abcdefghijklmnopqrst
976  1: abcdefghijklmnopqrst
977     abcdefghijklmnopqrstuvwxyz\=copy=1
978  0: abcdefghijklmnopqrst
979  1: abcdefghijklmnopqrst
980  1C abcdefghijklmnopqrst (20)
981     abcdefghijklmnopqrstuvwxyz\=get=1
982  0: abcdefghijklmnopqrst
983  1: abcdefghijklmnopqrst
984  1G abcdefghijklmnopqrst (20)
985
986 /(.{15})/I
987 Capturing subpattern count = 1
988 Subject length lower bound = 15
989     abcdefghijklmnopqrstuvwxyz
990  0: abcdefghijklmno
991  1: abcdefghijklmno
992     abcdefghijklmnopqrstuvwxyz\=copy=1,get=1
993  0: abcdefghijklmno
994  1: abcdefghijklmno
995  1C abcdefghijklmno (15)
996  1G abcdefghijklmno (15)
997
998 /(.{16})/I
999 Capturing subpattern count = 1
1000 Subject length lower bound = 16
1001     abcdefghijklmnopqrstuvwxyz
1002  0: abcdefghijklmnop
1003  1: abcdefghijklmnop
1004     abcdefghijklmnopqrstuvwxyz\=copy=1,get=1,getall
1005  0: abcdefghijklmnop
1006  1: abcdefghijklmnop
1007  1C abcdefghijklmnop (16)
1008  1G abcdefghijklmnop (16)
1009  0L abcdefghijklmnop
1010  1L abcdefghijklmnop
1011
1012 /^(a|(bc))de(f)/I
1013 Capturing subpattern count = 3
1014 Compile options: <none>
1015 Overall options: anchored
1016 Starting code units: a b 
1017 Subject length lower bound = 4
1018     adef\=get=1,get=2,get=3,get=4,getall
1019  0: adef
1020  1: a
1021  2: <unset>
1022  3: f
1023  1G a (1)
1024 Get substring 2 failed (-55): requested value is not set
1025  3G f (1)
1026 Get substring 4 failed (-49): unknown substring
1027  0L adef
1028  1L a
1029  2L 
1030  3L f
1031     bcdef\=get=1,get=2,get=3,get=4,getall
1032  0: bcdef
1033  1: bc
1034  2: bc
1035  3: f
1036  1G bc (2)
1037  2G bc (2)
1038  3G f (1)
1039 Get substring 4 failed (-49): unknown substring
1040  0L bcdef
1041  1L bc
1042  2L bc
1043  3L f
1044     adefghijk\=copy=0
1045  0: adef
1046  1: a
1047  2: <unset>
1048  3: f
1049  0C adef (4)
1050
1051 /^abc\00def/I
1052 Capturing subpattern count = 0
1053 Compile options: <none>
1054 Overall options: anchored
1055 First code unit = 'a'
1056 Subject length lower bound = 7
1057     abc\00def\=copy=0,getall
1058  0: abc\x00def
1059  0C abc\x00def (7)
1060  0L abc\x00def
1061
1062 /word ((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+
1063 )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+
1064 )?)?)?)?)?)?)?)?)?otherword/I
1065 Capturing subpattern count = 8
1066 Contains explicit CR or LF match
1067 First code unit = 'w'
1068 Last code unit = 'd'
1069 Subject length lower bound = 14
1070
1071 /.*X/IB
1072 ------------------------------------------------------------------
1073         Bra
1074         Any*
1075         X
1076         Ket
1077         End
1078 ------------------------------------------------------------------
1079 Capturing subpattern count = 0
1080 First code unit at start or follows newline
1081 Last code unit = 'X'
1082 Subject length lower bound = 1
1083
1084 /.*X/IBs
1085 ------------------------------------------------------------------
1086         Bra
1087         AllAny*
1088         X
1089         Ket
1090         End
1091 ------------------------------------------------------------------
1092 Capturing subpattern count = 0
1093 Compile options: dotall
1094 Overall options: anchored dotall
1095 Last code unit = 'X'
1096 Subject length lower bound = 1
1097
1098 /(.*X|^B)/IB
1099 ------------------------------------------------------------------
1100         Bra
1101         CBra 1
1102         Any*
1103         X
1104         Alt
1105         ^
1106         B
1107         Ket
1108         Ket
1109         End
1110 ------------------------------------------------------------------
1111 Capturing subpattern count = 1
1112 First code unit at start or follows newline
1113 Subject length lower bound = 1
1114
1115 /(.*X|^B)/IBs
1116 ------------------------------------------------------------------
1117         Bra
1118         CBra 1
1119         AllAny*
1120         X
1121         Alt
1122         ^
1123         B
1124         Ket
1125         Ket
1126         End
1127 ------------------------------------------------------------------
1128 Capturing subpattern count = 1
1129 Compile options: dotall
1130 Overall options: anchored dotall
1131 Subject length lower bound = 1
1132
1133 /(?s)(.*X|^B)/IB
1134 ------------------------------------------------------------------
1135         Bra
1136         CBra 1
1137         AllAny*
1138         X
1139         Alt
1140         ^
1141         B
1142         Ket
1143         Ket
1144         End
1145 ------------------------------------------------------------------
1146 Capturing subpattern count = 1
1147 Compile options: <none>
1148 Overall options: anchored
1149 Subject length lower bound = 1
1150
1151 /(?s:.*X|^B)/IB
1152 ------------------------------------------------------------------
1153         Bra
1154         Bra
1155         AllAny*
1156         X
1157         Alt
1158         ^
1159         B
1160         Ket
1161         Ket
1162         End
1163 ------------------------------------------------------------------
1164 Capturing subpattern count = 0
1165 Compile options: <none>
1166 Overall options: anchored
1167 Subject length lower bound = 1
1168
1169 /\Biss\B/I,aftertext
1170 Capturing subpattern count = 0
1171 Max lookbehind = 1
1172 First code unit = 'i'
1173 Last code unit = 's'
1174 Subject length lower bound = 3
1175     Mississippi
1176  0: iss
1177  0+ issippi
1178
1179 /iss/I,aftertext,altglobal
1180 Capturing subpattern count = 0
1181 First code unit = 'i'
1182 Last code unit = 's'
1183 Subject length lower bound = 3
1184     Mississippi
1185  0: iss
1186  0+ issippi
1187  0: iss
1188  0+ ippi
1189
1190 /\Biss\B/I,aftertext,altglobal
1191 Capturing subpattern count = 0
1192 Max lookbehind = 1
1193 First code unit = 'i'
1194 Last code unit = 's'
1195 Subject length lower bound = 3
1196     Mississippi
1197  0: iss
1198  0+ issippi
1199
1200 /\Biss\B/Ig,aftertext
1201 Capturing subpattern count = 0
1202 Max lookbehind = 1
1203 First code unit = 'i'
1204 Last code unit = 's'
1205 Subject length lower bound = 3
1206     Mississippi
1207  0: iss
1208  0+ issippi
1209  0: iss
1210  0+ ippi
1211 \= Expect no match
1212     Mississippi\=anchored
1213 No match
1214
1215 /(?<=[Ms])iss/Ig,aftertext
1216 Capturing subpattern count = 0
1217 Max lookbehind = 1
1218 First code unit = 'i'
1219 Last code unit = 's'
1220 Subject length lower bound = 3
1221     Mississippi
1222  0: iss
1223  0+ issippi
1224  0: iss
1225  0+ ippi
1226
1227 /(?<=[Ms])iss/I,aftertext,altglobal
1228 Capturing subpattern count = 0
1229 Max lookbehind = 1
1230 First code unit = 'i'
1231 Last code unit = 's'
1232 Subject length lower bound = 3
1233     Mississippi
1234  0: iss
1235  0+ issippi
1236
1237 /^iss/Ig,aftertext
1238 Capturing subpattern count = 0
1239 Compile options: <none>
1240 Overall options: anchored
1241 First code unit = 'i'
1242 Subject length lower bound = 3
1243     ississippi
1244  0: iss
1245  0+ issippi
1246
1247 /.*iss/Ig,aftertext
1248 Capturing subpattern count = 0
1249 First code unit at start or follows newline
1250 Last code unit = 's'
1251 Subject length lower bound = 3
1252     abciss\nxyzisspqr
1253  0: abciss
1254  0+ \x0axyzisspqr
1255  0: xyziss
1256  0+ pqr
1257
1258 /.i./Ig,aftertext
1259 Capturing subpattern count = 0
1260 Last code unit = 'i'
1261 Subject length lower bound = 3
1262     Mississippi
1263  0: Mis
1264  0+ sissippi
1265  0: sis
1266  0+ sippi
1267  0: sip
1268  0+ pi
1269     Mississippi\=anchored
1270  0: Mis
1271  0+ sissippi
1272  0: sis
1273  0+ sippi
1274  0: sip
1275  0+ pi
1276     Missouri river
1277  0: Mis
1278  0+ souri river
1279  0: ri 
1280  0+ river
1281  0: riv
1282  0+ er
1283     Missouri river\=anchored
1284  0: Mis
1285  0+ souri river
1286
1287 /^.is/Ig,aftertext
1288 Capturing subpattern count = 0
1289 Compile options: <none>
1290 Overall options: anchored
1291 Subject length lower bound = 3
1292     Mississippi
1293  0: Mis
1294  0+ sissippi
1295
1296 /^ab\n/Ig,aftertext
1297 Capturing subpattern count = 0
1298 Contains explicit CR or LF match
1299 Compile options: <none>
1300 Overall options: anchored
1301 First code unit = 'a'
1302 Subject length lower bound = 3
1303     ab\nab\ncd
1304  0: ab\x0a
1305  0+ ab\x0acd
1306
1307 /^ab\n/Igm,aftertext
1308 Capturing subpattern count = 0
1309 Contains explicit CR or LF match
1310 Options: multiline
1311 First code unit at start or follows newline
1312 Last code unit = \x0a
1313 Subject length lower bound = 3
1314     ab\nab\ncd
1315  0: ab\x0a
1316  0+ ab\x0acd
1317  0: ab\x0a
1318  0+ cd
1319
1320 /^/gm,newline=any
1321     a\rb\nc\r\nxyz\=aftertext
1322  0: 
1323  0+ a\x0db\x0ac\x0d\x0axyz
1324  0: 
1325  0+ b\x0ac\x0d\x0axyz
1326  0: 
1327  0+ c\x0d\x0axyz
1328  0: 
1329  0+ xyz
1330
1331 /abc/I
1332 Capturing subpattern count = 0
1333 First code unit = 'a'
1334 Last code unit = 'c'
1335 Subject length lower bound = 3
1336
1337 /abc|bac/I
1338 Capturing subpattern count = 0
1339 Starting code units: a b 
1340 Last code unit = 'c'
1341 Subject length lower bound = 3
1342
1343 /(abc|bac)/I
1344 Capturing subpattern count = 1
1345 Starting code units: a b 
1346 Last code unit = 'c'
1347 Subject length lower bound = 3
1348
1349 /(abc|(c|dc))/I
1350 Capturing subpattern count = 2
1351 Starting code units: a c d 
1352 Last code unit = 'c'
1353 Subject length lower bound = 1
1354
1355 /(abc|(d|de)c)/I
1356 Capturing subpattern count = 2
1357 Starting code units: a d 
1358 Last code unit = 'c'
1359 Subject length lower bound = 2
1360
1361 /a*/I
1362 Capturing subpattern count = 0
1363 May match empty string
1364 Subject length lower bound = 0
1365
1366 /a+/I
1367 Capturing subpattern count = 0
1368 First code unit = 'a'
1369 Subject length lower bound = 1
1370
1371 /(baa|a+)/I
1372 Capturing subpattern count = 1
1373 Starting code units: a b 
1374 Last code unit = 'a'
1375 Subject length lower bound = 1
1376
1377 /a{0,3}/I
1378 Capturing subpattern count = 0
1379 May match empty string
1380 Subject length lower bound = 0
1381
1382 /baa{3,}/I
1383 Capturing subpattern count = 0
1384 First code unit = 'b'
1385 Last code unit = 'a'
1386 Subject length lower bound = 5
1387
1388 /"([^\\"]+|\\.)*"/I
1389 Capturing subpattern count = 1
1390 First code unit = '"'
1391 Last code unit = '"'
1392 Subject length lower bound = 2
1393
1394 /(abc|ab[cd])/I
1395 Capturing subpattern count = 1
1396 First code unit = 'a'
1397 Subject length lower bound = 3
1398
1399 /(a|.)/I
1400 Capturing subpattern count = 1
1401 Subject length lower bound = 1
1402
1403 /a|ba|\w/I
1404 Capturing subpattern count = 0
1405 Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P 
1406   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 
1407 Subject length lower bound = 1
1408
1409 /abc(?=pqr)/I
1410 Capturing subpattern count = 0
1411 First code unit = 'a'
1412 Last code unit = 'r'
1413 Subject length lower bound = 3
1414
1415 /...(?<=abc)/I
1416 Capturing subpattern count = 0
1417 Max lookbehind = 3
1418 Subject length lower bound = 3
1419
1420 /abc(?!pqr)/I
1421 Capturing subpattern count = 0
1422 First code unit = 'a'
1423 Last code unit = 'c'
1424 Subject length lower bound = 3
1425
1426 /ab./I
1427 Capturing subpattern count = 0
1428 First code unit = 'a'
1429 Last code unit = 'b'
1430 Subject length lower bound = 3
1431
1432 /ab[xyz]/I
1433 Capturing subpattern count = 0
1434 First code unit = 'a'
1435 Last code unit = 'b'
1436 Subject length lower bound = 3
1437
1438 /abc*/I
1439 Capturing subpattern count = 0
1440 First code unit = 'a'
1441 Last code unit = 'b'
1442 Subject length lower bound = 2
1443
1444 /ab.c*/I
1445 Capturing subpattern count = 0
1446 First code unit = 'a'
1447 Last code unit = 'b'
1448 Subject length lower bound = 3
1449
1450 /a.c*/I
1451 Capturing subpattern count = 0
1452 First code unit = 'a'
1453 Subject length lower bound = 2
1454
1455 /.c*/I
1456 Capturing subpattern count = 0
1457 Subject length lower bound = 1
1458
1459 /ac*/I
1460 Capturing subpattern count = 0
1461 First code unit = 'a'
1462 Subject length lower bound = 1
1463
1464 /(a.c*|b.c*)/I
1465 Capturing subpattern count = 1
1466 Starting code units: a b 
1467 Subject length lower bound = 2
1468
1469 /a.c*|aba/I
1470 Capturing subpattern count = 0
1471 First code unit = 'a'
1472 Subject length lower bound = 2
1473
1474 /.+a/I
1475 Capturing subpattern count = 0
1476 Last code unit = 'a'
1477 Subject length lower bound = 2
1478
1479 /(?=abcda)a.*/I
1480 Capturing subpattern count = 0
1481 First code unit = 'a'
1482 Last code unit = 'a'
1483 Subject length lower bound = 1
1484
1485 /(?=a)a.*/I
1486 Capturing subpattern count = 0
1487 First code unit = 'a'
1488 Subject length lower bound = 1
1489
1490 /a(b)*/I
1491 Capturing subpattern count = 1
1492 First code unit = 'a'
1493 Subject length lower bound = 1
1494
1495 /a\d*/I
1496 Capturing subpattern count = 0
1497 First code unit = 'a'
1498 Subject length lower bound = 1
1499
1500 /ab\d*/I
1501 Capturing subpattern count = 0
1502 First code unit = 'a'
1503 Last code unit = 'b'
1504 Subject length lower bound = 2
1505
1506 /a(\d)*/I
1507 Capturing subpattern count = 1
1508 First code unit = 'a'
1509 Subject length lower bound = 1
1510
1511 /abcde{0,0}/I
1512 Capturing subpattern count = 0
1513 First code unit = 'a'
1514 Last code unit = 'd'
1515 Subject length lower bound = 4
1516
1517 /ab\d+/I
1518 Capturing subpattern count = 0
1519 First code unit = 'a'
1520 Last code unit = 'b'
1521 Subject length lower bound = 3
1522
1523 /a(?(1)b)(.)/I
1524 Capturing subpattern count = 1
1525 Max back reference = 1
1526 First code unit = 'a'
1527 Subject length lower bound = 2
1528
1529 /a(?(1)bag|big)(.)/I
1530 Capturing subpattern count = 1
1531 Max back reference = 1
1532 First code unit = 'a'
1533 Last code unit = 'g'
1534 Subject length lower bound = 5
1535
1536 /a(?(1)bag|big)*(.)/I
1537 Capturing subpattern count = 1
1538 Max back reference = 1
1539 First code unit = 'a'
1540 Subject length lower bound = 2
1541
1542 /a(?(1)bag|big)+(.)/I
1543 Capturing subpattern count = 1
1544 Max back reference = 1
1545 First code unit = 'a'
1546 Last code unit = 'g'
1547 Subject length lower bound = 5
1548
1549 /a(?(1)b..|b..)(.)/I
1550 Capturing subpattern count = 1
1551 Max back reference = 1
1552 First code unit = 'a'
1553 Last code unit = 'b'
1554 Subject length lower bound = 5
1555
1556 /ab\d{0}e/I
1557 Capturing subpattern count = 0
1558 First code unit = 'a'
1559 Last code unit = 'e'
1560 Subject length lower bound = 3
1561
1562 /a?b?/I
1563 Capturing subpattern count = 0
1564 May match empty string
1565 Subject length lower bound = 0
1566     a
1567  0: a
1568     b
1569  0: b
1570     ab
1571  0: ab
1572     \
1573  0: 
1574 \= Expect no match
1575     \=notempty
1576 No match
1577
1578 /|-/I
1579 Capturing subpattern count = 0
1580 May match empty string
1581 Subject length lower bound = 0
1582     abcd
1583  0: 
1584     -abc
1585  0: 
1586     ab-c\=notempty
1587  0: -
1588 \= Expect no match
1589     abc\=notempty
1590 No match
1591
1592 /^.?abcd/I
1593 Capturing subpattern count = 0
1594 Compile options: <none>
1595 Overall options: anchored
1596 Last code unit = 'd'
1597 Subject length lower bound = 4
1598
1599 /\(             # ( at start
1600   (?:           # Non-capturing bracket
1601   (?>[^()]+)    # Either a sequence of non-brackets (no backtracking)
1602   |             # Or
1603   (?R)          # Recurse - i.e. nested bracketed string
1604   )*            # Zero or more contents
1605   \)            # Closing )
1606   /Ix
1607 Capturing subpattern count = 0
1608 Options: extended
1609 First code unit = '('
1610 Last code unit = ')'
1611 Subject length lower bound = 2
1612     (abcd)
1613  0: (abcd)
1614     (abcd)xyz
1615  0: (abcd)
1616     xyz(abcd)
1617  0: (abcd)
1618     (ab(xy)cd)pqr
1619  0: (ab(xy)cd)
1620     (ab(xycd)pqr
1621  0: (xycd)
1622     () abc ()
1623  0: ()
1624     12(abcde(fsh)xyz(foo(bar))lmno)89
1625  0: (abcde(fsh)xyz(foo(bar))lmno)
1626 \= Expect no match
1627     abcd
1628 No match
1629     abcd)
1630 No match
1631     (abcd
1632 No match
1633
1634 /\(  ( (?>[^()]+) | (?R) )* \) /Igx
1635 Capturing subpattern count = 1
1636 Options: extended
1637 First code unit = '('
1638 Last code unit = ')'
1639 Subject length lower bound = 2
1640     (ab(xy)cd)pqr
1641  0: (ab(xy)cd)
1642  1: cd
1643     1(abcd)(x(y)z)pqr
1644  0: (abcd)
1645  1: abcd
1646  0: (x(y)z)
1647  1: z
1648
1649 /\(  (?: (?>[^()]+) | (?R) ) \) /Ix
1650 Capturing subpattern count = 0
1651 Options: extended
1652 First code unit = '('
1653 Last code unit = ')'
1654 Subject length lower bound = 3
1655     (abcd)
1656  0: (abcd)
1657     (ab(xy)cd)
1658  0: (xy)
1659     (a(b(c)d)e)
1660  0: (c)
1661     ((ab))
1662  0: ((ab))
1663 \= Expect no match
1664     ()
1665 No match
1666
1667 /\(  (?: (?>[^()]+) | (?R) )? \) /Ix
1668 Capturing subpattern count = 0
1669 Options: extended
1670 First code unit = '('
1671 Last code unit = ')'
1672 Subject length lower bound = 2
1673     ()
1674  0: ()
1675     12(abcde(fsh)xyz(foo(bar))lmno)89
1676  0: (fsh)
1677
1678 /\(  ( (?>[^()]+) | (?R) )* \) /Ix
1679 Capturing subpattern count = 1
1680 Options: extended
1681 First code unit = '('
1682 Last code unit = ')'
1683 Subject length lower bound = 2
1684     (ab(xy)cd)
1685  0: (ab(xy)cd)
1686  1: cd
1687
1688 /\( ( ( (?>[^()]+) | (?R) )* ) \) /Ix
1689 Capturing subpattern count = 2
1690 Options: extended
1691 First code unit = '('
1692 Last code unit = ')'
1693 Subject length lower bound = 2
1694     (ab(xy)cd)
1695  0: (ab(xy)cd)
1696  1: ab(xy)cd
1697  2: cd
1698
1699 /\( (123)? ( ( (?>[^()]+) | (?R) )* ) \) /Ix
1700 Capturing subpattern count = 3
1701 Options: extended
1702 First code unit = '('
1703 Last code unit = ')'
1704 Subject length lower bound = 2
1705     (ab(xy)cd)
1706  0: (ab(xy)cd)
1707  1: <unset>
1708  2: ab(xy)cd
1709  3: cd
1710     (123ab(xy)cd)
1711  0: (123ab(xy)cd)
1712  1: 123
1713  2: ab(xy)cd
1714  3: cd
1715
1716 /\( ( (123)? ( (?>[^()]+) | (?R) )* ) \) /Ix
1717 Capturing subpattern count = 3
1718 Options: extended
1719 First code unit = '('
1720 Last code unit = ')'
1721 Subject length lower bound = 2
1722     (ab(xy)cd)
1723  0: (ab(xy)cd)
1724  1: ab(xy)cd
1725  2: <unset>
1726  3: cd
1727     (123ab(xy)cd)
1728  0: (123ab(xy)cd)
1729  1: 123ab(xy)cd
1730  2: 123
1731  3: cd
1732
1733 /\( (((((((((( ( (?>[^()]+) | (?R) )* )))))))))) \) /Ix
1734 Capturing subpattern count = 11
1735 Options: extended
1736 First code unit = '('
1737 Last code unit = ')'
1738 Subject length lower bound = 2
1739     (ab(xy)cd)
1740  0: (ab(xy)cd)
1741  1: ab(xy)cd
1742  2: ab(xy)cd
1743  3: ab(xy)cd
1744  4: ab(xy)cd
1745  5: ab(xy)cd
1746  6: ab(xy)cd
1747  7: ab(xy)cd
1748  8: ab(xy)cd
1749  9: ab(xy)cd
1750 10: ab(xy)cd
1751 11: cd
1752
1753 /\( ( ( (?>[^()<>]+) | ((?>[^()]+)) | (?R) )* ) \) /Ix
1754 Capturing subpattern count = 3
1755 Options: extended
1756 First code unit = '('
1757 Last code unit = ')'
1758 Subject length lower bound = 2
1759     (abcd(xyz<p>qrs)123)
1760  0: (abcd(xyz<p>qrs)123)
1761  1: abcd(xyz<p>qrs)123
1762  2: 123
1763
1764 /\( ( ( (?>[^()]+) | ((?R)) )* ) \) /Ix
1765 Capturing subpattern count = 3
1766 Options: extended
1767 First code unit = '('
1768 Last code unit = ')'
1769 Subject length lower bound = 2
1770     (ab(cd)ef)
1771  0: (ab(cd)ef)
1772  1: ab(cd)ef
1773  2: ef
1774  3: (cd)
1775     (ab(cd(ef)gh)ij)
1776  0: (ab(cd(ef)gh)ij)
1777  1: ab(cd(ef)gh)ij
1778  2: ij
1779  3: (cd(ef)gh)
1780
1781 /^[[:alnum:]]/IB
1782 ------------------------------------------------------------------
1783         Bra
1784         ^
1785         [0-9A-Za-z]
1786         Ket
1787         End
1788 ------------------------------------------------------------------
1789 Capturing subpattern count = 0
1790 Compile options: <none>
1791 Overall options: anchored
1792 Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P 
1793   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 
1794 Subject length lower bound = 1
1795
1796 /^[[:^alnum:]]/IB
1797 ------------------------------------------------------------------
1798         Bra
1799         ^
1800         [\x00-/:-@[-`{-\xff] (neg)
1801         Ket
1802         End
1803 ------------------------------------------------------------------
1804 Capturing subpattern count = 0
1805 Compile options: <none>
1806 Overall options: anchored
1807 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
1808   \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 
1809   \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / : ; < = > 
1810   ? @ [ \ ] ^ _ ` { | } ~ \x7f \x80 \x81 \x82 \x83 \x84 \x85 \x86 \x87 \x88 
1811   \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93 \x94 \x95 \x96 \x97 
1812   \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 
1813   \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 
1814   \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 
1815   \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 
1816   \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 
1817   \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee \xef \xf0 \xf1 
1818   \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc \xfd \xfe \xff 
1819 Subject length lower bound = 1
1820
1821 /^[[:alpha:]]/IB
1822 ------------------------------------------------------------------
1823         Bra
1824         ^
1825         [A-Za-z]
1826         Ket
1827         End
1828 ------------------------------------------------------------------
1829 Capturing subpattern count = 0
1830 Compile options: <none>
1831 Overall options: anchored
1832 Starting code units: 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 
1833   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 
1834 Subject length lower bound = 1
1835
1836 /^[[:^alpha:]]/IB
1837 ------------------------------------------------------------------
1838         Bra
1839         ^
1840         [\x00-@[-`{-\xff] (neg)
1841         Ket
1842         End
1843 ------------------------------------------------------------------
1844 Capturing subpattern count = 0
1845 Compile options: <none>
1846 Overall options: anchored
1847 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
1848   \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 
1849   \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 
1850   5 6 7 8 9 : ; < = > ? @ [ \ ] ^ _ ` { | } ~ \x7f \x80 \x81 \x82 \x83 \x84 
1851   \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93 
1852   \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1 \xa2 
1853   \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0 \xb1 
1854   \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf \xc0 
1855   \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf 
1856   \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde 
1857   \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed 
1858   \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc 
1859   \xfd \xfe \xff 
1860 Subject length lower bound = 1
1861
1862 /[_[:alpha:]]/I
1863 Capturing subpattern count = 0
1864 Starting code units: 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 
1865   _ 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 
1866 Subject length lower bound = 1
1867
1868 /^[[:ascii:]]/IB
1869 ------------------------------------------------------------------
1870         Bra
1871         ^
1872         [\x00-\x7f]
1873         Ket
1874         End
1875 ------------------------------------------------------------------
1876 Capturing subpattern count = 0
1877 Compile options: <none>
1878 Overall options: anchored
1879 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
1880   \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 
1881   \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 
1882   5 6 7 8 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 
1883   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 { | } ~ 
1884   \x7f 
1885 Subject length lower bound = 1
1886
1887 /^[[:^ascii:]]/IB
1888 ------------------------------------------------------------------
1889         Bra
1890         ^
1891         [\x80-\xff] (neg)
1892         Ket
1893         End
1894 ------------------------------------------------------------------
1895 Capturing subpattern count = 0
1896 Compile options: <none>
1897 Overall options: anchored
1898 Starting code units: \x80 \x81 \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a 
1899   \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 
1900   \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 
1901   \xa9 \xaa \xab \xac \xad \xae \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 
1902   \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 
1903   \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 
1904   \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 
1905   \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 
1906   \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc \xfd \xfe \xff 
1907 Subject length lower bound = 1
1908
1909 /^[[:blank:]]/IB
1910 ------------------------------------------------------------------
1911         Bra
1912         ^
1913         [\x09 ]
1914         Ket
1915         End
1916 ------------------------------------------------------------------
1917 Capturing subpattern count = 0
1918 Compile options: <none>
1919 Overall options: anchored
1920 Starting code units: \x09 \x20 
1921 Subject length lower bound = 1
1922
1923 /^[[:^blank:]]/IB
1924 ------------------------------------------------------------------
1925         Bra
1926         ^
1927         [\x00-\x08\x0a-\x1f!-\xff] (neg)
1928         Ket
1929         End
1930 ------------------------------------------------------------------
1931 Capturing subpattern count = 0
1932 Compile options: <none>
1933 Overall options: anchored
1934 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0a \x0b 
1935   \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a 
1936   \x1b \x1c \x1d \x1e \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 
1937   : ; < = > ? @ 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 [ \ ] ^ 
1938   _ ` 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 { | } ~ \x7f \x80 
1939   \x81 \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f 
1940   \x90 \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e 
1941   \x9f \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad 
1942   \xae \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc 
1943   \xbd \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb 
1944   \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda 
1945   \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 
1946   \xea \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 
1947   \xf9 \xfa \xfb \xfc \xfd \xfe \xff 
1948 Subject length lower bound = 1
1949
1950 /[\n\x0b\x0c\x0d[:blank:]]/I
1951 Capturing subpattern count = 0
1952 Contains explicit CR or LF match
1953 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 
1954 Subject length lower bound = 1
1955
1956 /^[[:cntrl:]]/IB
1957 ------------------------------------------------------------------
1958         Bra
1959         ^
1960         [\x00-\x1f\x7f]
1961         Ket
1962         End
1963 ------------------------------------------------------------------
1964 Capturing subpattern count = 0
1965 Compile options: <none>
1966 Overall options: anchored
1967 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
1968   \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 
1969   \x1a \x1b \x1c \x1d \x1e \x1f \x7f 
1970 Subject length lower bound = 1
1971
1972 /^[[:digit:]]/IB
1973 ------------------------------------------------------------------
1974         Bra
1975         ^
1976         [0-9]
1977         Ket
1978         End
1979 ------------------------------------------------------------------
1980 Capturing subpattern count = 0
1981 Compile options: <none>
1982 Overall options: anchored
1983 Starting code units: 0 1 2 3 4 5 6 7 8 9 
1984 Subject length lower bound = 1
1985
1986 /^[[:graph:]]/IB
1987 ------------------------------------------------------------------
1988         Bra
1989         ^
1990         [!-~]
1991         Ket
1992         End
1993 ------------------------------------------------------------------
1994 Capturing subpattern count = 0
1995 Compile options: <none>
1996 Overall options: anchored
1997 Starting code units: ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : 
1998   ; < = > ? @ 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 [ \ ] ^ _ 
1999   ` 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 { | } ~ 
2000 Subject length lower bound = 1
2001
2002 /^[[:lower:]]/IB
2003 ------------------------------------------------------------------
2004         Bra
2005         ^
2006         [a-z]
2007         Ket
2008         End
2009 ------------------------------------------------------------------
2010 Capturing subpattern count = 0
2011 Compile options: <none>
2012 Overall options: anchored
2013 Starting code units: 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 
2014 Subject length lower bound = 1
2015
2016 /^[[:print:]]/IB
2017 ------------------------------------------------------------------
2018         Bra
2019         ^
2020         [ -~]
2021         Ket
2022         End
2023 ------------------------------------------------------------------
2024 Capturing subpattern count = 0
2025 Compile options: <none>
2026 Overall options: anchored
2027 Starting code units: \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 
2028   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 [ \ ] 
2029   ^ _ ` 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 { | } ~ 
2030 Subject length lower bound = 1
2031
2032 /^[[:punct:]]/IB
2033 ------------------------------------------------------------------
2034         Bra
2035         ^
2036         [!-/:-@[-`{-~]
2037         Ket
2038         End
2039 ------------------------------------------------------------------
2040 Capturing subpattern count = 0
2041 Compile options: <none>
2042 Overall options: anchored
2043 Starting code units: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ 
2044   _ ` { | } ~ 
2045 Subject length lower bound = 1
2046
2047 /^[[:space:]]/IB
2048 ------------------------------------------------------------------
2049         Bra
2050         ^
2051         [\x09-\x0d ]
2052         Ket
2053         End
2054 ------------------------------------------------------------------
2055 Capturing subpattern count = 0
2056 Compile options: <none>
2057 Overall options: anchored
2058 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 
2059 Subject length lower bound = 1
2060
2061 /^[[:upper:]]/IB
2062 ------------------------------------------------------------------
2063         Bra
2064         ^
2065         [A-Z]
2066         Ket
2067         End
2068 ------------------------------------------------------------------
2069 Capturing subpattern count = 0
2070 Compile options: <none>
2071 Overall options: anchored
2072 Starting code units: 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 
2073 Subject length lower bound = 1
2074
2075 /^[[:xdigit:]]/IB
2076 ------------------------------------------------------------------
2077         Bra
2078         ^
2079         [0-9A-Fa-f]
2080         Ket
2081         End
2082 ------------------------------------------------------------------
2083 Capturing subpattern count = 0
2084 Compile options: <none>
2085 Overall options: anchored
2086 Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f 
2087 Subject length lower bound = 1
2088
2089 /^[[:word:]]/IB
2090 ------------------------------------------------------------------
2091         Bra
2092         ^
2093         [0-9A-Z_a-z]
2094         Ket
2095         End
2096 ------------------------------------------------------------------
2097 Capturing subpattern count = 0
2098 Compile options: <none>
2099 Overall options: anchored
2100 Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P 
2101   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 
2102 Subject length lower bound = 1
2103
2104 /^[[:^cntrl:]]/IB
2105 ------------------------------------------------------------------
2106         Bra
2107         ^
2108         [ -~\x80-\xff] (neg)
2109         Ket
2110         End
2111 ------------------------------------------------------------------
2112 Capturing subpattern count = 0
2113 Compile options: <none>
2114 Overall options: anchored
2115 Starting code units: \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 
2116   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 [ \ ] 
2117   ^ _ ` 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 { | } ~ \x80 \x81 
2118   \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 
2119   \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f 
2120   \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae 
2121   \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd 
2122   \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc 
2123   \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb 
2124   \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea 
2125   \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 
2126   \xfa \xfb \xfc \xfd \xfe \xff 
2127 Subject length lower bound = 1
2128
2129 /^[12[:^digit:]]/IB
2130 ------------------------------------------------------------------
2131         Bra
2132         ^
2133         [\x00-/12:-\xff] (neg)
2134         Ket
2135         End
2136 ------------------------------------------------------------------
2137 Capturing subpattern count = 0
2138 Compile options: <none>
2139 Overall options: anchored
2140 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
2141   \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 
2142   \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / 1 2 : ; < 
2143   = > ? @ 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 
2144   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 { | } ~ \x7f \x80 \x81 \x82 
2145   \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 
2146   \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 
2147   \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf 
2148   \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe 
2149   \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd 
2150   \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc 
2151   \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb 
2152   \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa 
2153   \xfb \xfc \xfd \xfe \xff 
2154 Subject length lower bound = 1
2155
2156 /^[[:^blank:]]/IB
2157 ------------------------------------------------------------------
2158         Bra
2159         ^
2160         [\x00-\x08\x0a-\x1f!-\xff] (neg)
2161         Ket
2162         End
2163 ------------------------------------------------------------------
2164 Capturing subpattern count = 0
2165 Compile options: <none>
2166 Overall options: anchored
2167 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0a \x0b 
2168   \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a 
2169   \x1b \x1c \x1d \x1e \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 
2170   : ; < = > ? @ 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 [ \ ] ^ 
2171   _ ` 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 { | } ~ \x7f \x80 
2172   \x81 \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f 
2173   \x90 \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e 
2174   \x9f \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad 
2175   \xae \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc 
2176   \xbd \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb 
2177   \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda 
2178   \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 
2179   \xea \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 
2180   \xf9 \xfa \xfb \xfc \xfd \xfe \xff 
2181 Subject length lower bound = 1
2182
2183 /[01[:alpha:]%]/IB
2184 ------------------------------------------------------------------
2185         Bra
2186         [%01A-Za-z]
2187         Ket
2188         End
2189 ------------------------------------------------------------------
2190 Capturing subpattern count = 0
2191 Starting code units: % 0 1 A B C D E F G H I J K L M N O P Q R S T U V W 
2192   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 
2193 Subject length lower bound = 1
2194
2195 /[[.ch.]]/I
2196 Failed: error 113 at offset 1: POSIX collating elements are not supported
2197
2198 /[[=ch=]]/I
2199 Failed: error 113 at offset 1: POSIX collating elements are not supported
2200
2201 /[[:rhubarb:]]/I
2202 Failed: error 130 at offset 3: unknown POSIX class name
2203
2204 /[[:upper:]]/Ii
2205 Capturing subpattern count = 0
2206 Options: caseless
2207 Starting code units: 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 
2208   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 
2209 Subject length lower bound = 1
2210     A
2211  0: A
2212     a
2213  0: a
2214
2215 /[[:lower:]]/Ii
2216 Capturing subpattern count = 0
2217 Options: caseless
2218 Starting code units: 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 
2219   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 
2220 Subject length lower bound = 1
2221     A
2222  0: A
2223     a
2224  0: a
2225
2226 /((?-i)[[:lower:]])[[:lower:]]/Ii
2227 Capturing subpattern count = 1
2228 Options: caseless
2229 Starting code units: 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 
2230 Subject length lower bound = 2
2231     ab
2232  0: ab
2233  1: a
2234     aB
2235  0: aB
2236  1: a
2237 \= Expect no match
2238     Ab
2239 No match
2240     AB
2241 No match
2242
2243 /[\200-\110]/I
2244 Failed: error 108 at offset 9: range out of order in character class
2245
2246 /^(?(0)f|b)oo/I
2247 Failed: error 115 at offset 5: reference to non-existent subpattern
2248
2249 # This one's here because of the large output vector needed
2250
2251 /(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\w+)\s+(\270)/I
2252 Capturing subpattern count = 271
2253 Max back reference = 270
2254 Starting code units: 0 1 2 3 4 5 6 7 8 9 
2255 Subject length lower bound = 0
2256      1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 ABC ABC\=ovector=300
2257  0: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 ABC ABC
2258  1: 1 
2259  2: 2 
2260  3: 3 
2261  4: 4 
2262  5: 5 
2263  6: 6 
2264  7: 7 
2265  8: 8 
2266  9: 9 
2267 10: 10 
2268 11: 11 
2269 12: 12 
2270 13: 13 
2271 14: 14 
2272 15: 15 
2273 16: 16 
2274 17: 17 
2275 18: 18 
2276 19: 19 
2277 20: 20 
2278 21: 21 
2279 22: 22 
2280 23: 23 
2281 24: 24 
2282 25: 25 
2283 26: 26 
2284 27: 27 
2285 28: 28 
2286 29: 29 
2287 30: 30 
2288 31: 31 
2289 32: 32 
2290 33: 33 
2291 34: 34 
2292 35: 35 
2293 36: 36 
2294 37: 37 
2295 38: 38 
2296 39: 39 
2297 40: 40 
2298 41: 41 
2299 42: 42 
2300 43: 43 
2301 44: 44 
2302 45: 45 
2303 46: 46 
2304 47: 47 
2305 48: 48 
2306 49: 49 
2307 50: 50 
2308 51: 51 
2309 52: 52 
2310 53: 53 
2311 54: 54 
2312 55: 55 
2313 56: 56 
2314 57: 57 
2315 58: 58 
2316 59: 59 
2317 60: 60 
2318 61: 61 
2319 62: 62 
2320 63: 63 
2321 64: 64 
2322 65: 65 
2323 66: 66 
2324 67: 67 
2325 68: 68 
2326 69: 69 
2327 70: 70 
2328 71: 71 
2329 72: 72 
2330 73: 73 
2331 74: 74 
2332 75: 75 
2333 76: 76 
2334 77: 77 
2335 78: 78 
2336 79: 79 
2337 80: 80 
2338 81: 81 
2339 82: 82 
2340 83: 83 
2341 84: 84 
2342 85: 85 
2343 86: 86 
2344 87: 87 
2345 88: 88 
2346 89: 89 
2347 90: 90 
2348 91: 91 
2349 92: 92 
2350 93: 93 
2351 94: 94 
2352 95: 95 
2353 96: 96 
2354 97: 97 
2355 98: 98 
2356 99: 99 
2357 100: 100 
2358 101: 101 
2359 102: 102 
2360 103: 103 
2361 104: 104 
2362 105: 105 
2363 106: 106 
2364 107: 107 
2365 108: 108 
2366 109: 109 
2367 110: 110 
2368 111: 111 
2369 112: 112 
2370 113: 113 
2371 114: 114 
2372 115: 115 
2373 116: 116 
2374 117: 117 
2375 118: 118 
2376 119: 119 
2377 120: 120 
2378 121: 121 
2379 122: 122 
2380 123: 123 
2381 124: 124 
2382 125: 125 
2383 126: 126 
2384 127: 127 
2385 128: 128 
2386 129: 129 
2387 130: 130 
2388 131: 131 
2389 132: 132 
2390 133: 133 
2391 134: 134 
2392 135: 135 
2393 136: 136 
2394 137: 137 
2395 138: 138 
2396 139: 139 
2397 140: 140 
2398 141: 141 
2399 142: 142 
2400 143: 143 
2401 144: 144 
2402 145: 145 
2403 146: 146 
2404 147: 147 
2405 148: 148 
2406 149: 149 
2407 150: 150 
2408 151: 151 
2409 152: 152 
2410 153: 153 
2411 154: 154 
2412 155: 155 
2413 156: 156 
2414 157: 157 
2415 158: 158 
2416 159: 159 
2417 160: 160 
2418 161: 161 
2419 162: 162 
2420 163: 163 
2421 164: 164 
2422 165: 165 
2423 166: 166 
2424 167: 167 
2425 168: 168 
2426 169: 169 
2427 170: 170 
2428 171: 171 
2429 172: 172 
2430 173: 173 
2431 174: 174 
2432 175: 175 
2433 176: 176 
2434 177: 177 
2435 178: 178 
2436 179: 179 
2437 180: 180 
2438 181: 181 
2439 182: 182 
2440 183: 183 
2441 184: 184 
2442 185: 185 
2443 186: 186 
2444 187: 187 
2445 188: 188 
2446 189: 189 
2447 190: 190 
2448 191: 191 
2449 192: 192 
2450 193: 193 
2451 194: 194 
2452 195: 195 
2453 196: 196 
2454 197: 197 
2455 198: 198 
2456 199: 199 
2457 200: 200 
2458 201: 201 
2459 202: 202 
2460 203: 203 
2461 204: 204 
2462 205: 205 
2463 206: 206 
2464 207: 207 
2465 208: 208 
2466 209: 209 
2467 210: 210 
2468 211: 211 
2469 212: 212 
2470 213: 213 
2471 214: 214 
2472 215: 215 
2473 216: 216 
2474 217: 217 
2475 218: 218 
2476 219: 219 
2477 220: 220 
2478 221: 221 
2479 222: 222 
2480 223: 223 
2481 224: 224 
2482 225: 225 
2483 226: 226 
2484 227: 227 
2485 228: 228 
2486 229: 229 
2487 230: 230 
2488 231: 231 
2489 232: 232 
2490 233: 233 
2491 234: 234 
2492 235: 235 
2493 236: 236 
2494 237: 237 
2495 238: 238 
2496 239: 239 
2497 240: 240 
2498 241: 241 
2499 242: 242 
2500 243: 243 
2501 244: 244 
2502 245: 245 
2503 246: 246 
2504 247: 247 
2505 248: 248 
2506 249: 249 
2507 250: 250 
2508 251: 251 
2509 252: 252 
2510 253: 253 
2511 254: 254 
2512 255: 255 
2513 256: 256 
2514 257: 257 
2515 258: 258 
2516 259: 259 
2517 260: 260 
2518 261: 261 
2519 262: 262 
2520 263: 263 
2521 264: 264 
2522 265: 265 
2523 266: 266 
2524 267: 267 
2525 268: 268 
2526 269: 269 
2527 270: ABC
2528 271: ABC
2529
2530 # This one's here because Perl does this differently and PCRE2 can't at present
2531
2532 /(main(O)?)+/I
2533 Capturing subpattern count = 2
2534 First code unit = 'm'
2535 Last code unit = 'n'
2536 Subject length lower bound = 4
2537     mainmain
2538  0: mainmain
2539  1: main
2540     mainOmain
2541  0: mainOmain
2542  1: main
2543  2: O
2544
2545 # These are all cases where Perl does it differently (nested captures)
2546
2547 /^(a(b)?)+$/I
2548 Capturing subpattern count = 2
2549 Compile options: <none>
2550 Overall options: anchored
2551 First code unit = 'a'
2552 Subject length lower bound = 1
2553     aba
2554  0: aba
2555  1: a
2556  2: b
2557
2558 /^(aa(bb)?)+$/I
2559 Capturing subpattern count = 2
2560 Compile options: <none>
2561 Overall options: anchored
2562 First code unit = 'a'
2563 Subject length lower bound = 2
2564     aabbaa
2565  0: aabbaa
2566  1: aa
2567  2: bb
2568
2569 /^(aa|aa(bb))+$/I
2570 Capturing subpattern count = 2
2571 Compile options: <none>
2572 Overall options: anchored
2573 First code unit = 'a'
2574 Subject length lower bound = 2
2575     aabbaa
2576  0: aabbaa
2577  1: aa
2578  2: bb
2579
2580 /^(aa(bb)??)+$/I
2581 Capturing subpattern count = 2
2582 Compile options: <none>
2583 Overall options: anchored
2584 First code unit = 'a'
2585 Subject length lower bound = 2
2586     aabbaa
2587  0: aabbaa
2588  1: aa
2589  2: bb
2590
2591 /^(?:aa(bb)?)+$/I
2592 Capturing subpattern count = 1
2593 Compile options: <none>
2594 Overall options: anchored
2595 First code unit = 'a'
2596 Subject length lower bound = 2
2597     aabbaa
2598  0: aabbaa
2599  1: bb
2600
2601 /^(aa(b(b))?)+$/I
2602 Capturing subpattern count = 3
2603 Compile options: <none>
2604 Overall options: anchored
2605 First code unit = 'a'
2606 Subject length lower bound = 2
2607     aabbaa
2608  0: aabbaa
2609  1: aa
2610  2: bb
2611  3: b
2612
2613 /^(?:aa(b(b))?)+$/I
2614 Capturing subpattern count = 2
2615 Compile options: <none>
2616 Overall options: anchored
2617 First code unit = 'a'
2618 Subject length lower bound = 2
2619     aabbaa
2620  0: aabbaa
2621  1: bb
2622  2: b
2623
2624 /^(?:aa(b(?:b))?)+$/I
2625 Capturing subpattern count = 1
2626 Compile options: <none>
2627 Overall options: anchored
2628 First code unit = 'a'
2629 Subject length lower bound = 2
2630     aabbaa
2631  0: aabbaa
2632  1: bb
2633
2634 /^(?:aa(bb(?:b))?)+$/I
2635 Capturing subpattern count = 1
2636 Compile options: <none>
2637 Overall options: anchored
2638 First code unit = 'a'
2639 Subject length lower bound = 2
2640     aabbbaa
2641  0: aabbbaa
2642  1: bbb
2643
2644 /^(?:aa(b(?:bb))?)+$/I
2645 Capturing subpattern count = 1
2646 Compile options: <none>
2647 Overall options: anchored
2648 First code unit = 'a'
2649 Subject length lower bound = 2
2650     aabbbaa
2651  0: aabbbaa
2652  1: bbb
2653
2654 /^(?:aa(?:b(b))?)+$/I
2655 Capturing subpattern count = 1
2656 Compile options: <none>
2657 Overall options: anchored
2658 First code unit = 'a'
2659 Subject length lower bound = 2
2660     aabbaa
2661  0: aabbaa
2662  1: b
2663
2664 /^(?:aa(?:b(bb))?)+$/I
2665 Capturing subpattern count = 1
2666 Compile options: <none>
2667 Overall options: anchored
2668 First code unit = 'a'
2669 Subject length lower bound = 2
2670     aabbbaa
2671  0: aabbbaa
2672  1: bb
2673
2674 /^(aa(b(bb))?)+$/I
2675 Capturing subpattern count = 3
2676 Compile options: <none>
2677 Overall options: anchored
2678 First code unit = 'a'
2679 Subject length lower bound = 2
2680     aabbbaa
2681  0: aabbbaa
2682  1: aa
2683  2: bbb
2684  3: bb
2685
2686 /^(aa(bb(bb))?)+$/I
2687 Capturing subpattern count = 3
2688 Compile options: <none>
2689 Overall options: anchored
2690 First code unit = 'a'
2691 Subject length lower bound = 2
2692     aabbbbaa
2693  0: aabbbbaa
2694  1: aa
2695  2: bbbb
2696  3: bb
2697
2698 # ----------------
2699
2700 /#/IBx
2701 ------------------------------------------------------------------
2702         Bra
2703         Ket
2704         End
2705 ------------------------------------------------------------------
2706 Capturing subpattern count = 0
2707 May match empty string
2708 Options: extended
2709 Subject length lower bound = 0
2710
2711 /a#/IBx
2712 ------------------------------------------------------------------
2713         Bra
2714         a
2715         Ket
2716         End
2717 ------------------------------------------------------------------
2718 Capturing subpattern count = 0
2719 Options: extended
2720 First code unit = 'a'
2721 Subject length lower bound = 1
2722
2723 /[\s]/IB
2724 ------------------------------------------------------------------
2725         Bra
2726         [\x09-\x0d ]
2727         Ket
2728         End
2729 ------------------------------------------------------------------
2730 Capturing subpattern count = 0
2731 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 
2732 Subject length lower bound = 1
2733
2734 /[\S]/IB
2735 ------------------------------------------------------------------
2736         Bra
2737         [\x00-\x08\x0e-\x1f!-\xff] (neg)
2738         Ket
2739         End
2740 ------------------------------------------------------------------
2741 Capturing subpattern count = 0
2742 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0e \x0f 
2743   \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d \x1e 
2744   \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C 
2745   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 
2746   i j k l m n o p q r s t u v w x y z { | } ~ \x7f \x80 \x81 \x82 \x83 \x84 
2747   \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92 \x93 
2748   \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1 \xa2 
2749   \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0 \xb1 
2750   \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf \xc0 
2751   \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf 
2752   \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd \xde 
2753   \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec \xed 
2754   \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb \xfc 
2755   \xfd \xfe \xff 
2756 Subject length lower bound = 1
2757
2758 /a(?i)b/IB
2759 ------------------------------------------------------------------
2760         Bra
2761         a
2762      /i b
2763         Ket
2764         End
2765 ------------------------------------------------------------------
2766 Capturing subpattern count = 0
2767 First code unit = 'a'
2768 Last code unit = 'b' (caseless)
2769 Subject length lower bound = 2
2770     ab
2771  0: ab
2772     aB
2773  0: aB
2774 \= Expect no match
2775     AB
2776 No match
2777
2778 /(a(?i)b)/IB
2779 ------------------------------------------------------------------
2780         Bra
2781         CBra 1
2782         a
2783      /i b
2784         Ket
2785         Ket
2786         End
2787 ------------------------------------------------------------------
2788 Capturing subpattern count = 1
2789 First code unit = 'a'
2790 Last code unit = 'b' (caseless)
2791 Subject length lower bound = 2
2792     ab
2793  0: ab
2794  1: ab
2795     aB
2796  0: aB
2797  1: aB
2798 \= Expect no match
2799     AB
2800 No match
2801
2802 /   (?i)abc/IBx
2803 ------------------------------------------------------------------
2804         Bra
2805      /i abc
2806         Ket
2807         End
2808 ------------------------------------------------------------------
2809 Capturing subpattern count = 0
2810 Options: extended
2811 First code unit = 'a' (caseless)
2812 Last code unit = 'c' (caseless)
2813 Subject length lower bound = 3
2814
2815 /#this is a comment
2816   (?i)abc/IBx
2817 ------------------------------------------------------------------
2818         Bra
2819      /i abc
2820         Ket
2821         End
2822 ------------------------------------------------------------------
2823 Capturing subpattern count = 0
2824 Options: extended
2825 First code unit = 'a' (caseless)
2826 Last code unit = 'c' (caseless)
2827 Subject length lower bound = 3
2828
2829 /123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/IB
2830 ------------------------------------------------------------------
2831         Bra
2832         123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
2833         Ket
2834         End
2835 ------------------------------------------------------------------
2836 Capturing subpattern count = 0
2837 First code unit = '1'
2838 Last code unit = '0'
2839 Subject length lower bound = 300
2840
2841 /\Q123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/IB
2842 ------------------------------------------------------------------
2843         Bra
2844         123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
2845         Ket
2846         End
2847 ------------------------------------------------------------------
2848 Capturing subpattern count = 0
2849 First code unit = '1'
2850 Last code unit = '0'
2851 Subject length lower bound = 300
2852
2853 /\Q\E/IB
2854 ------------------------------------------------------------------
2855         Bra
2856         Ket
2857         End
2858 ------------------------------------------------------------------
2859 Capturing subpattern count = 0
2860 May match empty string
2861 Subject length lower bound = 0
2862     \
2863  0: 
2864
2865 /\Q\Ex/IB
2866 ------------------------------------------------------------------
2867         Bra
2868         x
2869         Ket
2870         End
2871 ------------------------------------------------------------------
2872 Capturing subpattern count = 0
2873 First code unit = 'x'
2874 Subject length lower bound = 1
2875
2876 / \Q\E/IB
2877 ------------------------------------------------------------------
2878         Bra
2879          
2880         Ket
2881         End
2882 ------------------------------------------------------------------
2883 Capturing subpattern count = 0
2884 First code unit = ' '
2885 Subject length lower bound = 1
2886
2887 /a\Q\E/IB
2888 ------------------------------------------------------------------
2889         Bra
2890         a
2891         Ket
2892         End
2893 ------------------------------------------------------------------
2894 Capturing subpattern count = 0
2895 First code unit = 'a'
2896 Subject length lower bound = 1
2897   abc
2898  0: a
2899   bca
2900  0: a
2901   bac
2902  0: a
2903
2904 /a\Q\Eb/IB
2905 ------------------------------------------------------------------
2906         Bra
2907         ab
2908         Ket
2909         End
2910 ------------------------------------------------------------------
2911 Capturing subpattern count = 0
2912 First code unit = 'a'
2913 Last code unit = 'b'
2914 Subject length lower bound = 2
2915   abc
2916  0: ab
2917
2918 /\Q\Eabc/IB
2919 ------------------------------------------------------------------
2920         Bra
2921         abc
2922         Ket
2923         End
2924 ------------------------------------------------------------------
2925 Capturing subpattern count = 0
2926 First code unit = 'a'
2927 Last code unit = 'c'
2928 Subject length lower bound = 3
2929
2930 /x*+\w/IB
2931 ------------------------------------------------------------------
2932         Bra
2933         x*+
2934         \w
2935         Ket
2936         End
2937 ------------------------------------------------------------------
2938 Capturing subpattern count = 0
2939 Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P 
2940   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 
2941 Subject length lower bound = 1
2942 \= Expect no match
2943     xxxxx
2944 No match
2945
2946 /x?+/IB
2947 ------------------------------------------------------------------
2948         Bra
2949         x?+
2950         Ket
2951         End
2952 ------------------------------------------------------------------
2953 Capturing subpattern count = 0
2954 May match empty string
2955 Subject length lower bound = 0
2956
2957 /x++/IB
2958 ------------------------------------------------------------------
2959         Bra
2960         x++
2961         Ket
2962         End
2963 ------------------------------------------------------------------
2964 Capturing subpattern count = 0
2965 First code unit = 'x'
2966 Subject length lower bound = 1
2967
2968 /x{1,3}+/B,no_auto_possess
2969 ------------------------------------------------------------------
2970         Bra
2971         x
2972         x{0,2}+
2973         Ket
2974         End
2975 ------------------------------------------------------------------
2976
2977 /x{1,3}+/Bi,no_auto_possess
2978 ------------------------------------------------------------------
2979         Bra
2980      /i x
2981      /i x{0,2}+
2982         Ket
2983         End
2984 ------------------------------------------------------------------
2985
2986 /[^x]{1,3}+/B,no_auto_possess
2987 ------------------------------------------------------------------
2988         Bra
2989         [^x]
2990         [^x]{0,2}+
2991         Ket
2992         End
2993 ------------------------------------------------------------------
2994
2995 /[^x]{1,3}+/Bi,no_auto_possess
2996 ------------------------------------------------------------------
2997         Bra
2998      /i [^x]
2999      /i [^x]{0,2}+
3000         Ket
3001         End
3002 ------------------------------------------------------------------
3003
3004 /(x)*+/IB
3005 ------------------------------------------------------------------
3006         Bra
3007         Braposzero
3008         CBraPos 1
3009         x
3010         KetRpos
3011         Ket
3012         End
3013 ------------------------------------------------------------------
3014 Capturing subpattern count = 1
3015 May match empty string
3016 Subject length lower bound = 0
3017
3018 /^(\w++|\s++)*$/I
3019 Capturing subpattern count = 1
3020 May match empty string
3021 Compile options: <none>
3022 Overall options: anchored
3023 Subject length lower bound = 0
3024     now is the time for all good men to come to the aid of the party
3025  0: now is the time for all good men to come to the aid of the party
3026  1: party
3027 \= Expect no match
3028     this is not a line with only words and spaces!
3029 No match
3030
3031 /(\d++)(\w)/I
3032 Capturing subpattern count = 2
3033 Starting code units: 0 1 2 3 4 5 6 7 8 9 
3034 Subject length lower bound = 2
3035     12345a
3036  0: 12345a
3037  1: 12345
3038  2: a
3039 \= Expect no match
3040     12345+
3041 No match
3042
3043 /a++b/I
3044 Capturing subpattern count = 0
3045 First code unit = 'a'
3046 Last code unit = 'b'
3047 Subject length lower bound = 2
3048     aaab
3049  0: aaab
3050
3051 /(a++b)/I
3052 Capturing subpattern count = 1
3053 First code unit = 'a'
3054 Last code unit = 'b'
3055 Subject length lower bound = 2
3056     aaab
3057  0: aaab
3058  1: aaab
3059
3060 /(a++)b/I
3061 Capturing subpattern count = 1
3062 First code unit = 'a'
3063 Last code unit = 'b'
3064 Subject length lower bound = 2
3065     aaab
3066  0: aaab
3067  1: aaa
3068
3069 /([^()]++|\([^()]*\))+/I
3070 Capturing subpattern count = 1
3071 Starting code units: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a 
3072   \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 
3073   \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( * + , - . / 0 1 2 3 4 5 
3074   6 7 8 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 
3075   [ \ ] ^ _ ` 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 { | } ~ \x7f 
3076   \x80 \x81 \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e 
3077   \x8f \x90 \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d 
3078   \x9e \x9f \xa0 \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac 
3079   \xad \xae \xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb 
3080   \xbc \xbd \xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca 
3081   \xcb \xcc \xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 
3082   \xda \xdb \xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 
3083   \xe9 \xea \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 
3084   \xf8 \xf9 \xfa \xfb \xfc \xfd \xfe \xff 
3085 Subject length lower bound = 1
3086     ((abc(ade)ufh()()x
3087  0: abc(ade)ufh()()x
3088  1: x
3089
3090 /\(([^()]++|\([^()]+\))+\)/I
3091 Capturing subpattern count = 1
3092 First code unit = '('
3093 Last code unit = ')'
3094 Subject length lower bound = 3
3095     (abc)
3096  0: (abc)
3097  1: abc
3098     (abc(def)xyz)
3099  0: (abc(def)xyz)
3100  1: xyz
3101 \= Expect no match
3102     ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
3103 No match
3104
3105 /(abc){1,3}+/IB
3106 ------------------------------------------------------------------
3107         Bra
3108         Once
3109         CBra 1
3110         abc
3111         Ket
3112         Brazero
3113         Bra
3114         CBra 1
3115         abc
3116         Ket
3117         Brazero
3118         CBra 1
3119         abc
3120         Ket
3121         Ket
3122         Ket
3123         Ket
3124         End
3125 ------------------------------------------------------------------
3126 Capturing subpattern count = 1
3127 First code unit = 'a'
3128 Last code unit = 'c'
3129 Subject length lower bound = 3
3130
3131 /a+?+/I
3132 Failed: error 109 at offset 3: quantifier does not follow a repeatable item
3133
3134 /a{2,3}?+b/I
3135 Failed: error 109 at offset 7: quantifier does not follow a repeatable item
3136
3137 /(?U)a+?+/I
3138 Failed: error 109 at offset 7: quantifier does not follow a repeatable item
3139
3140 /a{2,3}?+b/I,ungreedy
3141 Failed: error 109 at offset 7: quantifier does not follow a repeatable item
3142
3143 /x(?U)a++b/IB
3144 ------------------------------------------------------------------
3145         Bra
3146         x
3147         a++
3148         b
3149         Ket
3150         End
3151 ------------------------------------------------------------------
3152 Capturing subpattern count = 0
3153 First code unit = 'x'
3154 Last code unit = 'b'
3155 Subject length lower bound = 3
3156     xaaaab
3157  0: xaaaab
3158
3159 /(?U)xa++b/IB
3160 ------------------------------------------------------------------
3161         Bra
3162         x
3163         a++
3164         b
3165         Ket
3166         End
3167 ------------------------------------------------------------------
3168 Capturing subpattern count = 0
3169 First code unit = 'x'
3170 Last code unit = 'b'
3171 Subject length lower bound = 3
3172     xaaaab
3173  0: xaaaab
3174
3175 /^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/IB
3176 ------------------------------------------------------------------
3177         Bra
3178         ^
3179         CBra 1
3180         CBra 2
3181         a+
3182         Ket
3183         CBra 3
3184         [ab]+?
3185         Ket
3186         CBra 4
3187         [bc]+
3188         Ket
3189         CBra 5
3190         \w*+
3191         Ket
3192         Ket
3193         Ket
3194         End
3195 ------------------------------------------------------------------
3196 Capturing subpattern count = 5
3197 Compile options: <none>
3198 Overall options: anchored
3199 First code unit = 'a'
3200 Subject length lower bound = 3
3201
3202 /^x(?U)a+b/IB
3203 ------------------------------------------------------------------
3204         Bra
3205         ^
3206         x
3207         a++
3208         b
3209         Ket
3210         End
3211 ------------------------------------------------------------------
3212 Capturing subpattern count = 0
3213 Compile options: <none>
3214 Overall options: anchored
3215 First code unit = 'x'
3216 Last code unit = 'b'
3217 Subject length lower bound = 3
3218
3219 /^x(?U)(a+)b/IB
3220 ------------------------------------------------------------------
3221         Bra
3222         ^
3223         x
3224         CBra 1
3225         a+?
3226         Ket
3227         b
3228         Ket
3229         End
3230 ------------------------------------------------------------------
3231 Capturing subpattern count = 1
3232 Compile options: <none>
3233 Overall options: anchored
3234 First code unit = 'x'
3235 Last code unit = 'b'
3236 Subject length lower bound = 3
3237
3238 /[.x.]/I
3239 Failed: error 113 at offset 0: POSIX collating elements are not supported
3240
3241 /[=x=]/I
3242 Failed: error 113 at offset 0: POSIX collating elements are not supported
3243
3244 /[:x:]/I
3245 Failed: error 112 at offset 0: POSIX named classes are supported only within a class
3246
3247 /\F/I
3248 Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
3249
3250 /\l/I
3251 Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
3252
3253 /\L/I
3254 Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
3255
3256 /\N{name}/I
3257 Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
3258
3259 /\u/I
3260 Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
3261
3262 /\U/I
3263 Failed: error 137 at offset 2: PCRE2 does not support \F, \L, \l, \N{name}, \U, or \u
3264
3265 /a{1,3}b/ungreedy
3266     ab
3267  0: ab
3268
3269 /[/I
3270 Failed: error 106 at offset 1: missing terminating ] for character class
3271
3272 /[a-/I
3273 Failed: error 106 at offset 3: missing terminating ] for character class
3274
3275 /[[:space:]/I
3276 Failed: error 106 at offset 10: missing terminating ] for character class
3277
3278 /[\s]/IB
3279 ------------------------------------------------------------------
3280         Bra
3281         [\x09-\x0d ]
3282         Ket
3283         End
3284 ------------------------------------------------------------------
3285 Capturing subpattern count = 0
3286 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 
3287 Subject length lower bound = 1
3288
3289 /[[:space:]]/IB
3290 ------------------------------------------------------------------
3291         Bra
3292         [\x09-\x0d ]
3293         Ket
3294         End
3295 ------------------------------------------------------------------
3296 Capturing subpattern count = 0
3297 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 
3298 Subject length lower bound = 1
3299
3300 /[[:space:]abcde]/IB
3301 ------------------------------------------------------------------
3302         Bra
3303         [\x09-\x0d a-e]
3304         Ket
3305         End
3306 ------------------------------------------------------------------
3307 Capturing subpattern count = 0
3308 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 a b c d e 
3309 Subject length lower bound = 1
3310
3311 /< (?: (?(R) \d++  | [^<>]*+) | (?R)) * >/Ix
3312 Capturing subpattern count = 0
3313 Options: extended
3314 First code unit = '<'
3315 Last code unit = '>'
3316 Subject length lower bound = 2
3317     <>
3318  0: <>
3319     <abcd>
3320  0: <abcd>
3321     <abc <123> hij>
3322  0: <abc <123> hij>
3323     <abc <def> hij>
3324  0: <def>
3325     <abc<>def>
3326  0: <abc<>def>
3327     <abc<>
3328  0: <>
3329 \= Expect no match
3330     <abc
3331 No match
3332
3333 /8J\$WE\<\.rX\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b/IB
3334 ------------------------------------------------------------------
3335         Bra
3336         8J$WE<.rX+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
3337         \b
3338         Ket
3339         End
3340 ------------------------------------------------------------------
3341 Capturing subpattern count = 0
3342 Max lookbehind = 1
3343 First code unit = '8'
3344 Last code unit = 'X'
3345 Subject length lower bound = 409
3346
3347 /\$\<\.X\+ix\[d1b\!H\#\?vV0vrK\:ZH1\=2M\>iV\;\?aPhFB\<\*vW\@QW\@sO9\}cfZA\-i\'w\%hKd6gt1UJP\,15_\#QY\$M\^Mss_U\/\]\&LK9\[5vQub\^w\[KDD\<EjmhUZ\?\.akp2dF\>qmj\;2\}YWFdYx\.Ap\]hjCPTP\(n28k\+3\;o\&WXqs\/gOXdr\$\:r\'do0\;b4c\(f_Gr\=\"\\4\)\[01T7ajQJvL\$W\~mL_sS\/4h\:x\*\[ZN\=KLs\&L5zX\/\/\>it\,o\:aU\(\;Z\>pW\&T7oP\'2K\^E\:x9\'c\[\%z\-\,64JQ5AeH_G\#KijUKghQw\^\\vea3a\?kka_G\$8\#\`\*kynsxzBLru\'\]k_\[7FrVx\}\^\=\$blx\>s\-N\%j\;D\*aZDnsw\:YKZ\%Q\.Kne9\#hP\?\+b3\(SOvL\,\^\;\&u5\@\?5C5Bhb\=m\-vEh_L15Jl\]U\)0RP6\{q\%L\^_z5E\'Dw6X\b/IB
3348 ------------------------------------------------------------------
3349         Bra
3350         $<.X+ix[d1b!H#?vV0vrK:ZH1=2M>iV;?aPhFB<*vW@QW@sO9}cfZA-i'w%hKd6gt1UJP,15_#QY$M^Mss_U/]&LK9[5vQub^w[KDD<EjmhUZ?.akp2dF>qmj;2}YWFdYx.Ap]hjCPTP(n28k+3;o&WXqs/gOXdr$:r'do0;b4c(f_Gr="\4)[01T7ajQJvL$W~mL_sS/4h:x*[ZN=KLs&L5zX//>it,o:aU(;Z>pW&T7oP'2K^E:x9'c[%z-,64JQ5AeH_G#KijUKghQw^\vea3a?kka_G$8#`*kynsxzBLru']k_[7FrVx}^=$blx>s-N%j;D*aZDnsw:YKZ%Q.Kne9#hP?+b3(SOvL,^;&u5@?5C5Bhb=m-vEh_L15Jl]U)0RP6{q%L^_z5E'Dw6X
3351         \b
3352         Ket
3353         End
3354 ------------------------------------------------------------------
3355 Capturing subpattern count = 0
3356 Max lookbehind = 1
3357 First code unit = '$'
3358 Last code unit = 'X'
3359 Subject length lower bound = 404
3360
3361 /(.*)\d+\1/I
3362 Capturing subpattern count = 1
3363 Max back reference = 1
3364 Subject length lower bound = 1
3365
3366 /(.*)\d+/I
3367 Capturing subpattern count = 1
3368 First code unit at start or follows newline
3369 Subject length lower bound = 1
3370
3371 /(.*)\d+\1/Is
3372 Capturing subpattern count = 1
3373 Max back reference = 1
3374 Options: dotall
3375 Subject length lower bound = 1
3376
3377 /(.*)\d+/Is
3378 Capturing subpattern count = 1
3379 Compile options: dotall
3380 Overall options: anchored dotall
3381 Subject length lower bound = 1
3382
3383 /(.*(xyz))\d+\2/I
3384 Capturing subpattern count = 2
3385 Max back reference = 2
3386 First code unit at start or follows newline
3387 Last code unit = 'z'
3388 Subject length lower bound = 7
3389
3390 /((.*))\d+\1/I
3391 Capturing subpattern count = 2
3392 Max back reference = 1
3393 Subject length lower bound = 1
3394     abc123bc
3395  0: bc123bc
3396  1: bc
3397  2: bc
3398
3399 /a[b]/I
3400 Capturing subpattern count = 0
3401 First code unit = 'a'
3402 Last code unit = 'b'
3403 Subject length lower bound = 2
3404
3405 /(?=a).*/I
3406 Capturing subpattern count = 0
3407 May match empty string
3408 First code unit = 'a'
3409 Subject length lower bound = 0
3410
3411 /(?=abc).xyz/Ii
3412 Capturing subpattern count = 0
3413 Options: caseless
3414 First code unit = 'a' (caseless)
3415 Last code unit = 'z' (caseless)
3416 Subject length lower bound = 4
3417
3418 /(?=abc)(?i).xyz/I
3419 Capturing subpattern count = 0
3420 First code unit = 'a'
3421 Last code unit = 'z' (caseless)
3422 Subject length lower bound = 4
3423
3424 /(?=a)(?=b)/I
3425 Capturing subpattern count = 0
3426 May match empty string
3427 First code unit = 'a'
3428 Subject length lower bound = 0
3429
3430 /(?=.)a/I
3431 Capturing subpattern count = 0
3432 First code unit = 'a'
3433 Subject length lower bound = 1
3434
3435 /((?=abcda)a)/I
3436 Capturing subpattern count = 1
3437 First code unit = 'a'
3438 Last code unit = 'a'
3439 Subject length lower bound = 1
3440
3441 /((?=abcda)ab)/I
3442 Capturing subpattern count = 1
3443 First code unit = 'a'
3444 Last code unit = 'b'
3445 Subject length lower bound = 2
3446
3447 /()a/I
3448 Capturing subpattern count = 1
3449 First code unit = 'a'
3450 Subject length lower bound = 1
3451
3452 /(?:(?=.)|(?<!x))a/I
3453 Capturing subpattern count = 0
3454 Max lookbehind = 1
3455 First code unit = 'a'
3456 Subject length lower bound = 1
3457
3458 /(?(1)ab|ac)(.)/I
3459 Capturing subpattern count = 1
3460 Max back reference = 1
3461 First code unit = 'a'
3462 Subject length lower bound = 3
3463
3464 /(?(1)abz|acz)(.)/I
3465 Capturing subpattern count = 1
3466 Max back reference = 1
3467 First code unit = 'a'
3468 Last code unit = 'z'
3469 Subject length lower bound = 4
3470
3471 /(?(1)abz)(.)/I
3472 Capturing subpattern count = 1
3473 Max back reference = 1
3474 Subject length lower bound = 1
3475
3476 /(?(1)abz)(1)23/I
3477 Capturing subpattern count = 1
3478 Max back reference = 1
3479 Last code unit = '3'
3480 Subject length lower bound = 3
3481
3482 /(a)+/I
3483 Capturing subpattern count = 1
3484 First code unit = 'a'
3485 Subject length lower bound = 1
3486
3487 /(a){2,3}/I
3488 Capturing subpattern count = 1
3489 First code unit = 'a'
3490 Last code unit = 'a'
3491 Subject length lower bound = 2
3492
3493 /(a)*/I
3494 Capturing subpattern count = 1
3495 May match empty string
3496 Subject length lower bound = 0
3497
3498 /[a]/I
3499 Capturing subpattern count = 0
3500 First code unit = 'a'
3501 Subject length lower bound = 1
3502
3503 /[ab]/I
3504 Capturing subpattern count = 0
3505 Starting code units: a b 
3506 Subject length lower bound = 1
3507
3508 /[ab]/I
3509 Capturing subpattern count = 0
3510 Starting code units: a b 
3511 Subject length lower bound = 1
3512
3513 /[^a]/I
3514 Capturing subpattern count = 0
3515 Subject length lower bound = 1
3516
3517 /\d456/I
3518 Capturing subpattern count = 0
3519 Starting code units: 0 1 2 3 4 5 6 7 8 9 
3520 Last code unit = '6'
3521 Subject length lower bound = 4
3522
3523 /\d456/I
3524 Capturing subpattern count = 0
3525 Starting code units: 0 1 2 3 4 5 6 7 8 9 
3526 Last code unit = '6'
3527 Subject length lower bound = 4
3528
3529 /a^b/I
3530 Capturing subpattern count = 0
3531 First code unit = 'a'
3532 Last code unit = 'b'
3533 Subject length lower bound = 2
3534
3535 /^a/Im
3536 Capturing subpattern count = 0
3537 Options: multiline
3538 First code unit at start or follows newline
3539 Last code unit = 'a'
3540 Subject length lower bound = 1
3541   abcde
3542  0: a
3543   xy\nabc
3544  0: a
3545 \= Expect no match
3546   xyabc
3547 No match
3548
3549 /c|abc/I
3550 Capturing subpattern count = 0
3551 Starting code units: a c 
3552 Last code unit = 'c'
3553 Subject length lower bound = 1
3554
3555 /(?i)[ab]/I
3556 Capturing subpattern count = 0
3557 Starting code units: A B a b 
3558 Subject length lower bound = 1
3559
3560 /[ab](?i)cd/I
3561 Capturing subpattern count = 0
3562 Starting code units: a b 
3563 Last code unit = 'd' (caseless)
3564 Subject length lower bound = 3
3565
3566 /abc(?C)def/I
3567 Capturing subpattern count = 0
3568 First code unit = 'a'
3569 Last code unit = 'f'
3570 Subject length lower bound = 6
3571     abcdef
3572 --->abcdef
3573   0 ^  ^       d
3574  0: abcdef
3575     1234abcdef
3576 --->1234abcdef
3577   0     ^  ^       d
3578  0: abcdef
3579 \= Expect no match
3580     abcxyz
3581 No match
3582     abcxyzf
3583 --->abcxyzf
3584   0 ^  ^        d
3585 No match
3586
3587 /abc(?C)de(?C1)f/I
3588 Capturing subpattern count = 0
3589 First code unit = 'a'
3590 Last code unit = 'f'
3591 Subject length lower bound = 6
3592     123abcdef
3593 --->123abcdef
3594   0    ^  ^       d
3595   1    ^    ^     f
3596  0: abcdef
3597
3598 /(?C1)\dabc(?C2)def/I
3599 Capturing subpattern count = 0
3600 Starting code units: 0 1 2 3 4 5 6 7 8 9 
3601 Last code unit = 'f'
3602 Subject length lower bound = 7
3603     1234abcdef
3604 --->1234abcdef
3605   1 ^              \d
3606   1  ^             \d
3607   1   ^            \d
3608   1    ^           \d
3609   2    ^   ^       d
3610  0: 4abcdef
3611 \= Expect no match
3612     abcdef
3613 No match
3614
3615 /(?C1)\dabc(?C2)def/I
3616 Capturing subpattern count = 0
3617 Starting code units: 0 1 2 3 4 5 6 7 8 9 
3618 Last code unit = 'f'
3619 Subject length lower bound = 7
3620     1234abcdef
3621 --->1234abcdef
3622   1 ^              \d
3623   1  ^             \d
3624   1   ^            \d
3625   1    ^           \d
3626   2    ^   ^       d
3627  0: 4abcdef
3628 \= Expect no match
3629     abcdef
3630 No match
3631
3632 /(?C255)ab/I
3633 Capturing subpattern count = 0
3634 First code unit = 'a'
3635 Last code unit = 'b'
3636 Subject length lower bound = 2
3637
3638 /(?C256)ab/I
3639 Failed: error 138 at offset 6: number after (?C is greater than 255
3640
3641 /(?Cab)xx/I
3642 Failed: error 182 at offset 3: unrecognized string delimiter follows (?C
3643
3644 /(?C12vr)x/I
3645 Failed: error 139 at offset 5: closing parenthesis for (?C expected
3646
3647 /abc(?C)def/I
3648 Capturing subpattern count = 0
3649 First code unit = 'a'
3650 Last code unit = 'f'
3651 Subject length lower bound = 6
3652     \x83\x0\x61bcdef
3653 --->\x83\x00abcdef
3654   0         ^  ^       d
3655  0: abcdef
3656
3657 /(abc)(?C)de(?C1)f/I
3658 Capturing subpattern count = 1
3659 First code unit = 'a'
3660 Last code unit = 'f'
3661 Subject length lower bound = 6
3662     123abcdef
3663 --->123abcdef
3664   0    ^  ^       d
3665   1    ^    ^     f
3666  0: abcdef
3667  1: abc
3668     123abcdef\=callout_capture
3669 Callout 0: last capture = 1
3670  1: abc
3671 --->123abcdef
3672        ^  ^       d
3673 Callout 1: last capture = 1
3674  1: abc
3675 --->123abcdef
3676        ^    ^     f
3677  0: abcdef
3678  1: abc
3679     123abcdefC-\=callout_none
3680  0: abcdef
3681  1: abc
3682 \= Expect no match
3683     123abcdef\=callout_fail=1
3684 --->123abcdef
3685   0    ^  ^       d
3686   1    ^    ^     f
3687 No match
3688
3689 /(?C0)(abc(?C1))*/I
3690 Capturing subpattern count = 1
3691 May match empty string
3692 Subject length lower bound = 0
3693     abcabcabc
3694 --->abcabcabc
3695   0 ^             (
3696   1 ^  ^          )*
3697   1 ^     ^       )*
3698   1 ^        ^    )*
3699  0: abcabcabc
3700  1: abc
3701     abcabc\=callout_fail=1:4
3702 --->abcabc
3703   0 ^          (
3704   1 ^  ^       )*
3705   1 ^     ^    )*
3706  0: abcabc
3707  1: abc
3708     abcabcabc\=callout_fail=1:4
3709 --->abcabcabc
3710   0 ^             (
3711   1 ^  ^          )*
3712   1 ^     ^       )*
3713   1 ^        ^    )*
3714  0: abcabc
3715  1: abc
3716
3717 /(\d{3}(?C))*/I
3718 Capturing subpattern count = 1
3719 May match empty string
3720 Subject length lower bound = 0
3721     123\=callout_capture
3722 Callout 0: last capture = 0
3723 --->123
3724     ^  ^    )*
3725  0: 123
3726  1: 123
3727     123456\=callout_capture
3728 Callout 0: last capture = 0
3729 --->123456
3730     ^  ^       )*
3731 Callout 0: last capture = 1
3732  1: 123
3733 --->123456
3734     ^     ^    )*
3735  0: 123456
3736  1: 456
3737     123456789\=callout_capture
3738 Callout 0: last capture = 0
3739 --->123456789
3740     ^  ^          )*
3741 Callout 0: last capture = 1
3742  1: 123
3743 --->123456789
3744     ^     ^       )*
3745 Callout 0: last capture = 1
3746  1: 456
3747 --->123456789
3748     ^        ^    )*
3749  0: 123456789
3750  1: 789
3751
3752 /((xyz)(?C)p|(?C1)xyzabc)/I
3753 Capturing subpattern count = 2
3754 First code unit = 'x'
3755 Subject length lower bound = 4
3756     xyzabc\=callout_capture
3757 Callout 0: last capture = 2
3758  1: <unset>
3759  2: xyz
3760 --->xyzabc
3761     ^  ^       p
3762 Callout 1: last capture = 0
3763 --->xyzabc
3764     ^          x
3765  0: xyzabc
3766  1: xyzabc
3767
3768 /(X)((xyz)(?C)p|(?C1)xyzabc)/I
3769 Capturing subpattern count = 3
3770 First code unit = 'X'
3771 Last code unit = 'x'
3772 Subject length lower bound = 5
3773     Xxyzabc\=callout_capture
3774 Callout 0: last capture = 3
3775  1: X
3776  2: <unset>
3777  3: xyz
3778 --->Xxyzabc
3779     ^   ^       p
3780 Callout 1: last capture = 1
3781  1: X
3782 --->Xxyzabc
3783     ^^          x
3784  0: Xxyzabc
3785  1: X
3786  2: xyzabc
3787
3788 /(?=(abc))(?C)abcdef/I
3789 Capturing subpattern count = 1
3790 First code unit = 'a'
3791 Last code unit = 'f'
3792 Subject length lower bound = 6
3793     abcdef\=callout_capture
3794 Callout 0: last capture = 1
3795  1: abc
3796 --->abcdef
3797     ^          a
3798  0: abcdef
3799  1: abc
3800
3801 /(?!(abc)(?C1)d)(?C2)abcxyz/I
3802 Capturing subpattern count = 1
3803 First code unit = 'a'
3804 Last code unit = 'z'
3805 Subject length lower bound = 6
3806     abcxyz\=callout_capture
3807 Callout 1: last capture = 1
3808  1: abc
3809 --->abcxyz
3810     ^  ^       d
3811 Callout 2: last capture = 0
3812 --->abcxyz
3813     ^          a
3814  0: abcxyz
3815
3816 /(?<=(abc)(?C))xyz/I
3817 Capturing subpattern count = 1
3818 Max lookbehind = 3
3819 First code unit = 'x'
3820 Last code unit = 'z'
3821 Subject length lower bound = 3
3822    abcxyz\=callout_capture
3823 Callout 0: last capture = 1
3824  1: abc
3825 --->abcxyz
3826        ^       )
3827  0: xyz
3828  1: abc
3829
3830 /a(b+)(c*)(?C1)/I
3831 Capturing subpattern count = 2
3832 First code unit = 'a'
3833 Last code unit = 'b'
3834 Subject length lower bound = 2
3835 \= Expect no match
3836     abbbbbccc\=callout_data=1
3837 --->abbbbbccc
3838   1 ^        ^    End of pattern
3839 Callout data = 1
3840 No match
3841
3842 /a(b+?)(c*?)(?C1)/I
3843 Capturing subpattern count = 2
3844 First code unit = 'a'
3845 Last code unit = 'b'
3846 Subject length lower bound = 2
3847 \= Expect no match
3848     abbbbbccc\=callout_data=1
3849 --->abbbbbccc
3850   1 ^ ^           End of pattern
3851 Callout data = 1
3852   1 ^  ^          End of pattern
3853 Callout data = 1
3854   1 ^   ^         End of pattern
3855 Callout data = 1
3856   1 ^    ^        End of pattern
3857 Callout data = 1
3858   1 ^     ^       End of pattern
3859 Callout data = 1
3860   1 ^      ^      End of pattern
3861 Callout data = 1
3862   1 ^       ^     End of pattern
3863 Callout data = 1
3864   1 ^        ^    End of pattern
3865 Callout data = 1
3866 No match
3867
3868 /(?C)abc/I
3869 Capturing subpattern count = 0
3870 First code unit = 'a'
3871 Last code unit = 'c'
3872 Subject length lower bound = 3
3873
3874 /(?C)^abc/I
3875 Capturing subpattern count = 0
3876 Compile options: <none>
3877 Overall options: anchored
3878 First code unit = 'a'
3879 Subject length lower bound = 3
3880
3881 /(?C)a|b/I
3882 Capturing subpattern count = 0
3883 Starting code units: a b 
3884 Subject length lower bound = 1
3885
3886 /a|(b)(?C)/I
3887 Capturing subpattern count = 1
3888 Starting code units: a b 
3889 Subject length lower bound = 1
3890     b
3891 --->b
3892   0 ^^    End of pattern
3893  0: b
3894  1: b
3895
3896 /x(ab|(bc|(de|(?R))))/I
3897 Capturing subpattern count = 3
3898 First code unit = 'x'
3899 Subject length lower bound = 3
3900     xab
3901  0: xab
3902  1: ab
3903     xbc
3904  0: xbc
3905  1: bc
3906  2: bc
3907     xde
3908  0: xde
3909  1: de
3910  2: de
3911  3: de
3912     xxab
3913  0: xxab
3914  1: xab
3915  2: xab
3916  3: xab
3917     xxxab
3918  0: xxxab
3919  1: xxab
3920  2: xxab
3921  3: xxab
3922 \= Expect no match
3923     xyab
3924 No match
3925
3926 /^([^()]|\((?1)*\))*$/I
3927 Capturing subpattern count = 1
3928 May match empty string
3929 Compile options: <none>
3930 Overall options: anchored
3931 Subject length lower bound = 0
3932     abc
3933  0: abc
3934  1: c
3935     a(b)c
3936  0: a(b)c
3937  1: c
3938     a(b(c))d
3939  0: a(b(c))d
3940  1: d
3941 \= Expect no match)
3942     a(b(c)d
3943 No match
3944
3945 /^>abc>([^()]|\((?1)*\))*<xyz<$/I
3946 Capturing subpattern count = 1
3947 Compile options: <none>
3948 Overall options: anchored
3949 First code unit = '>'
3950 Last code unit = '<'
3951 Subject length lower bound = 10
3952    >abc>123<xyz<
3953  0: >abc>123<xyz<
3954  1: 3
3955    >abc>1(2)3<xyz<
3956  0: >abc>1(2)3<xyz<
3957  1: 3
3958    >abc>(1(2)3)<xyz<
3959  0: >abc>(1(2)3)<xyz<
3960  1: (1(2)3)
3961
3962 /(a(?1)b)/IB
3963 ------------------------------------------------------------------
3964         Bra
3965         CBra 1
3966         a
3967         Recurse
3968         b
3969         Ket
3970         Ket
3971         End
3972 ------------------------------------------------------------------
3973 Capturing subpattern count = 1
3974 First code unit = 'a'
3975 Last code unit = 'b'
3976 Subject length lower bound = 2
3977
3978 /(a(?1)+b)/IB
3979 ------------------------------------------------------------------
3980         Bra
3981         CBra 1
3982         a
3983         SBra
3984         Recurse
3985         KetRmax
3986         b
3987         Ket
3988         Ket
3989         End
3990 ------------------------------------------------------------------
3991 Capturing subpattern count = 1
3992 First code unit = 'a'
3993 Last code unit = 'b'
3994 Subject length lower bound = 2
3995
3996 /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I
3997 Capturing subpattern count = 2
3998 Compile options: <none>
3999 Overall options: anchored
4000 Starting code units: ( - 0 1 2 3 4 5 6 7 8 9 
4001 Subject length lower bound = 1
4002     12
4003  0: 12
4004  1: 12
4005     (((2+2)*-3)-7)
4006  0: (((2+2)*-3)-7)
4007  1: (((2+2)*-3)-7)
4008  2: -
4009     -12
4010  0: -12
4011  1: -12
4012 \= Expect no match
4013     ((2+2)*-3)-7)
4014 No match
4015
4016 /^(x(y|(?1){2})z)/I
4017 Capturing subpattern count = 2
4018 Compile options: <none>
4019 Overall options: anchored
4020 First code unit = 'x'
4021 Subject length lower bound = 3
4022     xyz
4023  0: xyz
4024  1: xyz
4025  2: y
4026     xxyzxyzz
4027  0: xxyzxyzz
4028  1: xxyzxyzz
4029  2: xyzxyz
4030 \= Expect no match
4031     xxyzz
4032 No match
4033     xxyzxyzxyzz
4034 No match
4035
4036 /((< (?: (?(R) \d++  | [^<>]*+) | (?2)) * >))/Ix
4037 Capturing subpattern count = 2
4038 Options: extended
4039 First code unit = '<'
4040 Last code unit = '>'
4041 Subject length lower bound = 2
4042     <>
4043  0: <>
4044  1: <>
4045  2: <>
4046     <abcd>
4047  0: <abcd>
4048  1: <abcd>
4049  2: <abcd>
4050     <abc <123> hij>
4051  0: <abc <123> hij>
4052  1: <abc <123> hij>
4053  2: <abc <123> hij>
4054     <abc <def> hij>
4055  0: <def>
4056  1: <def>
4057  2: <def>
4058     <abc<>def>
4059  0: <abc<>def>
4060  1: <abc<>def>
4061  2: <abc<>def>
4062     <abc<>
4063  0: <>
4064  1: <>
4065  2: <>
4066 \= Expect no match
4067     <abc
4068 No match
4069
4070 /(?1)/I
4071 Failed: error 115 at offset 3: reference to non-existent subpattern
4072
4073 /((?2)(abc)/I
4074 Failed: error 114 at offset 10: missing closing parenthesis
4075
4076 /^(abc)def(?1)/I
4077 Capturing subpattern count = 1
4078 Compile options: <none>
4079 Overall options: anchored
4080 First code unit = 'a'
4081 Subject length lower bound = 9
4082     abcdefabc
4083  0: abcdefabc
4084  1: abc
4085
4086 /^(a|b|c)=(?1)+/I
4087 Capturing subpattern count = 1
4088 Compile options: <none>
4089 Overall options: anchored
4090 Starting code units: a b c 
4091 Subject length lower bound = 2
4092     a=a
4093  0: a=a
4094  1: a
4095     a=b
4096  0: a=b
4097  1: a
4098     a=bc
4099  0: a=bc
4100  1: a
4101
4102 /^(a|b|c)=((?1))+/I
4103 Capturing subpattern count = 2
4104 Compile options: <none>
4105 Overall options: anchored
4106 Starting code units: a b c 
4107 Subject length lower bound = 2
4108     a=a
4109  0: a=a
4110  1: a
4111  2: a
4112     a=b
4113  0: a=b
4114  1: a
4115  2: b
4116     a=bc
4117  0: a=bc
4118  1: a
4119  2: c
4120
4121 /a(?P<name1>b|c)d(?P<longername2>e)/IB
4122 ------------------------------------------------------------------
4123         Bra
4124         a
4125         CBra 1
4126         b
4127         Alt
4128         c
4129         Ket
4130         d
4131         CBra 2
4132         e
4133         Ket
4134         Ket
4135         End
4136 ------------------------------------------------------------------
4137 Capturing subpattern count = 2
4138 Named capturing subpatterns:
4139   longername2   2
4140   name1         1
4141 First code unit = 'a'
4142 Last code unit = 'e'
4143 Subject length lower bound = 4
4144     abde
4145  0: abde
4146  1: b
4147  2: e
4148     acde
4149  0: acde
4150  1: c
4151  2: e
4152
4153 /(?:a(?P<c>c(?P<d>d)))(?P<a>a)/IB
4154 ------------------------------------------------------------------
4155         Bra
4156         Bra
4157         a
4158         CBra 1
4159         c
4160         CBra 2
4161         d
4162         Ket
4163         Ket
4164         Ket
4165         CBra 3
4166         a
4167         Ket
4168         Ket
4169         End
4170 ------------------------------------------------------------------
4171 Capturing subpattern count = 3
4172 Named capturing subpatterns:
4173   a   3
4174   c   1
4175   d   2
4176 First code unit = 'a'
4177 Last code unit = 'a'
4178 Subject length lower bound = 4
4179
4180 /(?P<a>a)...(?P=a)bbb(?P>a)d/IB
4181 ------------------------------------------------------------------
4182         Bra
4183         CBra 1
4184         a
4185         Ket
4186         Any
4187         Any
4188         Any
4189         \1
4190         bbb
4191         Recurse
4192         d
4193         Ket
4194         End
4195 ------------------------------------------------------------------
4196 Capturing subpattern count = 1
4197 Max back reference = 1
4198 Named capturing subpatterns:
4199   a   1
4200 First code unit = 'a'
4201 Last code unit = 'd'
4202 Subject length lower bound = 10
4203
4204 /^\W*(?:(?P<one>(?P<two>.)\W*(?P>one)\W*(?P=two)|)|(?P<three>(?P<four>.)\W*(?P>three)\W*(?P=four)|\W*.\W*))\W*$/Ii
4205 Capturing subpattern count = 4
4206 Max back reference = 4
4207 Named capturing subpatterns:
4208   four    4
4209   one     1
4210   three   3
4211   two     2
4212 May match empty string
4213 Compile options: caseless
4214 Overall options: anchored caseless
4215 Subject length lower bound = 0
4216     1221
4217  0: 1221
4218  1: 1221
4219  2: 1
4220     Satan, oscillate my metallic sonatas!
4221  0: Satan, oscillate my metallic sonatas!
4222  1: <unset>
4223  2: <unset>
4224  3: Satan, oscillate my metallic sonatas
4225  4: S
4226     A man, a plan, a canal: Panama!
4227  0: A man, a plan, a canal: Panama!
4228  1: <unset>
4229  2: <unset>
4230  3: A man, a plan, a canal: Panama
4231  4: A
4232     Able was I ere I saw Elba.
4233  0: Able was I ere I saw Elba.
4234  1: <unset>
4235  2: <unset>
4236  3: Able was I ere I saw Elba
4237  4: A
4238 \= Expect no match
4239     The quick brown fox
4240 No match
4241
4242 /((?(R)a|b))\1(?1)?/I
4243 Capturing subpattern count = 1
4244 Max back reference = 1
4245 Subject length lower bound = 2
4246   bb
4247  0: bb
4248  1: b
4249   bbaa
4250  0: bba
4251  1: b
4252
4253 /(.*)a/Is
4254 Capturing subpattern count = 1
4255 Compile options: dotall
4256 Overall options: anchored dotall
4257 Last code unit = 'a'
4258 Subject length lower bound = 1
4259
4260 /(.*)a\1/Is
4261 Capturing subpattern count = 1
4262 Max back reference = 1
4263 Options: dotall
4264 Last code unit = 'a'
4265 Subject length lower bound = 1
4266
4267 /(.*)a(b)\2/Is
4268 Capturing subpattern count = 2
4269 Max back reference = 2
4270 Compile options: dotall
4271 Overall options: anchored dotall
4272 Last code unit = 'b'
4273 Subject length lower bound = 3
4274
4275 /((.*)a|(.*)b)z/Is
4276 Capturing subpattern count = 3
4277 Compile options: dotall
4278 Overall options: anchored dotall
4279 Last code unit = 'z'
4280 Subject length lower bound = 2
4281
4282 /((.*)a|(.*)b)z\1/Is
4283 Capturing subpattern count = 3
4284 Max back reference = 1
4285 Options: dotall
4286 Last code unit = 'z'
4287 Subject length lower bound = 3
4288
4289 /((.*)a|(.*)b)z\2/Is
4290 Capturing subpattern count = 3
4291 Max back reference = 2
4292 Options: dotall
4293 Last code unit = 'z'
4294 Subject length lower bound = 2
4295
4296 /((.*)a|(.*)b)z\3/Is
4297 Capturing subpattern count = 3
4298 Max back reference = 3
4299 Options: dotall
4300 Last code unit = 'z'
4301 Subject length lower bound = 2
4302
4303 /((.*)a|^(.*)b)z\3/Is
4304 Capturing subpattern count = 3
4305 Max back reference = 3
4306 Compile options: dotall
4307 Overall options: anchored dotall
4308 Last code unit = 'z'
4309 Subject length lower bound = 2
4310
4311 /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a/Is
4312 Capturing subpattern count = 31
4313 May match empty string
4314 Compile options: dotall
4315 Overall options: anchored dotall
4316 Subject length lower bound = 0
4317
4318 /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\31/Is
4319 Capturing subpattern count = 31
4320 Max back reference = 31
4321 May match empty string
4322 Options: dotall
4323 Subject length lower bound = 0
4324
4325 /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\32/Is
4326 Capturing subpattern count = 32
4327 Max back reference = 32
4328 May match empty string
4329 Options: dotall
4330 Subject length lower bound = 0
4331
4332 /(a)(bc)/IB,no_auto_capture
4333 ------------------------------------------------------------------
4334         Bra
4335         Bra
4336         a
4337         Ket
4338         Bra
4339         bc
4340         Ket
4341         Ket
4342         End
4343 ------------------------------------------------------------------
4344 Capturing subpattern count = 0
4345 Options: no_auto_capture
4346 First code unit = 'a'
4347 Last code unit = 'c'
4348 Subject length lower bound = 3
4349   abc
4350  0: abc
4351
4352 /(?P<one>a)(bc)/IB,no_auto_capture
4353 ------------------------------------------------------------------
4354         Bra
4355         CBra 1
4356         a
4357         Ket
4358         Bra
4359         bc
4360         Ket
4361         Ket
4362         End
4363 ------------------------------------------------------------------
4364 Capturing subpattern count = 1
4365 Named capturing subpatterns:
4366   one   1
4367 Options: no_auto_capture
4368 First code unit = 'a'
4369 Last code unit = 'c'
4370 Subject length lower bound = 3
4371   abc
4372  0: abc
4373  1: a
4374
4375 /(a)(?P<named>bc)/IB,no_auto_capture
4376 ------------------------------------------------------------------
4377         Bra
4378         Bra
4379         a
4380         Ket
4381         CBra 1
4382         bc
4383         Ket
4384         Ket
4385         End
4386 ------------------------------------------------------------------
4387 Capturing subpattern count = 1
4388 Named capturing subpatterns:
4389   named   1
4390 Options: no_auto_capture
4391 First code unit = 'a'
4392 Last code unit = 'c'
4393 Subject length lower bound = 3
4394
4395 /(aaa(?C1)bbb|ab)/I
4396 Capturing subpattern count = 1
4397 First code unit = 'a'
4398 Last code unit = 'b'
4399 Subject length lower bound = 2
4400    aaabbb
4401 --->aaabbb
4402   1 ^  ^       b
4403  0: aaabbb
4404  1: aaabbb
4405    aaabbb\=callout_data=0
4406 --->aaabbb
4407   1 ^  ^       b
4408  0: aaabbb
4409  1: aaabbb
4410    aaabbb\=callout_data=1
4411 --->aaabbb
4412   1 ^  ^       b
4413 Callout data = 1
4414  0: ab
4415  1: ab
4416 \= Expect no match
4417    aaabbb\=callout_data=-1
4418 --->aaabbb
4419   1 ^  ^       b
4420 Callout data = -1
4421 No match
4422
4423 /ab(?P<one>cd)ef(?P<two>gh)/I
4424 Capturing subpattern count = 2
4425 Named capturing subpatterns:
4426   one   1
4427   two   2
4428 First code unit = 'a'
4429 Last code unit = 'h'
4430 Subject length lower bound = 8
4431     abcdefgh
4432  0: abcdefgh
4433  1: cd
4434  2: gh
4435     abcdefgh\=copy=1,get=two
4436  0: abcdefgh
4437  1: cd
4438  2: gh
4439  1C cd (2)
4440   G gh (2) two (group 2)
4441     abcdefgh\=copy=one,copy=two
4442  0: abcdefgh
4443  1: cd
4444  2: gh
4445   C cd (2) one (group 1)
4446   C gh (2) two (group 2)
4447     abcdefgh\=copy=three
4448  0: abcdefgh
4449  1: cd
4450  2: gh
4451 Number not found for group 'three'
4452 Copy substring 'three' failed (-49): unknown substring
4453
4454 /(?P<Tes>)(?P<Test>)/IB
4455 ------------------------------------------------------------------
4456         Bra
4457         CBra 1
4458         Ket
4459         CBra 2
4460         Ket
4461         Ket
4462         End
4463 ------------------------------------------------------------------
4464 Capturing subpattern count = 2
4465 Named capturing subpatterns:
4466   Tes    1
4467   Test   2
4468 May match empty string
4469 Subject length lower bound = 0
4470
4471 /(?P<Test>)(?P<Tes>)/IB
4472 ------------------------------------------------------------------
4473         Bra
4474         CBra 1
4475         Ket
4476         CBra 2
4477         Ket
4478         Ket
4479         End
4480 ------------------------------------------------------------------
4481 Capturing subpattern count = 2
4482 Named capturing subpatterns:
4483   Tes    2
4484   Test   1
4485 May match empty string
4486 Subject length lower bound = 0
4487
4488 /(?P<Z>zz)(?P<A>aa)/I
4489 Capturing subpattern count = 2
4490 Named capturing subpatterns:
4491   A   2
4492   Z   1
4493 First code unit = 'z'
4494 Last code unit = 'a'
4495 Subject length lower bound = 4
4496     zzaa\=copy=Z
4497  0: zzaa
4498  1: zz
4499  2: aa
4500   C zz (2) Z (group 1)
4501     zzaa\=copy=A
4502  0: zzaa
4503  1: zz
4504  2: aa
4505   C aa (2) A (group 2)
4506
4507 /(?P<x>eks)(?P<x>eccs)/I
4508 Failed: error 143 at offset 16: two named subpatterns have the same name (PCRE2_DUPNAMES not set)
4509
4510 /(?P<abc>abc(?P<def>def)(?P<abc>xyz))/I
4511 Failed: error 143 at offset 31: two named subpatterns have the same name (PCRE2_DUPNAMES not set)
4512
4513 "\[((?P<elem>\d+)(,(?P>elem))*)\]"I
4514 Capturing subpattern count = 3
4515 Named capturing subpatterns:
4516   elem   2
4517 First code unit = '['
4518 Last code unit = ']'
4519 Subject length lower bound = 3
4520     [10,20,30,5,5,4,4,2,43,23,4234]
4521  0: [10,20,30,5,5,4,4,2,43,23,4234]
4522  1: 10,20,30,5,5,4,4,2,43,23,4234
4523  2: 10
4524  3: ,4234
4525 \= Expect no match
4526     []
4527 No match
4528
4529 "\[((?P<elem>\d+)(,(?P>elem))*)?\]"I
4530 Capturing subpattern count = 3
4531 Named capturing subpatterns:
4532   elem   2
4533 First code unit = '['
4534 Last code unit = ']'
4535 Subject length lower bound = 2
4536     [10,20,30,5,5,4,4,2,43,23,4234]
4537  0: [10,20,30,5,5,4,4,2,43,23,4234]
4538  1: 10,20,30,5,5,4,4,2,43,23,4234
4539  2: 10
4540  3: ,4234
4541     []
4542  0: []
4543
4544 /(a(b(?2)c))?/IB
4545 ------------------------------------------------------------------
4546         Bra
4547         Brazero
4548         CBra 1
4549         a
4550         CBra 2
4551         b
4552         Recurse
4553         c
4554         Ket
4555         Ket
4556         Ket
4557         End
4558 ------------------------------------------------------------------
4559 Capturing subpattern count = 2
4560 May match empty string
4561 Subject length lower bound = 0
4562
4563 /(a(b(?2)c))*/IB
4564 ------------------------------------------------------------------
4565         Bra
4566         Brazero
4567         CBra 1
4568         a
4569         CBra 2
4570         b
4571         Recurse
4572         c
4573         Ket
4574         KetRmax
4575         Ket
4576         End
4577 ------------------------------------------------------------------
4578 Capturing subpattern count = 2
4579 May match empty string
4580 Subject length lower bound = 0
4581
4582 /(a(b(?2)c)){0,2}/IB
4583 ------------------------------------------------------------------
4584         Bra
4585         Brazero
4586         Bra
4587         CBra 1
4588         a
4589         CBra 2
4590         b
4591         Recurse
4592         c
4593         Ket
4594         Ket
4595         Brazero
4596         CBra 1
4597         a
4598         CBra 2
4599         b
4600         Recurse
4601         c
4602         Ket
4603         Ket
4604         Ket
4605         Ket
4606         End
4607 ------------------------------------------------------------------
4608 Capturing subpattern count = 2
4609 May match empty string
4610 Subject length lower bound = 0
4611
4612 /[ab]{1}+/B
4613 ------------------------------------------------------------------
4614         Bra
4615         [ab]
4616         Ket
4617         End
4618 ------------------------------------------------------------------
4619
4620 /()(?1){1}/B
4621 ------------------------------------------------------------------
4622         Bra
4623         CBra 1
4624         Ket
4625         Recurse
4626         Ket
4627         End
4628 ------------------------------------------------------------------
4629
4630 /()(?1)/B
4631 ------------------------------------------------------------------
4632         Bra
4633         CBra 1
4634         Ket
4635         Recurse
4636         Ket
4637         End
4638 ------------------------------------------------------------------
4639
4640 /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/Ii
4641 Capturing subpattern count = 3
4642 Options: caseless
4643 Last code unit = 'g' (caseless)
4644 Subject length lower bound = 8
4645      Baby Bjorn Active Carrier - With free SHIPPING!!
4646  0: Baby Bjorn Active Carrier - With free SHIPPING!!
4647  1: Baby Bjorn Active Carrier - With free SHIPPING!!
4648
4649 /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/Ii
4650 Capturing subpattern count = 3
4651 Options: caseless
4652 Last code unit = 'g' (caseless)
4653 Subject length lower bound = 8
4654      Baby Bjorn Active Carrier - With free SHIPPING!!
4655  0: Baby Bjorn Active Carrier - With free SHIPPING!!
4656  1: Baby Bjorn Active Carrier - With free SHIPPING!!
4657
4658 /a*.*b/IB
4659 ------------------------------------------------------------------
4660         Bra
4661         a*
4662         Any*
4663         b
4664         Ket
4665         End
4666 ------------------------------------------------------------------
4667 Capturing subpattern count = 0
4668 Last code unit = 'b'
4669 Subject length lower bound = 1
4670
4671 /(a|b)*.?c/IB
4672 ------------------------------------------------------------------
4673         Bra
4674         Brazero
4675         CBra 1
4676         a
4677         Alt
4678         b
4679         KetRmax
4680         Any?
4681         c
4682         Ket
4683         End
4684 ------------------------------------------------------------------
4685 Capturing subpattern count = 1
4686 Last code unit = 'c'
4687 Subject length lower bound = 1
4688
4689 /abc(?C255)de(?C)f/IB
4690 ------------------------------------------------------------------
4691         Bra
4692         abc
4693         Callout 255 10 1
4694         de
4695         Callout 0 16 1
4696         f
4697         Ket
4698         End
4699 ------------------------------------------------------------------
4700 Capturing subpattern count = 0
4701 First code unit = 'a'
4702 Last code unit = 'f'
4703 Subject length lower bound = 6
4704
4705 /abcde/IB,auto_callout
4706 ------------------------------------------------------------------
4707         Bra
4708         Callout 255 0 1
4709         a
4710         Callout 255 1 1
4711         b
4712         Callout 255 2 1
4713         c
4714         Callout 255 3 1
4715         d
4716         Callout 255 4 1
4717         e
4718         Callout 255 5 0
4719         Ket
4720         End
4721 ------------------------------------------------------------------
4722 Capturing subpattern count = 0
4723 Options: auto_callout
4724 First code unit = 'a'
4725 Last code unit = 'e'
4726 Subject length lower bound = 5
4727   abcde
4728 --->abcde
4729  +0 ^         a
4730  +1 ^^        b
4731  +2 ^ ^       c
4732  +3 ^  ^      d
4733  +4 ^   ^     e
4734  +5 ^    ^    End of pattern
4735  0: abcde
4736 \= Expect no match
4737   abcdfe
4738 --->abcdfe
4739  +0 ^          a
4740  +1 ^^         b
4741  +2 ^ ^        c
4742  +3 ^  ^       d
4743  +4 ^   ^      e
4744 No match
4745
4746 /a*b/IB,auto_callout
4747 ------------------------------------------------------------------
4748         Bra
4749         Callout 255 0 2
4750         a*+
4751         Callout 255 2 1
4752         b
4753         Callout 255 3 0
4754         Ket
4755         End
4756 ------------------------------------------------------------------
4757 Capturing subpattern count = 0
4758 Options: auto_callout
4759 Starting code units: a b 
4760 Last code unit = 'b'
4761 Subject length lower bound = 1
4762   ab
4763 --->ab
4764  +0 ^      a*
4765  +2 ^^     b
4766  +3 ^ ^    End of pattern
4767  0: ab
4768   aaaab
4769 --->aaaab
4770  +0 ^         a*
4771  +2 ^   ^     b
4772  +3 ^    ^    End of pattern
4773  0: aaaab
4774   aaaacb
4775 --->aaaacb
4776  +0 ^          a*
4777  +2 ^   ^      b
4778  +0  ^         a*
4779  +2  ^  ^      b
4780  +0   ^        a*
4781  +2   ^ ^      b
4782  +0    ^       a*
4783  +2    ^^      b
4784  +0      ^     a*
4785  +2      ^     b
4786  +3      ^^    End of pattern
4787  0: b
4788
4789 /a*b/IB,auto_callout
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: auto_callout
4802 Starting code units: a b 
4803 Last code unit = 'b'
4804 Subject length lower bound = 1
4805   ab
4806 --->ab
4807  +0 ^      a*
4808  +2 ^^     b
4809  +3 ^ ^    End of pattern
4810  0: ab
4811   aaaab
4812 --->aaaab
4813  +0 ^         a*
4814  +2 ^   ^     b
4815  +3 ^    ^    End of pattern
4816  0: aaaab
4817   aaaacb
4818 --->aaaacb
4819  +0 ^          a*
4820  +2 ^   ^      b
4821  +0  ^         a*
4822  +2  ^  ^      b
4823  +0   ^        a*
4824  +2   ^ ^      b
4825  +0    ^       a*
4826  +2    ^^      b
4827  +0      ^     a*
4828  +2      ^     b
4829  +3      ^^    End of pattern
4830  0: b
4831
4832 /a+b/IB,auto_callout
4833 ------------------------------------------------------------------
4834         Bra
4835         Callout 255 0 2
4836         a++
4837         Callout 255 2 1
4838         b
4839         Callout 255 3 0
4840         Ket
4841         End
4842 ------------------------------------------------------------------
4843 Capturing subpattern count = 0
4844 Options: auto_callout
4845 First code unit = 'a'
4846 Last code unit = 'b'
4847 Subject length lower bound = 2
4848   ab
4849 --->ab
4850  +0 ^      a+
4851  +2 ^^     b
4852  +3 ^ ^    End of pattern
4853  0: ab
4854   aaaab
4855 --->aaaab
4856  +0 ^         a+
4857  +2 ^   ^     b
4858  +3 ^    ^    End of pattern
4859  0: aaaab
4860 \= Expect no match
4861   aaaacb
4862 --->aaaacb
4863  +0 ^          a+
4864  +2 ^   ^      b
4865  +0  ^         a+
4866  +2  ^  ^      b
4867  +0   ^        a+
4868  +2   ^ ^      b
4869  +0    ^       a+
4870  +2    ^^      b
4871 No match
4872
4873 /(abc|def)x/IB,auto_callout
4874 ------------------------------------------------------------------
4875         Bra
4876         Callout 255 0 1
4877         CBra 1
4878         Callout 255 1 1
4879         a
4880         Callout 255 2 1
4881         b
4882         Callout 255 3 1
4883         c
4884         Callout 255 4 1
4885         Alt
4886         Callout 255 5 1
4887         d
4888         Callout 255 6 1
4889         e
4890         Callout 255 7 1
4891         f
4892         Callout 255 8 1
4893         Ket
4894         Callout 255 9 1
4895         x
4896         Callout 255 10 0
4897         Ket
4898         End
4899 ------------------------------------------------------------------
4900 Capturing subpattern count = 1
4901 Options: auto_callout
4902 Starting code units: a d 
4903 Last code unit = 'x'
4904 Subject length lower bound = 4
4905   abcx
4906 --->abcx
4907  +0 ^        (
4908  +1 ^        a
4909  +2 ^^       b
4910  +3 ^ ^      c
4911  +4 ^  ^     |
4912  +9 ^  ^     x
4913 +10 ^   ^    End of pattern
4914  0: abcx
4915  1: abc
4916   defx
4917 --->defx
4918  +0 ^        (
4919  +1 ^        a
4920  +5 ^        d
4921  +6 ^^       e
4922  +7 ^ ^      f
4923  +8 ^  ^     )
4924  +9 ^  ^     x
4925 +10 ^   ^    End of pattern
4926  0: defx
4927  1: def
4928 \= Expect no match
4929   abcdefzx
4930 --->abcdefzx
4931  +0 ^            (
4932  +1 ^            a
4933  +2 ^^           b
4934  +3 ^ ^          c
4935  +4 ^  ^         |
4936  +9 ^  ^         x
4937  +5 ^            d
4938  +0    ^         (
4939  +1    ^         a
4940  +5    ^         d
4941  +6    ^^        e
4942  +7    ^ ^       f
4943  +8    ^  ^      )
4944  +9    ^  ^      x
4945 No match
4946
4947 /(abc|def)x/IB,auto_callout
4948 ------------------------------------------------------------------
4949         Bra
4950         Callout 255 0 1
4951         CBra 1
4952         Callout 255 1 1
4953         a
4954         Callout 255 2 1
4955         b
4956         Callout 255 3 1
4957         c
4958         Callout 255 4 1
4959         Alt
4960         Callout 255 5 1
4961         d
4962         Callout 255 6 1
4963         e
4964         Callout 255 7 1
4965         f
4966         Callout 255 8 1
4967         Ket
4968         Callout 255 9 1
4969         x
4970         Callout 255 10 0
4971         Ket
4972         End
4973 ------------------------------------------------------------------
4974 Capturing subpattern count = 1
4975 Options: auto_callout
4976 Starting code units: a d 
4977 Last code unit = 'x'
4978 Subject length lower bound = 4
4979   abcx
4980 --->abcx
4981  +0 ^        (
4982  +1 ^        a
4983  +2 ^^       b
4984  +3 ^ ^      c
4985  +4 ^  ^     |
4986  +9 ^  ^     x
4987 +10 ^   ^    End of pattern
4988  0: abcx
4989  1: abc
4990   defx
4991 --->defx
4992  +0 ^        (
4993  +1 ^        a
4994  +5 ^        d
4995  +6 ^^       e
4996  +7 ^ ^      f
4997  +8 ^  ^     )
4998  +9 ^  ^     x
4999 +10 ^   ^    End of pattern
5000  0: defx
5001  1: def
5002 \= Expect no match
5003   abcdefzx
5004 --->abcdefzx
5005  +0 ^            (
5006  +1 ^            a
5007  +2 ^^           b
5008  +3 ^ ^          c
5009  +4 ^  ^         |
5010  +9 ^  ^         x
5011  +5 ^            d
5012  +0    ^         (
5013  +1    ^         a
5014  +5    ^         d
5015  +6    ^^        e
5016  +7    ^ ^       f
5017  +8    ^  ^      )
5018  +9    ^  ^      x
5019 No match
5020
5021 /(ab|cd){3,4}/I,auto_callout
5022 Capturing subpattern count = 1
5023 Options: auto_callout
5024 Starting code units: a c 
5025 Subject length lower bound = 6
5026   ababab
5027 --->ababab
5028  +0 ^          (
5029  +1 ^          a
5030  +2 ^^         b
5031  +3 ^ ^        |
5032  +1 ^ ^        a
5033  +2 ^  ^       b
5034  +3 ^   ^      |
5035  +1 ^   ^      a
5036  +2 ^    ^     b
5037  +3 ^     ^    |
5038  +1 ^     ^    a
5039  +4 ^     ^    c
5040 +12 ^     ^    End of pattern
5041  0: ababab
5042  1: ab
5043   abcdabcd
5044 --->abcdabcd
5045  +0 ^            (
5046  +1 ^            a
5047  +2 ^^           b
5048  +3 ^ ^          |
5049  +1 ^ ^          a
5050  +4 ^ ^          c
5051  +5 ^  ^         d
5052  +6 ^   ^        ){3,4}
5053  +1 ^   ^        a
5054  +2 ^    ^       b
5055  +3 ^     ^      |
5056  +1 ^     ^      a
5057  +4 ^     ^      c
5058  +5 ^      ^     d
5059  +6 ^       ^    ){3,4}
5060 +12 ^       ^    End of pattern
5061  0: abcdabcd
5062  1: cd
5063   abcdcdcdcdcd
5064 --->abcdcdcdcdcd
5065  +0 ^                (
5066  +1 ^                a
5067  +2 ^^               b
5068  +3 ^ ^              |
5069  +1 ^ ^              a
5070  +4 ^ ^              c
5071  +5 ^  ^             d
5072  +6 ^   ^            ){3,4}
5073  +1 ^   ^            a
5074  +4 ^   ^            c
5075  +5 ^    ^           d
5076  +6 ^     ^          ){3,4}
5077  +1 ^     ^          a
5078  +4 ^     ^          c
5079  +5 ^      ^         d
5080  +6 ^       ^        ){3,4}
5081 +12 ^       ^        End of pattern
5082  0: abcdcdcd
5083  1: cd
5084
5085 /([ab]{,4}c|xy)/IB,auto_callout
5086 ------------------------------------------------------------------
5087         Bra
5088         Callout 255 0 1
5089         CBra 1
5090         Callout 255 1 4
5091         [ab]
5092         Callout 255 5 1
5093         {
5094         Callout 255 6 1
5095         ,
5096         Callout 255 7 1
5097         4
5098         Callout 255 8 1
5099         }
5100         Callout 255 9 1
5101         c
5102         Callout 255 10 1
5103         Alt
5104         Callout 255 11 1
5105         x
5106         Callout 255 12 1
5107         y
5108         Callout 255 13 1
5109         Ket
5110         Callout 255 14 0
5111         Ket
5112         End
5113 ------------------------------------------------------------------
5114 Capturing subpattern count = 1
5115 Options: auto_callout
5116 Starting code units: a b x 
5117 Subject length lower bound = 2
5118 \= Expect no match
5119     Note: that { does NOT introduce a quantifier
5120 --->Note: that { does NOT introduce a quantifier
5121  +0         ^                                        (
5122  +1         ^                                        [ab]
5123  +5         ^^                                       {
5124 +11         ^                                        x
5125  +0                                 ^                (
5126  +1                                 ^                [ab]
5127  +5                                 ^^               {
5128 +11                                 ^                x
5129  +0                                     ^            (
5130  +1                                     ^            [ab]
5131  +5                                     ^^           {
5132 +11                                     ^            x
5133 No match
5134
5135 /([ab]{,4}c|xy)/IB,auto_callout
5136 ------------------------------------------------------------------
5137         Bra
5138         Callout 255 0 1
5139         CBra 1
5140         Callout 255 1 4
5141         [ab]
5142         Callout 255 5 1
5143         {
5144         Callout 255 6 1
5145         ,
5146         Callout 255 7 1
5147         4
5148         Callout 255 8 1
5149         }
5150         Callout 255 9 1
5151         c
5152         Callout 255 10 1
5153         Alt
5154         Callout 255 11 1
5155         x
5156         Callout 255 12 1
5157         y
5158         Callout 255 13 1
5159         Ket
5160         Callout 255 14 0
5161         Ket
5162         End
5163 ------------------------------------------------------------------
5164 Capturing subpattern count = 1
5165 Options: auto_callout
5166 Starting code units: a b x 
5167 Subject length lower bound = 2
5168 \= Expect no match
5169     Note: that { does NOT introduce a quantifier
5170 --->Note: that { does NOT introduce a quantifier
5171  +0         ^                                        (
5172  +1         ^                                        [ab]
5173  +5         ^^                                       {
5174 +11         ^                                        x
5175  +0                                 ^                (
5176  +1                                 ^                [ab]
5177  +5                                 ^^               {
5178 +11                                 ^                x
5179  +0                                     ^            (
5180  +1                                     ^            [ab]
5181  +5                                     ^^           {
5182 +11                                     ^            x
5183 No match
5184
5185 /([ab]{1,4}c|xy){4,5}?123/IB,auto_callout
5186 ------------------------------------------------------------------
5187         Bra
5188         Callout 255 0 1
5189         CBra 1
5190         Callout 255 1 9
5191         [ab]{1,4}+
5192         Callout 255 10 1
5193         c
5194         Callout 255 11 1
5195         Alt
5196         Callout 255 12 1
5197         x
5198         Callout 255 13 1
5199         y
5200         Callout 255 14 7
5201         Ket
5202         CBra 1
5203         Callout 255 1 9
5204         [ab]{1,4}+
5205         Callout 255 10 1
5206         c
5207         Callout 255 11 1
5208         Alt
5209         Callout 255 12 1
5210         x
5211         Callout 255 13 1
5212         y
5213         Callout 255 14 7
5214         Ket
5215         CBra 1
5216         Callout 255 1 9
5217         [ab]{1,4}+
5218         Callout 255 10 1
5219         c
5220         Callout 255 11 1
5221         Alt
5222         Callout 255 12 1
5223         x
5224         Callout 255 13 1
5225         y
5226         Callout 255 14 7
5227         Ket
5228         CBra 1
5229         Callout 255 1 9
5230         [ab]{1,4}+
5231         Callout 255 10 1
5232         c
5233         Callout 255 11 1
5234         Alt
5235         Callout 255 12 1
5236         x
5237         Callout 255 13 1
5238         y
5239         Callout 255 14 7
5240         Ket
5241         Braminzero
5242         CBra 1
5243         Callout 255 1 9
5244         [ab]{1,4}+
5245         Callout 255 10 1
5246         c
5247         Callout 255 11 1
5248         Alt
5249         Callout 255 12 1
5250         x
5251         Callout 255 13 1
5252         y
5253         Callout 255 14 7
5254         Ket
5255         Callout 255 21 1
5256         1
5257         Callout 255 22 1
5258         2
5259         Callout 255 23 1
5260         3
5261         Callout 255 24 0
5262         Ket
5263         End
5264 ------------------------------------------------------------------
5265 Capturing subpattern count = 1
5266 Options: auto_callout
5267 Starting code units: a b x 
5268 Last code unit = '3'
5269 Subject length lower bound = 11
5270     aacaacaacaacaac123
5271 --->aacaacaacaacaac123
5272  +0 ^                      (
5273  +1 ^                      [ab]{1,4}
5274 +10 ^ ^                    c
5275 +11 ^  ^                   |
5276  +1 ^  ^                   [ab]{1,4}
5277 +10 ^    ^                 c
5278 +11 ^     ^                |
5279  +1 ^     ^                [ab]{1,4}
5280 +10 ^       ^              c
5281 +11 ^        ^             |
5282  +1 ^        ^             [ab]{1,4}
5283 +10 ^          ^           c
5284 +11 ^           ^          |
5285 +21 ^           ^          1
5286  +1 ^           ^          [ab]{1,4}
5287 +10 ^             ^        c
5288 +11 ^              ^       |
5289 +21 ^              ^       1
5290 +22 ^               ^      2
5291 +23 ^                ^     3
5292 +24 ^                 ^    End of pattern
5293  0: aacaacaacaacaac123
5294  1: aac
5295
5296 /\b.*/I
5297 Capturing subpattern count = 0
5298 Max lookbehind = 1
5299 May match empty string
5300 Subject length lower bound = 0
5301   ab cd\=offset=1
5302  0:  cd
5303
5304 /\b.*/Is
5305 Capturing subpattern count = 0
5306 Max lookbehind = 1
5307 May match empty string
5308 Options: dotall
5309 Subject length lower bound = 0
5310   ab cd\=startoffset=1
5311  0:  cd
5312
5313 /(?!.bcd).*/I
5314 Capturing subpattern count = 0
5315 May match empty string
5316 Subject length lower bound = 0
5317   Xbcd12345
5318  0: bcd12345
5319
5320 /abcde/I
5321 Capturing subpattern count = 0
5322 First code unit = 'a'
5323 Last code unit = 'e'
5324 Subject length lower bound = 5
5325     ab\=ps
5326 Partial match: ab
5327     abc\=ps
5328 Partial match: abc
5329     abcd\=ps
5330 Partial match: abcd
5331     abcde\=ps
5332  0: abcde
5333     the quick brown abc\=ps
5334 Partial match: abc
5335 \= Expect no match\=ps
5336     the quick brown abxyz fox\=ps
5337 No match
5338
5339 "^(0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[012])/(20)?\d\d$"I
5340 Capturing subpattern count = 3
5341 Compile options: <none>
5342 Overall options: anchored
5343 Starting code units: 0 1 2 3 4 5 6 7 8 9 
5344 Last code unit = '/'
5345 Subject length lower bound = 6
5346     13/05/04\=ps
5347  0: 13/05/04
5348  1: 13
5349  2: 05
5350     13/5/2004\=ps
5351  0: 13/5/2004
5352  1: 13
5353  2: 5
5354  3: 20
5355     02/05/09\=ps
5356  0: 02/05/09
5357  1: 02
5358  2: 05
5359     1\=ps
5360 Partial match: 1
5361     1/2\=ps
5362 Partial match: 1/2
5363     1/2/0\=ps
5364 Partial match: 1/2/0
5365     1/2/04\=ps
5366  0: 1/2/04
5367  1: 1
5368  2: 2
5369     0\=ps
5370 Partial match: 0
5371     02/\=ps
5372 Partial match: 02/
5373     02/0\=ps
5374 Partial match: 02/0
5375     02/1\=ps
5376 Partial match: 02/1
5377 \= Expect no match\=ps
5378     \=ps
5379 No match
5380     123\=ps
5381 No match
5382     33/4/04\=ps
5383 No match
5384     3/13/04\=ps
5385 No match
5386     0/1/2003\=ps
5387 No match
5388     0/\=ps
5389 No match
5390     02/0/\=ps
5391 No match
5392     02/13\=ps
5393 No match
5394
5395 /0{0,2}ABC/I
5396 Capturing subpattern count = 0
5397 Starting code units: 0 A 
5398 Last code unit = 'C'
5399 Subject length lower bound = 3
5400
5401 /\d{3,}ABC/I
5402 Capturing subpattern count = 0
5403 Starting code units: 0 1 2 3 4 5 6 7 8 9 
5404 Last code unit = 'C'
5405 Subject length lower bound = 6
5406
5407 /\d*ABC/I
5408 Capturing subpattern count = 0
5409 Starting code units: 0 1 2 3 4 5 6 7 8 9 A 
5410 Last code unit = 'C'
5411 Subject length lower bound = 3
5412
5413 /[abc]+DE/I
5414 Capturing subpattern count = 0
5415 Starting code units: a b c 
5416 Last code unit = 'E'
5417 Subject length lower bound = 3
5418
5419 /[abc]?123/I
5420 Capturing subpattern count = 0
5421 Starting code units: 1 a b c 
5422 Last code unit = '3'
5423 Subject length lower bound = 3
5424     123\=ps
5425  0: 123
5426     a\=ps
5427 Partial match: a
5428     b\=ps
5429 Partial match: b
5430     c\=ps
5431 Partial match: c
5432     c12\=ps
5433 Partial match: c12
5434     c123\=ps
5435  0: c123
5436
5437 /^(?:\d){3,5}X/I
5438 Capturing subpattern count = 0
5439 Compile options: <none>
5440 Overall options: anchored
5441 Starting code units: 0 1 2 3 4 5 6 7 8 9 
5442 Last code unit = 'X'
5443 Subject length lower bound = 4
5444     1\=ps
5445 Partial match: 1
5446     123\=ps
5447 Partial match: 123
5448     123X
5449  0: 123X
5450     1234\=ps
5451 Partial match: 1234
5452     1234X
5453  0: 1234X
5454     12345\=ps
5455 Partial match: 12345
5456     12345X
5457  0: 12345X
5458 \= Expect no match
5459     1X
5460 No match
5461     123456\=ps
5462 No match
5463
5464 "<(\w+)/?>(.)*</(\1)>"Igms
5465 Capturing subpattern count = 3
5466 Max back reference = 1
5467 Options: dotall multiline
5468 First code unit = '<'
5469 Last code unit = '>'
5470 Subject length lower bound = 7
5471     <!DOCTYPE seite SYSTEM "http://www.lco.lineas.de/xmlCms.dtd">\n<seite>\n<dokumenteninformation>\n<seitentitel>Partner der LCO</seitentitel>\n<sprache>de</sprache>\n<seitenbeschreibung>Partner der LINEAS Consulting\nGmbH</seitenbeschreibung>\n<schluesselworte>LINEAS Consulting GmbH Hamburg\nPartnerfirmen</schluesselworte>\n<revisit>30 days</revisit>\n<robots>index,follow</robots>\n<menueinformation>\n<aktiv>ja</aktiv>\n<menueposition>3</menueposition>\n<menuetext>Partner</menuetext>\n</menueinformation>\n<lastedited>\n<autor>LCO</autor>\n<firma>LINEAS Consulting</firma>\n<datum>15.10.2003</datum>\n</lastedited>\n</dokumenteninformation>\n<inhalt>\n\n<absatzueberschrift>Die Partnerfirmen der LINEAS Consulting\nGmbH</absatzueberschrift>\n\n<absatz><link ziel="http://www.ca.com/" zielfenster="_blank">\n<bild name="logo_ca.gif" rahmen="no"/></link> <link\nziel="http://www.ey.com/" zielfenster="_blank"><bild\nname="logo_euy.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.cisco.de/" zielfenster="_blank">\n<bild name="logo_cisco.gif" rahmen="ja"/></link></absatz>\n\n<absatz><link ziel="http://www.atelion.de/"\nzielfenster="_blank"><bild\nname="logo_atelion.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.line-information.de/"\nzielfenster="_blank">\n<bild name="logo_line_information.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><bild name="logo_aw.gif" rahmen="no"/></absatz>\n\n<absatz><link ziel="http://www.incognis.de/"\nzielfenster="_blank"><bild\nname="logo_incognis.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.addcraft.com/"\nzielfenster="_blank"><bild\nname="logo_addcraft.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.comendo.com/"\nzielfenster="_blank"><bild\nname="logo_comendo.gif" rahmen="no"/></link></absatz>\n\n</inhalt>\n</seite>\=jitstack=1024
5472  0: <seite>\x0a<dokumenteninformation>\x0a<seitentitel>Partner der LCO</seitentitel>\x0a<sprache>de</sprache>\x0a<seitenbeschreibung>Partner der LINEAS Consulting\x0aGmbH</seitenbeschreibung>\x0a<schluesselworte>LINEAS Consulting GmbH Hamburg\x0aPartnerfirmen</schluesselworte>\x0a<revisit>30 days</revisit>\x0a<robots>index,follow</robots>\x0a<menueinformation>\x0a<aktiv>ja</aktiv>\x0a<menueposition>3</menueposition>\x0a<menuetext>Partner</menuetext>\x0a</menueinformation>\x0a<lastedited>\x0a<autor>LCO</autor>\x0a<firma>LINEAS Consulting</firma>\x0a<datum>15.10.2003</datum>\x0a</lastedited>\x0a</dokumenteninformation>\x0a<inhalt>\x0a\x0a<absatzueberschrift>Die Partnerfirmen der LINEAS Consulting\x0aGmbH</absatzueberschrift>\x0a\x0a<absatz><link ziel="http://www.ca.com/" zielfenster="_blank">\x0a<bild name="logo_ca.gif" rahmen="no"/></link> <link\x0aziel="http://www.ey.com/" zielfenster="_blank"><bild\x0aname="logo_euy.gif" rahmen="no"/></link>\x0a</absatz>\x0a\x0a<absatz><link ziel="http://www.cisco.de/" zielfenster="_blank">\x0a<bild name="logo_cisco.gif" rahmen="ja"/></link></absatz>\x0a\x0a<absatz><link ziel="http://www.atelion.de/"\x0azielfenster="_blank"><bild\x0aname="logo_atelion.gif" rahmen="no"/></link>\x0a</absatz>\x0a\x0a<absatz><link ziel="http://www.line-information.de/"\x0azielfenster="_blank">\x0a<bild name="logo_line_information.gif" rahmen="no"/></link>\x0a</absatz>\x0a\x0a<absatz><bild name="logo_aw.gif" rahmen="no"/></absatz>\x0a\x0a<absatz><link ziel="http://www.incognis.de/"\x0azielfenster="_blank"><bild\x0aname="logo_incognis.gif" rahmen="no"/></link></absatz>\x0a\x0a<absatz><link ziel="http://www.addcraft.com/"\x0azielfenster="_blank"><bild\x0aname="logo_addcraft.gif" rahmen="no"/></link></absatz>\x0a\x0a<absatz><link ziel="http://www.comendo.com/"\x0azielfenster="_blank"><bild\x0aname="logo_comendo.gif" rahmen="no"/></link></absatz>\x0a\x0a</inhalt>\x0a</seite>
5473  1: seite
5474  2: \x0a
5475  3: seite
5476
5477 /line\nbreak/I
5478 Capturing subpattern count = 0
5479 Contains explicit CR or LF match
5480 First code unit = 'l'
5481 Last code unit = 'k'
5482 Subject length lower bound = 10
5483     this is a line\nbreak
5484  0: line\x0abreak
5485     line one\nthis is a line\nbreak in the second line
5486  0: line\x0abreak
5487
5488 /line\nbreak/I,firstline
5489 Capturing subpattern count = 0
5490 Contains explicit CR or LF match
5491 Options: firstline
5492 First code unit = 'l'
5493 Last code unit = 'k'
5494 Subject length lower bound = 10
5495     this is a line\nbreak
5496  0: line\x0abreak
5497 \= Expect no match
5498     line one\nthis is a line\nbreak in the second line
5499 No match
5500
5501 /line\nbreak/Im,firstline
5502 Capturing subpattern count = 0
5503 Contains explicit CR or LF match
5504 Options: firstline multiline
5505 First code unit = 'l'
5506 Last code unit = 'k'
5507 Subject length lower bound = 10
5508     this is a line\nbreak
5509  0: line\x0abreak
5510 \= Expect no match
5511     line one\nthis is a line\nbreak in the second line
5512 No match
5513
5514 /(?i)(?-i)AbCd/I
5515 Capturing subpattern count = 0
5516 First code unit = 'A'
5517 Last code unit = 'd'
5518 Subject length lower bound = 4
5519     AbCd
5520  0: AbCd
5521 \= Expect no match
5522     abcd
5523 No match
5524
5525 /a{11111111111111111111}/I
5526 Failed: error 105 at offset 8: number too big in {} quantifier
5527
5528 /(){64294967295}/I
5529 Failed: error 105 at offset 9: number too big in {} quantifier
5530
5531 /(){2,4294967295}/I
5532 Failed: error 105 at offset 11: number too big in {} quantifier
5533
5534 "(?i:a)(?i:b)(?i:c)(?i:d)(?i:e)(?i:f)(?i:g)(?i:h)(?i:i)(?i:j)(k)(?i:l)A\1B"I
5535 Capturing subpattern count = 1
5536 Max back reference = 1
5537 First code unit = 'a' (caseless)
5538 Last code unit = 'B'
5539 Subject length lower bound = 15
5540     abcdefghijklAkB
5541  0: abcdefghijklAkB
5542  1: k
5543
5544 "(?P<n0>a)(?P<n1>b)(?P<n2>c)(?P<n3>d)(?P<n4>e)(?P<n5>f)(?P<n6>g)(?P<n7>h)(?P<n8>i)(?P<n9>j)(?P<n10>k)(?P<n11>l)A\11B"I
5545 Capturing subpattern count = 12
5546 Max back reference = 11
5547 Named capturing subpatterns:
5548   n0    1
5549   n1    2
5550   n10  11
5551   n11  12
5552   n2    3
5553   n3    4
5554   n4    5
5555   n5    6
5556   n6    7
5557   n7    8
5558   n8    9
5559   n9   10
5560 First code unit = 'a'
5561 Last code unit = 'B'
5562 Subject length lower bound = 15
5563     abcdefghijklAkB
5564  0: abcdefghijklAkB
5565  1: a
5566  2: b
5567  3: c
5568  4: d
5569  5: e
5570  6: f
5571  7: g
5572  8: h
5573  9: i
5574 10: j
5575 11: k
5576 12: l
5577
5578 "(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)A\11B"I
5579 Capturing subpattern count = 12
5580 Max back reference = 11
5581 First code unit = 'a'
5582 Last code unit = 'B'
5583 Subject length lower bound = 15
5584     abcdefghijklAkB
5585  0: abcdefghijklAkB
5586  1: a
5587  2: b
5588  3: c
5589  4: d
5590  5: e
5591  6: f
5592  7: g
5593  8: h
5594  9: i
5595 10: j
5596 11: k
5597 12: l
5598
5599 "(?P<name0>a)(?P<name1>a)(?P<name2>a)(?P<name3>a)(?P<name4>a)(?P<name5>a)(?P<name6>a)(?P<name7>a)(?P<name8>a)(?P<name9>a)(?P<name10>a)(?P<name11>a)(?P<name12>a)(?P<name13>a)(?P<name14>a)(?P<name15>a)(?P<name16>a)(?P<name17>a)(?P<name18>a)(?P<name19>a)(?P<name20>a)(?P<name21>a)(?P<name22>a)(?P<name23>a)(?P<name24>a)(?P<name25>a)(?P<name26>a)(?P<name27>a)(?P<name28>a)(?P<name29>a)(?P<name30>a)(?P<name31>a)(?P<name32>a)(?P<name33>a)(?P<name34>a)(?P<name35>a)(?P<name36>a)(?P<name37>a)(?P<name38>a)(?P<name39>a)(?P<name40>a)(?P<name41>a)(?P<name42>a)(?P<name43>a)(?P<name44>a)(?P<name45>a)(?P<name46>a)(?P<name47>a)(?P<name48>a)(?P<name49>a)(?P<name50>a)(?P<name51>a)(?P<name52>a)(?P<name53>a)(?P<name54>a)(?P<name55>a)(?P<name56>a)(?P<name57>a)(?P<name58>a)(?P<name59>a)(?P<name60>a)(?P<name61>a)(?P<name62>a)(?P<name63>a)(?P<name64>a)(?P<name65>a)(?P<name66>a)(?P<name67>a)(?P<name68>a)(?P<name69>a)(?P<name70>a)(?P<name71>a)(?P<name72>a)(?P<name73>a)(?P<name74>a)(?P<name75>a)(?P<name76>a)(?P<name77>a)(?P<name78>a)(?P<name79>a)(?P<name80>a)(?P<name81>a)(?P<name82>a)(?P<name83>a)(?P<name84>a)(?P<name85>a)(?P<name86>a)(?P<name87>a)(?P<name88>a)(?P<name89>a)(?P<name90>a)(?P<name91>a)(?P<name92>a)(?P<name93>a)(?P<name94>a)(?P<name95>a)(?P<name96>a)(?P<name97>a)(?P<name98>a)(?P<name99>a)(?P<name100>a)"I
5600 Capturing subpattern count = 101
5601 Named capturing subpatterns:
5602   name0     1
5603   name1     2
5604   name10   11
5605   name100 101
5606   name11   12
5607   name12   13
5608   name13   14
5609   name14   15
5610   name15   16
5611   name16   17
5612   name17   18
5613   name18   19
5614   name19   20
5615   name2     3
5616   name20   21
5617   name21   22
5618   name22   23
5619   name23   24
5620   name24   25
5621   name25   26
5622   name26   27
5623   name27   28
5624   name28   29
5625   name29   30
5626   name3     4
5627   name30   31
5628   name31   32
5629   name32   33
5630   name33   34
5631   name34   35
5632   name35   36
5633   name36   37
5634   name37   38
5635   name38   39
5636   name39   40
5637   name4     5
5638   name40   41
5639   name41   42
5640   name42   43
5641   name43   44
5642   name44   45
5643   name45   46
5644   name46   47
5645   name47   48
5646   name48   49
5647   name49   50
5648   name5     6
5649   name50   51
5650   name51   52
5651   name52   53
5652   name53   54
5653   name54   55
5654   name55   56
5655   name56   57
5656   name57   58
5657   name58   59
5658   name59   60
5659   name6     7
5660   name60   61
5661   name61   62
5662   name62   63
5663   name63   64
5664   name64   65
5665   name65   66
5666   name66   67
5667   name67   68
5668   name68   69
5669   name69   70
5670   name7     8
5671   name70   71
5672   name71   72
5673   name72   73
5674   name73   74
5675   name74   75
5676   name75   76
5677   name76   77
5678   name77   78
5679   name78   79
5680   name79   80
5681   name8     9
5682   name80   81
5683   name81   82
5684   name82   83
5685   name83   84
5686   name84   85
5687   name85   86
5688   name86   87
5689   name87   88
5690   name88   89
5691   name89   90
5692   name9    10
5693   name90   91
5694   name91   92
5695   name92   93
5696   name93   94
5697   name94   95
5698   name95   96
5699   name96   97
5700   name97   98
5701   name98   99
5702   name99  100
5703 First code unit = 'a'
5704 Last code unit = 'a'
5705 Subject length lower bound = 101
5706     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
5707 Matched, but too many substrings
5708  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
5709  1: a
5710  2: a
5711  3: a
5712  4: a
5713  5: a
5714  6: a
5715  7: a
5716  8: a
5717  9: a
5718 10: a
5719 11: a
5720 12: a
5721 13: a
5722 14: a
5723
5724 "(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)"I
5725 Capturing subpattern count = 101
5726 First code unit = 'a'
5727 Last code unit = 'a'
5728 Subject length lower bound = 101
5729     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
5730 Matched, but too many substrings
5731  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
5732  1: a
5733  2: a
5734  3: a
5735  4: a
5736  5: a
5737  6: a
5738  7: a
5739  8: a
5740  9: a
5741 10: a
5742 11: a
5743 12: a
5744 13: a
5745 14: a
5746
5747 /[^()]*(?:\((?R)\)[^()]*)*/I
5748 Capturing subpattern count = 0
5749 May match empty string
5750 Subject length lower bound = 0
5751     (this(and)that
5752  0: 
5753     (this(and)that)
5754  0: (this(and)that)
5755     (this(and)that)stuff
5756  0: (this(and)that)stuff
5757
5758 /[^()]*(?:\((?>(?R))\)[^()]*)*/I
5759 Capturing subpattern count = 0
5760 May match empty string
5761 Subject length lower bound = 0
5762     (this(and)that
5763  0: 
5764     (this(and)that)
5765  0: (this(and)that)
5766
5767 /[^()]*(?:\((?R)\))*[^()]*/I
5768 Capturing subpattern count = 0
5769 May match empty string
5770 Subject length lower bound = 0
5771     (this(and)that
5772  0: 
5773     (this(and)that)
5774  0: (this(and)that)
5775
5776 /(?:\((?R)\))*[^()]*/I
5777 Capturing subpattern count = 0
5778 May match empty string
5779 Subject length lower bound = 0
5780     (this(and)that
5781  0: 
5782     (this(and)that)
5783  0: 
5784     ((this))
5785  0: ((this))
5786
5787 /(?:\((?R)\))|[^()]*/I
5788 Capturing subpattern count = 0
5789 May match empty string
5790 Subject length lower bound = 0
5791     (this(and)that
5792  0: 
5793     (this(and)that)
5794  0: 
5795     (this)
5796  0: (this)
5797     ((this))
5798  0: ((this))
5799
5800 /\x{0000ff}/I
5801 Capturing subpattern count = 0
5802 First code unit = \xff
5803 Subject length lower bound = 1
5804
5805 /^((?P<A>a1)|(?P<A>a2)b)/I
5806 Failed: error 143 at offset 18: two named subpatterns have the same name (PCRE2_DUPNAMES not set)
5807
5808 /^((?P<A>a1)|(?P<A>a2)b)/I,dupnames
5809 Capturing subpattern count = 3
5810 Named capturing subpatterns:
5811   A   2
5812   A   3
5813 Compile options: dupnames
5814 Overall options: anchored dupnames
5815 First code unit = 'a'
5816 Subject length lower bound = 2
5817     a1b\=copy=A
5818  0: a1
5819  1: a1
5820  2: a1
5821   C a1 (2) A (non-unique)
5822     a2b\=copy=A
5823  0: a2b
5824  1: a2b
5825  2: <unset>
5826  3: a2
5827   C a2 (2) A (non-unique)
5828     a1b\=copy=Z,copy=A
5829  0: a1
5830  1: a1
5831  2: a1
5832 Number not found for group 'Z'
5833 Copy substring 'Z' failed (-49): unknown substring
5834   C a1 (2) A (non-unique)
5835
5836 /(?|(?<a>)(?<b>)(?<a>)|(?<a>)(?<b>)(?<a>))/I,dupnames
5837 Capturing subpattern count = 3
5838 Named capturing subpatterns:
5839   a   1
5840   a   3
5841   b   2
5842 May match empty string
5843 Options: dupnames
5844 Subject length lower bound = 0
5845
5846 /^(?P<A>a)(?P<A>b)/I,dupnames
5847 Capturing subpattern count = 2
5848 Named capturing subpatterns:
5849   A   1
5850   A   2
5851 Compile options: dupnames
5852 Overall options: anchored dupnames
5853 First code unit = 'a'
5854 Subject length lower bound = 2
5855     ab\=copy=A
5856  0: ab
5857  1: a
5858  2: b
5859   C a (1) A (non-unique)
5860
5861 /^(?P<A>a)(?P<A>b)|cd/I,dupnames
5862 Capturing subpattern count = 2
5863 Named capturing subpatterns:
5864   A   1
5865   A   2
5866 Options: dupnames
5867 Starting code units: a c 
5868 Subject length lower bound = 2
5869     ab\=copy=A
5870  0: ab
5871  1: a
5872  2: b
5873   C a (1) A (non-unique)
5874     cd\=copy=A
5875  0: cd
5876 Copy substring 'A' failed (-55): requested value is not set
5877
5878 /^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/I,dupnames
5879 Capturing subpattern count = 4
5880 Named capturing subpatterns:
5881   A   1
5882   A   2
5883   A   3
5884   A   4
5885 Options: dupnames
5886 Starting code units: a c 
5887 Subject length lower bound = 2
5888     cdefgh\=copy=A
5889  0: cdefgh
5890  1: <unset>
5891  2: <unset>
5892  3: ef
5893  4: gh
5894   C ef (2) A (non-unique)
5895
5896 /^((?P<A>a1)|(?P<A>a2)b)/I,dupnames
5897 Capturing subpattern count = 3
5898 Named capturing subpatterns:
5899   A   2
5900   A   3
5901 Compile options: dupnames
5902 Overall options: anchored dupnames
5903 First code unit = 'a'
5904 Subject length lower bound = 2
5905     a1b\=get=A
5906  0: a1
5907  1: a1
5908  2: a1
5909   G a1 (2) A (non-unique)
5910     a2b\=get=A
5911  0: a2b
5912  1: a2b
5913  2: <unset>
5914  3: a2
5915   G a2 (2) A (non-unique)
5916     a1b\=get=Z,get=A
5917  0: a1
5918  1: a1
5919  2: a1
5920 Number not found for group 'Z'
5921 Get substring 'Z' failed (-49): unknown substring
5922   G a1 (2) A (non-unique)
5923
5924 /^(?P<A>a)(?P<A>b)/I,dupnames
5925 Capturing subpattern count = 2
5926 Named capturing subpatterns:
5927   A   1
5928   A   2
5929 Compile options: dupnames
5930 Overall options: anchored dupnames
5931 First code unit = 'a'
5932 Subject length lower bound = 2
5933     ab\=get=A
5934  0: ab
5935  1: a
5936  2: b
5937   G a (1) A (non-unique)
5938
5939 /^(?P<A>a)(?P<A>b)|cd/I,dupnames
5940 Capturing subpattern count = 2
5941 Named capturing subpatterns:
5942   A   1
5943   A   2
5944 Options: dupnames
5945 Starting code units: a c 
5946 Subject length lower bound = 2
5947     ab\=get=A
5948  0: ab
5949  1: a
5950  2: b
5951   G a (1) A (non-unique)
5952     cd\=get=A
5953  0: cd
5954 Get substring 'A' failed (-55): requested value is not set
5955
5956 /^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/I,dupnames
5957 Capturing subpattern count = 4
5958 Named capturing subpatterns:
5959   A   1
5960   A   2
5961   A   3
5962   A   4
5963 Options: dupnames
5964 Starting code units: a c 
5965 Subject length lower bound = 2
5966     cdefgh\=get=A
5967  0: cdefgh
5968  1: <unset>
5969  2: <unset>
5970  3: ef
5971  4: gh
5972   G ef (2) A (non-unique)
5973
5974 /(?J)^((?P<A>a1)|(?P<A>a2)b)/I
5975 Capturing subpattern count = 3
5976 Named capturing subpatterns:
5977   A   2
5978   A   3
5979 Compile options: <none>
5980 Overall options: anchored
5981 Duplicate name status changes
5982 First code unit = 'a'
5983 Subject length lower bound = 2
5984     a1b\=copy=A
5985  0: a1
5986  1: a1
5987  2: a1
5988   C a1 (2) A (non-unique)
5989     a2b\=copy=A
5990  0: a2b
5991  1: a2b
5992  2: <unset>
5993  3: a2
5994   C a2 (2) A (non-unique)
5995
5996 /^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<A>d)/I
5997 Failed: error 143 at offset 38: two named subpatterns have the same name (PCRE2_DUPNAMES not set)
5998
5999 # In this next test, J is not set at the outer level; consequently it isn't set
6000 # in the pattern's options; consequently pcre2_substring_get_byname() produces
6001 # a random value.
6002
6003 /^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<C>d)/I
6004 Capturing subpattern count = 4
6005 Named capturing subpatterns:
6006   A   1
6007   B   2
6008   B   3
6009   C   4
6010 Compile options: <none>
6011 Overall options: anchored
6012 Duplicate name status changes
6013 First code unit = 'a'
6014 Subject length lower bound = 6
6015     a bc d\=copy=A,copy=B,copy=C
6016  0: a bc d
6017  1: a
6018  2: b
6019  3: c
6020  4: d
6021   C a (1) A (group 1)
6022   C b (1) B (non-unique)
6023   C d (1) C (group 4)
6024
6025 /^(?P<A>a)?(?(A)a|b)/I
6026 Capturing subpattern count = 1
6027 Max back reference = 1
6028 Named capturing subpatterns:
6029   A   1
6030 Compile options: <none>
6031 Overall options: anchored
6032 Subject length lower bound = 1
6033     aabc
6034  0: aa
6035  1: a
6036     bc
6037  0: b
6038 \= Expect no match
6039     abc
6040 No match
6041
6042 /(?:(?(ZZ)a|b)(?P<ZZ>X))+/I
6043 Capturing subpattern count = 1
6044 Max back reference = 1
6045 Named capturing subpatterns:
6046   ZZ   1
6047 Last code unit = 'X'
6048 Subject length lower bound = 2
6049     bXaX
6050  0: bXaX
6051  1: X
6052
6053 /(?:(?(2y)a|b)(X))+/I
6054 Failed: error 124 at offset 7: missing closing parenthesis for condition
6055
6056 /(?:(?(ZA)a|b)(?P<ZZ>X))+/I
6057 Failed: error 115 at offset 6: reference to non-existent subpattern
6058
6059 /(?:(?(ZZ)a|b)(?(ZZ)a|b)(?P<ZZ>X))+/I
6060 Capturing subpattern count = 1
6061 Max back reference = 1
6062 Named capturing subpatterns:
6063   ZZ   1
6064 Last code unit = 'X'
6065 Subject length lower bound = 3
6066     bbXaaX
6067  0: bbXaaX
6068  1: X
6069
6070 /(?:(?(ZZ)a|\(b\))\\(?P<ZZ>X))+/I
6071 Capturing subpattern count = 1
6072 Max back reference = 1
6073 Named capturing subpatterns:
6074   ZZ   1
6075 Last code unit = 'X'
6076 Subject length lower bound = 3
6077     (b)\\Xa\\X
6078  0: (b)\Xa\X
6079  1: X
6080
6081 /(?P<ABC/I
6082 Failed: error 142 at offset 7: syntax error in subpattern name (missing terminator)
6083
6084 /(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
6085 Capturing subpattern count = 1
6086 Max back reference = 1
6087 Named capturing subpatterns:
6088   A   1
6089 Subject length lower bound = 2
6090     bXXaYYaY
6091  0: bXXaYYaY
6092  1: Y
6093     bXYaXXaX
6094  0: bX
6095  1: X
6096
6097 /()()()()()()()()()(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
6098 Capturing subpattern count = 10
6099 Max back reference = 10
6100 Named capturing subpatterns:
6101   A  10
6102 Subject length lower bound = 2
6103     bXXaYYaY
6104  0: bXXaYYaY
6105  1: 
6106  2: 
6107  3: 
6108  4: 
6109  5: 
6110  6: 
6111  7: 
6112  8: 
6113  9: 
6114 10: Y
6115
6116 /\s*,\s*/I
6117 Capturing subpattern count = 0
6118 Starting code units: \x09 \x0a \x0b \x0c \x0d \x20 , 
6119 Last code unit = ','
6120 Subject length lower bound = 1
6121     \x0b,\x0b
6122  0: \x0b,\x0b
6123     \x0c,\x0d
6124  0: \x0c,\x0d
6125
6126 /^abc/Im,newline=lf
6127 Capturing subpattern count = 0
6128 Options: multiline
6129 Forced newline is LF
6130 First code unit at start or follows newline
6131 Last code unit = 'c'
6132 Subject length lower bound = 3
6133     xyz\nabc
6134  0: abc
6135     xyz\r\nabc
6136  0: abc
6137 \= Expect no match
6138     xyz\rabc
6139 No match
6140     xyzabc\r
6141 No match
6142     xyzabc\rpqr
6143 No match
6144     xyzabc\r\n
6145 No match
6146     xyzabc\r\npqr
6147 No match
6148
6149 /^abc/Im,newline=crlf
6150 Capturing subpattern count = 0
6151 Options: multiline
6152 Forced newline is CRLF
6153 First code unit at start or follows newline
6154 Last code unit = 'c'
6155 Subject length lower bound = 3
6156     xyz\r\nabclf>
6157  0: abc
6158 \= Expect no match
6159     xyz\nabclf
6160 No match
6161     xyz\rabclf
6162 No match
6163
6164 /^abc/Im,newline=cr
6165 Capturing subpattern count = 0
6166 Options: multiline
6167 Forced newline is CR
6168 First code unit at start or follows newline
6169 Last code unit = 'c'
6170 Subject length lower bound = 3
6171     xyz\rabc
6172  0: abc
6173 \= Expect no match
6174     xyz\nabc
6175 No match
6176     xyz\r\nabc
6177 No match
6178
6179 /^abc/Im,newline=bad
6180 ** Invalid value in 'newline=bad'
6181
6182 /.*/I,newline=lf
6183 Capturing subpattern count = 0
6184 May match empty string
6185 Forced newline is LF
6186 First code unit at start or follows newline
6187 Subject length lower bound = 0
6188     abc\ndef
6189  0: abc
6190     abc\rdef
6191  0: abc\x0ddef
6192     abc\r\ndef
6193  0: abc\x0d
6194
6195 /.*/I,newline=cr
6196 Capturing subpattern count = 0
6197 May match empty string
6198 Forced newline is CR
6199 First code unit at start or follows newline
6200 Subject length lower bound = 0
6201     abc\ndef
6202  0: abc\x0adef
6203     abc\rdef
6204  0: abc
6205     abc\r\ndef
6206  0: abc
6207
6208 /.*/I,newline=crlf
6209 Capturing subpattern count = 0
6210 May match empty string
6211 Forced newline is CRLF
6212 First code unit at start or follows newline
6213 Subject length lower bound = 0
6214     abc\ndef
6215  0: abc\x0adef
6216     abc\rdef
6217  0: abc\x0ddef
6218     abc\r\ndef
6219  0: abc
6220
6221 /\w+(.)(.)?def/Is
6222 Capturing subpattern count = 2
6223 Options: dotall
6224 Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P 
6225   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 
6226 Last code unit = 'f'
6227 Subject length lower bound = 5
6228     abc\ndef
6229  0: abc\x0adef
6230  1: \x0a
6231     abc\rdef
6232  0: abc\x0ddef
6233  1: \x0d
6234     abc\r\ndef
6235  0: abc\x0d\x0adef
6236  1: \x0d
6237  2: \x0a
6238
6239 /(?P<B>25[0-5]|2[0-4]\d|[01]?\d?\d)(?:\.(?P>B)){3}/I
6240 Capturing subpattern count = 1
6241 Named capturing subpatterns:
6242   B   1
6243 Starting code units: 0 1 2 3 4 5 6 7 8 9 
6244 Last code unit = '.'
6245 Subject length lower bound = 7
6246
6247 /()()()()()()()()()()()()()()()()()()()()
6248  ()()()()()()()()()()()()()()()()()()()()
6249  ()()()()()()()()()()()()()()()()()()()()
6250  ()()()()()()()()()()()()()()()()()()()()
6251  ()()()()()()()()()()()()()()()()()()()()
6252  (.(.))/Ix
6253 Capturing subpattern count = 102
6254 Options: extended
6255 Subject length lower bound = 2
6256     XY\=ovector=133
6257  0: XY
6258  1: 
6259  2: 
6260  3: 
6261  4: 
6262  5: 
6263  6: 
6264  7: 
6265  8: 
6266  9: 
6267 10: 
6268 11: 
6269 12: 
6270 13: 
6271 14: 
6272 15: 
6273 16: 
6274 17: 
6275 18: 
6276 19: 
6277 20: 
6278 21: 
6279 22: 
6280 23: 
6281 24: 
6282 25: 
6283 26: 
6284 27: 
6285 28: 
6286 29: 
6287 30: 
6288 31: 
6289 32: 
6290 33: 
6291 34: 
6292 35: 
6293 36: 
6294 37: 
6295 38: 
6296 39: 
6297 40: 
6298 41: 
6299 42: 
6300 43: 
6301 44: 
6302 45: 
6303 46: 
6304 47: 
6305 48: 
6306 49: 
6307 50: 
6308 51: 
6309 52: 
6310 53: 
6311 54: 
6312 55: 
6313 56: 
6314 57: 
6315 58: 
6316 59: 
6317 60: 
6318 61: 
6319 62: 
6320 63: 
6321 64: 
6322 65: 
6323 66: 
6324 67: 
6325 68: 
6326 69: 
6327 70: 
6328 71: 
6329 72: 
6330 73: 
6331 74: 
6332 75: 
6333 76: 
6334 77: 
6335 78: 
6336 79: 
6337 80: 
6338 81: 
6339 82: 
6340 83: 
6341 84: 
6342 85: 
6343 86: 
6344 87: 
6345 88: 
6346 89: 
6347 90: 
6348 91: 
6349 92: 
6350 93: 
6351 94: 
6352 95: 
6353 96: 
6354 97: 
6355 98: 
6356 99: 
6357 100: 
6358 101: XY
6359 102: Y
6360
6361 /(a*b|(?i:c*(?-i)d))/I
6362 Capturing subpattern count = 1
6363 Starting code units: C a b c d 
6364 Subject length lower bound = 1
6365
6366 /()[ab]xyz/I
6367 Capturing subpattern count = 1
6368 Starting code units: a b 
6369 Last code unit = 'z'
6370 Subject length lower bound = 4
6371
6372 /(|)[ab]xyz/I
6373 Capturing subpattern count = 1
6374 Starting code units: a b 
6375 Last code unit = 'z'
6376 Subject length lower bound = 4
6377
6378 /(|c)[ab]xyz/I
6379 Capturing subpattern count = 1
6380 Starting code units: a b c 
6381 Last code unit = 'z'
6382 Subject length lower bound = 4
6383
6384 /(|c?)[ab]xyz/I
6385 Capturing subpattern count = 1
6386 Starting code units: a b c 
6387 Last code unit = 'z'
6388 Subject length lower bound = 4
6389
6390 /(d?|c?)[ab]xyz/I
6391 Capturing subpattern count = 1
6392 Starting code units: a b c d 
6393 Last code unit = 'z'
6394 Subject length lower bound = 4
6395
6396 /(d?|c)[ab]xyz/I
6397 Capturing subpattern count = 1
6398 Starting code units: a b c d 
6399 Last code unit = 'z'
6400 Subject length lower bound = 4
6401
6402 /^a*b\d/IB
6403 ------------------------------------------------------------------
6404         Bra
6405         ^
6406         a*+
6407         b
6408         \d
6409         Ket
6410         End
6411 ------------------------------------------------------------------
6412 Capturing subpattern count = 0
6413 Compile options: <none>
6414 Overall options: anchored
6415 Starting code units: a b 
6416 Last code unit = 'b'
6417 Subject length lower bound = 2
6418
6419 /^a*+b\d/IB
6420 ------------------------------------------------------------------
6421         Bra
6422         ^
6423         a*+
6424         b
6425         \d
6426         Ket
6427         End
6428 ------------------------------------------------------------------
6429 Capturing subpattern count = 0
6430 Compile options: <none>
6431 Overall options: anchored
6432 Starting code units: a b 
6433 Last code unit = 'b'
6434 Subject length lower bound = 2
6435
6436 /^a*?b\d/IB
6437 ------------------------------------------------------------------
6438         Bra
6439         ^
6440         a*+
6441         b
6442         \d
6443         Ket
6444         End
6445 ------------------------------------------------------------------
6446 Capturing subpattern count = 0
6447 Compile options: <none>
6448 Overall options: anchored
6449 Starting code units: a b 
6450 Last code unit = 'b'
6451 Subject length lower bound = 2
6452
6453 /^a+A\d/IB
6454 ------------------------------------------------------------------
6455         Bra
6456         ^
6457         a++
6458         A
6459         \d
6460         Ket
6461         End
6462 ------------------------------------------------------------------
6463 Capturing subpattern count = 0
6464 Compile options: <none>
6465 Overall options: anchored
6466 First code unit = 'a'
6467 Last code unit = 'A'
6468 Subject length lower bound = 3
6469     aaaA5
6470  0: aaaA5
6471 \= Expect no match
6472     aaaa5
6473 No match
6474
6475 /^a*A\d/IBi
6476 ------------------------------------------------------------------
6477         Bra
6478         ^
6479      /i a*
6480      /i A
6481         \d
6482         Ket
6483         End
6484 ------------------------------------------------------------------
6485 Capturing subpattern count = 0
6486 Compile options: caseless
6487 Overall options: anchored caseless
6488 Starting code units: A a 
6489 Last code unit = 'A' (caseless)
6490 Subject length lower bound = 2
6491     aaaA5
6492  0: aaaA5
6493     aaaa5
6494  0: aaaa5
6495
6496 /(a*|b*)[cd]/I
6497 Capturing subpattern count = 1
6498 Starting code units: a b c d 
6499 Subject length lower bound = 1
6500
6501 /(a+|b*)[cd]/I
6502 Capturing subpattern count = 1
6503 Starting code units: a b c d 
6504 Subject length lower bound = 1
6505
6506 /(a*|b+)[cd]/I
6507 Capturing subpattern count = 1
6508 Starting code units: a b c d 
6509 Subject length lower bound = 1
6510
6511 /(a+|b+)[cd]/I
6512 Capturing subpattern count = 1
6513 Starting code units: a b 
6514 Subject length lower bound = 2
6515
6516 /((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
6517  ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
6518  (((
6519  a
6520  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
6521  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
6522  )))
6523 /Ix
6524 Capturing subpattern count = 203
6525 Options: extended
6526 First code unit = 'a'
6527 Subject length lower bound = 1
6528   large nest
6529 Matched, but too many substrings
6530  0: a
6531  1: a
6532  2: a
6533  3: a
6534  4: a
6535  5: a
6536  6: a
6537  7: a
6538  8: a
6539  9: a
6540 10: a
6541 11: a
6542 12: a
6543 13: a
6544 14: a
6545
6546 /a*\d/B
6547 ------------------------------------------------------------------
6548         Bra
6549         a*+
6550         \d
6551         Ket
6552         End
6553 ------------------------------------------------------------------
6554
6555 /a*\D/B
6556 ------------------------------------------------------------------
6557         Bra
6558         a*
6559         \D
6560         Ket
6561         End
6562 ------------------------------------------------------------------
6563
6564 /0*\d/B
6565 ------------------------------------------------------------------
6566         Bra
6567         0*
6568         \d
6569         Ket
6570         End
6571 ------------------------------------------------------------------
6572
6573 /0*\D/B
6574 ------------------------------------------------------------------
6575         Bra
6576         0*+
6577         \D
6578         Ket
6579         End
6580 ------------------------------------------------------------------
6581
6582 /a*\s/B
6583 ------------------------------------------------------------------
6584         Bra
6585         a*+
6586         \s
6587         Ket
6588         End
6589 ------------------------------------------------------------------
6590
6591 /a*\S/B
6592 ------------------------------------------------------------------
6593         Bra
6594         a*
6595         \S
6596         Ket
6597         End
6598 ------------------------------------------------------------------
6599
6600 / *\s/B
6601 ------------------------------------------------------------------
6602         Bra
6603          *
6604         \s
6605         Ket
6606         End
6607 ------------------------------------------------------------------
6608
6609 / *\S/B
6610 ------------------------------------------------------------------
6611         Bra
6612          *+
6613         \S
6614         Ket
6615         End
6616 ------------------------------------------------------------------
6617
6618 /a*\w/B
6619 ------------------------------------------------------------------
6620         Bra
6621         a*
6622         \w
6623         Ket
6624         End
6625 ------------------------------------------------------------------
6626
6627 /a*\W/B
6628 ------------------------------------------------------------------
6629         Bra
6630         a*+
6631         \W
6632         Ket
6633         End
6634 ------------------------------------------------------------------
6635
6636 /=*\w/B
6637 ------------------------------------------------------------------
6638         Bra
6639         =*+
6640         \w
6641         Ket
6642         End
6643 ------------------------------------------------------------------
6644
6645 /=*\W/B
6646 ------------------------------------------------------------------
6647         Bra
6648         =*
6649         \W
6650         Ket
6651         End
6652 ------------------------------------------------------------------
6653
6654 /\d*a/B
6655 ------------------------------------------------------------------
6656         Bra
6657         \d*+
6658         a
6659         Ket
6660         End
6661 ------------------------------------------------------------------
6662
6663 /\d*2/B
6664 ------------------------------------------------------------------
6665         Bra
6666         \d*
6667         2
6668         Ket
6669         End
6670 ------------------------------------------------------------------
6671
6672 /\d*\d/B
6673 ------------------------------------------------------------------
6674         Bra
6675         \d*
6676         \d
6677         Ket
6678         End
6679 ------------------------------------------------------------------
6680
6681 /\d*\D/B
6682 ------------------------------------------------------------------
6683         Bra
6684         \d*+
6685         \D
6686         Ket
6687         End
6688 ------------------------------------------------------------------
6689
6690 /\d*\s/B
6691 ------------------------------------------------------------------
6692         Bra
6693         \d*+
6694         \s
6695         Ket
6696         End
6697 ------------------------------------------------------------------
6698
6699 /\d*\S/B
6700 ------------------------------------------------------------------
6701         Bra
6702         \d*
6703         \S
6704         Ket
6705         End
6706 ------------------------------------------------------------------
6707
6708 /\d*\w/B
6709 ------------------------------------------------------------------
6710         Bra
6711         \d*
6712         \w
6713         Ket
6714         End
6715 ------------------------------------------------------------------
6716
6717 /\d*\W/B
6718 ------------------------------------------------------------------
6719         Bra
6720         \d*+
6721         \W
6722         Ket
6723         End
6724 ------------------------------------------------------------------
6725
6726 /\D*a/B
6727 ------------------------------------------------------------------
6728         Bra
6729         \D*
6730         a
6731         Ket
6732         End
6733 ------------------------------------------------------------------
6734
6735 /\D*2/B
6736 ------------------------------------------------------------------
6737         Bra
6738         \D*+
6739         2
6740         Ket
6741         End
6742 ------------------------------------------------------------------
6743
6744 /\D*\d/B
6745 ------------------------------------------------------------------
6746         Bra
6747         \D*+
6748         \d
6749         Ket
6750         End
6751 ------------------------------------------------------------------
6752
6753 /\D*\D/B
6754 ------------------------------------------------------------------
6755         Bra
6756         \D*
6757         \D
6758         Ket
6759         End
6760 ------------------------------------------------------------------
6761
6762 /\D*\s/B
6763 ------------------------------------------------------------------
6764         Bra
6765         \D*
6766         \s
6767         Ket
6768         End
6769 ------------------------------------------------------------------
6770
6771 /\D*\S/B
6772 ------------------------------------------------------------------
6773         Bra
6774         \D*
6775         \S
6776         Ket
6777         End
6778 ------------------------------------------------------------------
6779
6780 /\D*\w/B
6781 ------------------------------------------------------------------
6782         Bra
6783         \D*
6784         \w
6785         Ket
6786         End
6787 ------------------------------------------------------------------
6788
6789 /\D*\W/B
6790 ------------------------------------------------------------------
6791         Bra
6792         \D*
6793         \W
6794         Ket
6795         End
6796 ------------------------------------------------------------------
6797
6798 /\s*a/B
6799 ------------------------------------------------------------------
6800         Bra
6801         \s*+
6802         a
6803         Ket
6804         End
6805 ------------------------------------------------------------------
6806
6807 /\s*2/B
6808 ------------------------------------------------------------------
6809         Bra
6810         \s*+
6811         2
6812         Ket
6813         End
6814 ------------------------------------------------------------------
6815
6816 /\s*\d/B
6817 ------------------------------------------------------------------
6818         Bra
6819         \s*+
6820         \d
6821         Ket
6822         End
6823 ------------------------------------------------------------------
6824
6825 /\s*\D/B
6826 ------------------------------------------------------------------
6827         Bra
6828         \s*
6829         \D
6830         Ket
6831         End
6832 ------------------------------------------------------------------
6833
6834 /\s*\s/B
6835 ------------------------------------------------------------------
6836         Bra
6837         \s*
6838         \s
6839         Ket
6840         End
6841 ------------------------------------------------------------------
6842
6843 /\s*\S/B
6844 ------------------------------------------------------------------
6845         Bra
6846         \s*+
6847         \S
6848         Ket
6849         End
6850 ------------------------------------------------------------------
6851
6852 /\s*\w/B
6853 ------------------------------------------------------------------
6854         Bra
6855         \s*+
6856         \w
6857         Ket
6858         End
6859 ------------------------------------------------------------------
6860
6861 /\s*\W/B
6862 ------------------------------------------------------------------
6863         Bra
6864         \s*
6865         \W
6866         Ket
6867         End
6868 ------------------------------------------------------------------
6869
6870 /\S*a/B
6871 ------------------------------------------------------------------
6872         Bra
6873         \S*
6874         a
6875         Ket
6876         End
6877 ------------------------------------------------------------------
6878
6879 /\S*2/B
6880 ------------------------------------------------------------------
6881         Bra
6882         \S*
6883         2
6884         Ket
6885         End
6886 ------------------------------------------------------------------
6887
6888 /\S*\d/B
6889 ------------------------------------------------------------------
6890         Bra
6891         \S*
6892         \d
6893         Ket
6894         End
6895 ------------------------------------------------------------------
6896
6897 /\S*\D/B
6898 ------------------------------------------------------------------
6899         Bra
6900         \S*
6901         \D
6902         Ket
6903         End
6904 ------------------------------------------------------------------
6905
6906 /\S*\s/B
6907 ------------------------------------------------------------------
6908         Bra
6909         \S*+
6910         \s
6911         Ket
6912         End
6913 ------------------------------------------------------------------
6914
6915 /\S*\S/B
6916 ------------------------------------------------------------------
6917         Bra
6918         \S*
6919         \S
6920         Ket
6921         End
6922 ------------------------------------------------------------------
6923
6924 /\S*\w/B
6925 ------------------------------------------------------------------
6926         Bra
6927         \S*
6928         \w
6929         Ket
6930         End
6931 ------------------------------------------------------------------
6932
6933 /\S*\W/B
6934 ------------------------------------------------------------------
6935         Bra
6936         \S*
6937         \W
6938         Ket
6939         End
6940 ------------------------------------------------------------------
6941
6942 /\w*a/B
6943 ------------------------------------------------------------------
6944         Bra
6945         \w*
6946         a
6947         Ket
6948         End
6949 ------------------------------------------------------------------
6950
6951 /\w*2/B
6952 ------------------------------------------------------------------
6953         Bra
6954         \w*
6955         2
6956         Ket
6957         End
6958 ------------------------------------------------------------------
6959
6960 /\w*\d/B
6961 ------------------------------------------------------------------
6962         Bra
6963         \w*
6964         \d
6965         Ket
6966         End
6967 ------------------------------------------------------------------
6968
6969 /\w*\D/B
6970 ------------------------------------------------------------------
6971         Bra
6972         \w*
6973         \D
6974         Ket
6975         End
6976 ------------------------------------------------------------------
6977
6978 /\w*\s/B
6979 ------------------------------------------------------------------
6980         Bra
6981         \w*+
6982         \s
6983         Ket
6984         End
6985 ------------------------------------------------------------------
6986
6987 /\w*\S/B
6988 ------------------------------------------------------------------
6989         Bra
6990         \w*
6991         \S
6992         Ket
6993         End
6994 ------------------------------------------------------------------
6995
6996 /\w*\w/B
6997 ------------------------------------------------------------------
6998         Bra
6999         \w*
7000         \w
7001         Ket
7002         End
7003 ------------------------------------------------------------------
7004
7005 /\w*\W/B
7006 ------------------------------------------------------------------
7007         Bra
7008         \w*+
7009         \W
7010         Ket
7011         End
7012 ------------------------------------------------------------------
7013
7014 /\W*a/B
7015 ------------------------------------------------------------------
7016         Bra
7017         \W*+
7018         a
7019         Ket
7020         End
7021 ------------------------------------------------------------------
7022
7023 /\W*2/B
7024 ------------------------------------------------------------------
7025         Bra
7026         \W*+
7027         2
7028         Ket
7029         End
7030 ------------------------------------------------------------------
7031
7032 /\W*\d/B
7033 ------------------------------------------------------------------
7034         Bra
7035         \W*+
7036         \d
7037         Ket
7038         End
7039 ------------------------------------------------------------------
7040
7041 /\W*\D/B
7042 ------------------------------------------------------------------
7043         Bra
7044         \W*
7045         \D
7046         Ket
7047         End
7048 ------------------------------------------------------------------
7049
7050 /\W*\s/B
7051 ------------------------------------------------------------------
7052         Bra
7053         \W*
7054         \s
7055         Ket
7056         End
7057 ------------------------------------------------------------------
7058
7059 /\W*\S/B
7060 ------------------------------------------------------------------
7061         Bra
7062         \W*
7063         \S
7064         Ket
7065         End
7066 ------------------------------------------------------------------
7067
7068 /\W*\w/B
7069 ------------------------------------------------------------------
7070         Bra
7071         \W*+
7072         \w
7073         Ket
7074         End
7075 ------------------------------------------------------------------
7076
7077 /\W*\W/B
7078 ------------------------------------------------------------------
7079         Bra
7080         \W*
7081         \W
7082         Ket
7083         End
7084 ------------------------------------------------------------------
7085
7086 /[^a]+a/B
7087 ------------------------------------------------------------------
7088         Bra
7089         [^a]++
7090         a
7091         Ket
7092         End
7093 ------------------------------------------------------------------
7094
7095 /[^a]+a/Bi
7096 ------------------------------------------------------------------
7097         Bra
7098      /i [^a]++
7099      /i a
7100         Ket
7101         End
7102 ------------------------------------------------------------------
7103
7104 /[^a]+A/Bi
7105 ------------------------------------------------------------------
7106         Bra
7107      /i [^a]++
7108      /i A
7109         Ket
7110         End
7111 ------------------------------------------------------------------
7112
7113 /[^a]+b/B
7114 ------------------------------------------------------------------
7115         Bra
7116         [^a]+
7117         b
7118         Ket
7119         End
7120 ------------------------------------------------------------------
7121
7122 /[^a]+\d/B
7123 ------------------------------------------------------------------
7124         Bra
7125         [^a]+
7126         \d
7127         Ket
7128         End
7129 ------------------------------------------------------------------
7130
7131 /a*[^a]/B
7132 ------------------------------------------------------------------
7133         Bra
7134         a*+
7135         [^a]
7136         Ket
7137         End
7138 ------------------------------------------------------------------
7139
7140 /(?P<abc>x)(?P<xyz>y)/I
7141 Capturing subpattern count = 2
7142 Named capturing subpatterns:
7143   abc   1
7144   xyz   2
7145 First code unit = 'x'
7146 Last code unit = 'y'
7147 Subject length lower bound = 2
7148     xy\=copy=abc,copy=xyz
7149  0: xy
7150  1: x
7151  2: y
7152   C x (1) abc (group 1)
7153   C y (1) xyz (group 2)
7154
7155 /(?<abc>x)(?'xyz'y)/I
7156 Capturing subpattern count = 2
7157 Named capturing subpatterns:
7158   abc   1
7159   xyz   2
7160 First code unit = 'x'
7161 Last code unit = 'y'
7162 Subject length lower bound = 2
7163     xy\=copy=abc,copy=xyz
7164  0: xy
7165  1: x
7166  2: y
7167   C x (1) abc (group 1)
7168   C y (1) xyz (group 2)
7169
7170 /(?<abc'x)(?'xyz'y)/I
7171 Failed: error 142 at offset 6: syntax error in subpattern name (missing terminator)
7172
7173 /(?<abc>x)(?'xyz>y)/I
7174 Failed: error 142 at offset 15: syntax error in subpattern name (missing terminator)
7175
7176 /(?P'abc'x)(?P<xyz>y)/I
7177 Failed: error 141 at offset 3: unrecognized character after (?P
7178
7179 /^(?:(?(ZZ)a|b)(?<ZZ>X))+/
7180     bXaX
7181  0: bXaX
7182  1: X
7183     bXbX
7184  0: bX
7185  1: X
7186 \= Expect no match
7187     aXaX
7188 No match
7189     aXbX
7190 No match
7191
7192 /^(?P>abc)(?<abcd>xxx)/
7193 Failed: error 115 at offset 5: reference to non-existent subpattern
7194
7195 /^(?P>abc)(?<abc>x|y)/
7196     xx
7197  0: xx
7198  1: x
7199     xy
7200  0: xy
7201  1: y
7202     yy
7203  0: yy
7204  1: y
7205     yx
7206  0: yx
7207  1: x
7208
7209 /^(?P>abc)(?P<abc>x|y)/
7210     xx
7211  0: xx
7212  1: x
7213     xy
7214  0: xy
7215  1: y
7216     yy
7217  0: yy
7218  1: y
7219     yx
7220  0: yx
7221  1: x
7222
7223 /^((?(abc)a|b)(?<abc>x|y))+/
7224     bxay
7225  0: bxay
7226  1: ay
7227  2: y
7228     bxby
7229  0: bx
7230  1: bx
7231  2: x
7232 \= Expect no match
7233     axby
7234 No match
7235
7236 /^(((?P=abc)|X)(?<abc>x|y))+/
7237     XxXxxx
7238  0: XxXxxx
7239  1: xx
7240  2: x
7241  3: x
7242     XxXyyx
7243  0: XxXyyx
7244  1: yx
7245  2: y
7246  3: x
7247     XxXyxx
7248  0: XxXy
7249  1: Xy
7250  2: X
7251  3: y
7252 \= Expect no match
7253     x
7254 No match
7255
7256 /^(?1)(abc)/
7257     abcabc
7258  0: abcabc
7259  1: abc
7260
7261 /^(?:(?:\1|X)(a|b))+/
7262     Xaaa
7263  0: Xaaa
7264  1: a
7265     Xaba
7266  0: Xa
7267  1: a
7268
7269 /^[\E\Qa\E-\Qz\E]+/B
7270 ------------------------------------------------------------------
7271         Bra
7272         ^
7273         [a-z]++
7274         Ket
7275         End
7276 ------------------------------------------------------------------
7277
7278 /^[a\Q]bc\E]/B
7279 ------------------------------------------------------------------
7280         Bra
7281         ^
7282         [\]a-c]
7283         Ket
7284         End
7285 ------------------------------------------------------------------
7286
7287 /^[a-\Q\E]/B
7288 ------------------------------------------------------------------
7289         Bra
7290         ^
7291         [\-a]
7292         Ket
7293         End
7294 ------------------------------------------------------------------
7295
7296 /^(?P>abc)[()](?<abc>)/B
7297 ------------------------------------------------------------------
7298         Bra
7299         ^
7300         Recurse
7301         [()]
7302         CBra 1
7303         Ket
7304         Ket
7305         End
7306 ------------------------------------------------------------------
7307
7308 /^((?(abc)y)[()](?P<abc>x))+/B
7309 ------------------------------------------------------------------
7310         Bra
7311         ^
7312         CBra 1
7313         Cond
7314       2 Cond ref
7315         y
7316         Ket
7317         [()]
7318         CBra 2
7319         x
7320         Ket
7321         KetRmax
7322         Ket
7323         End
7324 ------------------------------------------------------------------
7325     (xy)x
7326  0: (xy)x
7327  1: y)x
7328  2: x
7329
7330 /^(?P>abc)\Q()\E(?<abc>)/B
7331 ------------------------------------------------------------------
7332         Bra
7333         ^
7334         Recurse
7335         ()
7336         CBra 1
7337         Ket
7338         Ket
7339         End
7340 ------------------------------------------------------------------
7341
7342 /^(?P>abc)[a\Q(]\E(](?<abc>)/B
7343 ------------------------------------------------------------------
7344         Bra
7345         ^
7346         Recurse
7347         [(\]a]
7348         CBra 1
7349         Ket
7350         Ket
7351         End
7352 ------------------------------------------------------------------
7353
7354 /^(?P>abc) # this is (a comment)
7355   (?<abc>)/Bx
7356 ------------------------------------------------------------------
7357         Bra
7358         ^
7359         Recurse
7360         CBra 1
7361         Ket
7362         Ket
7363         End
7364 ------------------------------------------------------------------
7365
7366 /^\W*(?:(?<one>(?<two>.)\W*(?&one)\W*\k<two>|)|(?<three>(?<four>.)\W*(?&three)\W*\k'four'|\W*.\W*))\W*$/Ii
7367 Capturing subpattern count = 4
7368 Max back reference = 4
7369 Named capturing subpatterns:
7370   four    4
7371   one     1
7372   three   3
7373   two     2
7374 May match empty string
7375 Compile options: caseless
7376 Overall options: anchored caseless
7377 Subject length lower bound = 0
7378     1221
7379  0: 1221
7380  1: 1221
7381  2: 1
7382     Satan, oscillate my metallic sonatas!
7383  0: Satan, oscillate my metallic sonatas!
7384  1: <unset>
7385  2: <unset>
7386  3: Satan, oscillate my metallic sonatas
7387  4: S
7388     A man, a plan, a canal: Panama!
7389  0: A man, a plan, a canal: Panama!
7390  1: <unset>
7391  2: <unset>
7392  3: A man, a plan, a canal: Panama
7393  4: A
7394     Able was I ere I saw Elba.
7395  0: Able was I ere I saw Elba.
7396  1: <unset>
7397  2: <unset>
7398  3: Able was I ere I saw Elba
7399  4: A
7400 \= Expect no match
7401     The quick brown fox
7402 No match
7403
7404 /(?=(\w+))\1:/I
7405 Capturing subpattern count = 1
7406 Max back reference = 1
7407 Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P 
7408   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 
7409 Last code unit = ':'
7410 Subject length lower bound = 2
7411     abcd:
7412  0: abcd:
7413  1: abcd
7414
7415 /(?=(?'abc'\w+))\k<abc>:/I
7416 Capturing subpattern count = 1
7417 Max back reference = 1
7418 Named capturing subpatterns:
7419   abc   1
7420 Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P 
7421   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 
7422 Last code unit = ':'
7423 Subject length lower bound = 2
7424     abcd:
7425  0: abcd:
7426  1: abcd
7427
7428 /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/dupnames
7429     adaa
7430  0: adaa
7431  1: a
7432  2: d
7433 \= Expect no match
7434     addd
7435 No match
7436     adbb
7437 No match
7438
7439 /(?'abc'a|b)(?<abc>d|e)(?&abc){2}/dupnames
7440     bdaa
7441  0: bdaa
7442  1: b
7443  2: d
7444     bdab
7445  0: bdab
7446  1: b
7447  2: d
7448 \= Expect no match
7449     bddd
7450 No match
7451
7452 /(?(<bc))/
7453 Failed: error 142 at offset 6: syntax error in subpattern name (missing terminator)
7454
7455 /(?(''))/
7456 Failed: error 162 at offset 4: subpattern name expected
7457
7458 /(?('R')stuff)/
7459 Failed: error 115 at offset 4: reference to non-existent subpattern
7460
7461 /((abc (?(R) (?(R1)1) (?(R2)2) X  |  (?1)  (?2)   (?R) ))) /x
7462     abcabc1Xabc2XabcXabcabc
7463  0: abcabc1Xabc2XabcX
7464  1: abcabc1Xabc2XabcX
7465  2: abcabc1Xabc2XabcX
7466
7467 /(?<A> (?'B' abc (?(R) (?(R&A)1) (?(R&B)2) X  |  (?1)  (?2)   (?R) ))) /x
7468     abcabc1Xabc2XabcXabcabc
7469  0: abcabc1Xabc2XabcX
7470  1: abcabc1Xabc2XabcX
7471  2: abcabc1Xabc2XabcX
7472
7473 /(?<A> (?'B' abc (?(R) (?(R&C)1) (?(R&B)2) X  |  (?1)  (?2)   (?R) ))) /x
7474 Failed: error 115 at offset 27: reference to non-existent subpattern
7475
7476 /^(?(DEFINE) abc | xyz ) /x
7477 Failed: error 154 at offset 4: DEFINE group contains more than one branch
7478
7479 /(?(DEFINE) abc) xyz/Ix
7480 Capturing subpattern count = 0
7481 Options: extended
7482 First code unit = 'x'
7483 Last code unit = 'z'
7484 Subject length lower bound = 3
7485
7486 /(a|)*\d/
7487   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4\=ovector=0
7488  0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
7489  1: 
7490 \= Expect no match
7491   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\=ovector=0
7492 No match
7493
7494 /^a.b/newline=lf
7495     a\rb
7496  0: a\x0db
7497 \= Expect no match
7498     a\nb
7499 No match
7500
7501 /^a.b/newline=cr
7502     a\nb
7503  0: a\x0ab
7504 \= Expect no match
7505     a\rb
7506 No match
7507
7508 /^a.b/newline=anycrlf
7509     a\x85b
7510  0: a\x85b
7511 \= Expect no match
7512     a\rb
7513 No match
7514
7515 /^a.b/newline=any
7516 \= Expect no match
7517     a\nb
7518 No match
7519     a\rb
7520 No match
7521     a\x85b
7522 No match
7523
7524 /^abc./gmx,newline=any
7525     abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK
7526  0: abc1
7527  0: abc2
7528  0: abc3
7529  0: abc4
7530  0: abc5
7531  0: abc6
7532  0: abc7
7533
7534 /abc.$/gmx,newline=any
7535     abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7 abc9
7536  0: abc1
7537  0: abc2
7538  0: abc3
7539  0: abc4
7540  0: abc5
7541  0: abc6
7542  0: abc9
7543
7544 /^a\Rb/bsr=unicode
7545     a\nb
7546  0: a\x0ab
7547     a\rb
7548  0: a\x0db
7549     a\r\nb
7550  0: a\x0d\x0ab
7551     a\x0bb
7552  0: a\x0bb
7553     a\x0cb
7554  0: a\x0cb
7555     a\x85b
7556  0: a\x85b
7557 \= Expect no match
7558     a\n\rb
7559 No match
7560
7561 /^a\R*b/bsr=unicode
7562     ab
7563  0: ab
7564     a\nb
7565  0: a\x0ab
7566     a\rb
7567  0: a\x0db
7568     a\r\nb
7569  0: a\x0d\x0ab
7570     a\x0bb
7571  0: a\x0bb
7572     a\x0cb
7573  0: a\x0cb
7574     a\x85b
7575  0: a\x85b
7576     a\n\rb
7577  0: a\x0a\x0db
7578     a\n\r\x85\x0cb
7579  0: a\x0a\x0d\x85\x0cb
7580
7581 /^a\R+b/bsr=unicode
7582     a\nb
7583  0: a\x0ab
7584     a\rb
7585  0: a\x0db
7586     a\r\nb
7587  0: a\x0d\x0ab
7588     a\x0bb
7589  0: a\x0bb
7590     a\x0cb
7591  0: a\x0cb
7592     a\x85b
7593  0: a\x85b
7594     a\n\rb
7595  0: a\x0a\x0db
7596     a\n\r\x85\x0cb
7597  0: a\x0a\x0d\x85\x0cb
7598 \= Expect no match
7599     ab
7600 No match
7601
7602 /^a\R{1,3}b/bsr=unicode
7603     a\nb
7604  0: a\x0ab
7605     a\n\rb
7606  0: a\x0a\x0db
7607     a\n\r\x85b
7608  0: a\x0a\x0d\x85b
7609     a\r\n\r\nb
7610  0: a\x0d\x0a\x0d\x0ab
7611     a\r\n\r\n\r\nb
7612  0: a\x0d\x0a\x0d\x0a\x0d\x0ab
7613     a\n\r\n\rb
7614  0: a\x0a\x0d\x0a\x0db
7615     a\n\n\r\nb
7616  0: a\x0a\x0a\x0d\x0ab
7617 \= Expect no match
7618     a\n\n\n\rb
7619 No match
7620     a\r
7621 No match
7622
7623 /(?&abc)X(?<abc>P)/I
7624 Capturing subpattern count = 1
7625 Named capturing subpatterns:
7626   abc   1
7627 Last code unit = 'P'
7628 Subject length lower bound = 3
7629     abcPXP123
7630  0: PXP
7631  1: P
7632
7633 /(?1)X(?<abc>P)/I
7634 Capturing subpattern count = 1
7635 Named capturing subpatterns:
7636   abc   1
7637 Last code unit = 'P'
7638 Subject length lower bound = 3
7639     abcPXP123
7640  0: PXP
7641  1: P
7642
7643 /(?:a(?&abc)b)*(?<abc>x)/
7644     123axbaxbaxbx456
7645  0: axbaxbaxbx
7646  1: x
7647     123axbaxbaxb456
7648  0: x
7649  1: x
7650
7651 /(?:a(?&abc)b){1,5}(?<abc>x)/
7652     123axbaxbaxbx456
7653  0: axbaxbaxbx
7654  1: x
7655
7656 /(?:a(?&abc)b){2,5}(?<abc>x)/
7657     123axbaxbaxbx456
7658  0: axbaxbaxbx
7659  1: x
7660
7661 /(?:a(?&abc)b){2,}(?<abc>x)/
7662     123axbaxbaxbx456
7663  0: axbaxbaxbx
7664  1: x
7665
7666 /(abc)(?i:(?1))/
7667     defabcabcxyz
7668  0: abcabc
7669  1: abc
7670 \= Expect no match
7671     DEFabcABCXYZ
7672 No match
7673
7674 /(abc)(?:(?i)(?1))/
7675     defabcabcxyz
7676  0: abcabc
7677  1: abc
7678 \= Expect no match
7679     DEFabcABCXYZ
7680 No match
7681
7682 /^(a)\g-2/
7683 Failed: error 115 at offset 8: reference to non-existent subpattern
7684
7685 /^(a)\g/
7686 Failed: error 157 at offset 6: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
7687
7688 /^(a)\g{0}/
7689 Failed: error 115 at offset 9: reference to non-existent subpattern
7690
7691 /^(a)\g{3/
7692 Failed: error 157 at offset 6: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
7693
7694 /^(a)\g{aa}/
7695 Failed: error 115 at offset 7: reference to non-existent subpattern
7696
7697 /^a.b/newline=lf
7698     a\rb
7699  0: a\x0db
7700 \= Expect no match
7701     a\nb
7702 No match
7703
7704 /.+foo/
7705     afoo
7706  0: afoo
7707 \= Expect no match
7708     \r\nfoo
7709 No match
7710     \nfoo
7711 No match
7712
7713 /.+foo/newline=crlf
7714     afoo
7715  0: afoo
7716     \nfoo
7717  0: \x0afoo
7718 \= Expect no match
7719     \r\nfoo
7720 No match
7721
7722 /.+foo/newline=any
7723     afoo
7724  0: afoo
7725 \= Expect no match
7726     \nfoo
7727 No match
7728     \r\nfoo
7729 No match
7730
7731 /.+foo/s
7732     afoo
7733  0: afoo
7734     \r\nfoo
7735  0: \x0d\x0afoo
7736     \nfoo
7737  0: \x0afoo
7738
7739 /^$/gm,newline=any
7740     abc\r\rxyz
7741  0: 
7742     abc\n\rxyz
7743  0: 
7744 \= Expect no match
7745     abc\r\nxyz
7746 No match
7747
7748 /(?m)^$/g,newline=any,aftertext
7749     abc\r\n\r\n
7750  0: 
7751  0+ \x0d\x0a
7752
7753 /(?m)^$|^\r\n/g,newline=any,aftertext
7754     abc\r\n\r\n
7755  0: 
7756  0+ \x0d\x0a
7757  0: \x0d\x0a
7758  0+ 
7759
7760 /(?m)$/g,newline=any,aftertext
7761     abc\r\n\r\n
7762  0: 
7763  0+ \x0d\x0a\x0d\x0a
7764  0: 
7765  0+ \x0d\x0a
7766  0: 
7767  0+ 
7768
7769 /abc.$/gmx,newline=anycrlf
7770     abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9
7771  0: abc1
7772  0: abc4
7773  0: abc5
7774  0: abc9
7775
7776 /^X/m
7777     XABC
7778  0: X
7779 \= Expect no match
7780     XABC\=notbol
7781 No match
7782
7783 /(ab|c)(?-1)/B
7784 ------------------------------------------------------------------
7785         Bra
7786         CBra 1
7787         ab
7788         Alt
7789         c
7790         Ket
7791         Recurse
7792         Ket
7793         End
7794 ------------------------------------------------------------------
7795     abc
7796  0: abc
7797  1: ab
7798
7799 /xy(?+1)(abc)/B
7800 ------------------------------------------------------------------
7801         Bra
7802         xy
7803         Recurse
7804         CBra 1
7805         abc
7806         Ket
7807         Ket
7808         End
7809 ------------------------------------------------------------------
7810     xyabcabc
7811  0: xyabcabc
7812  1: abc
7813 \= Expect no match
7814     xyabc
7815 No match
7816
7817 /x(?-0)y/
7818 Failed: error 126 at offset 5: a relative value of zero is not allowed
7819
7820 /x(?-1)y/
7821 Failed: error 115 at offset 5: reference to non-existent subpattern
7822
7823 /x(?+0)y/
7824 Failed: error 126 at offset 5: a relative value of zero is not allowed
7825
7826 /x(?+1)y/
7827 Failed: error 115 at offset 5: reference to non-existent subpattern
7828
7829 /^(abc)?(?(-1)X|Y)/B
7830 ------------------------------------------------------------------
7831         Bra
7832         ^
7833         Brazero
7834         CBra 1
7835         abc
7836         Ket
7837         Cond
7838       1 Cond ref
7839         X
7840         Alt
7841         Y
7842         Ket
7843         Ket
7844         End
7845 ------------------------------------------------------------------
7846     abcX
7847  0: abcX
7848  1: abc
7849     Y
7850  0: Y
7851 \= Expect no match
7852     abcY
7853 No match
7854
7855 /^((?(+1)X|Y)(abc))+/B
7856 ------------------------------------------------------------------
7857         Bra
7858         ^
7859         CBra 1
7860         Cond
7861       2 Cond ref
7862         X
7863         Alt
7864         Y
7865         Ket
7866         CBra 2
7867         abc
7868         Ket
7869         KetRmax
7870         Ket
7871         End
7872 ------------------------------------------------------------------
7873     YabcXabc
7874  0: YabcXabc
7875  1: Xabc
7876  2: abc
7877     YabcXabcXabc
7878  0: YabcXabcXabc
7879  1: Xabc
7880  2: abc
7881 \= Expect no match
7882     XabcXabc
7883 No match
7884
7885 /(?(-1)a)/B
7886 Failed: error 115 at offset 5: reference to non-existent subpattern
7887
7888 /((?(-1)a))/B
7889 ------------------------------------------------------------------
7890         Bra
7891         CBra 1
7892         Cond
7893       1 Cond ref
7894         a
7895         Ket
7896         Ket
7897         Ket
7898         End
7899 ------------------------------------------------------------------
7900
7901 /((?(-2)a))/B
7902 Failed: error 115 at offset 6: reference to non-existent subpattern
7903
7904 /^(?(+1)X|Y)(.)/B
7905 ------------------------------------------------------------------
7906         Bra
7907         ^
7908         Cond
7909       1 Cond ref
7910         X
7911         Alt
7912         Y
7913         Ket
7914         CBra 1
7915         Any
7916         Ket
7917         Ket
7918         End
7919 ------------------------------------------------------------------
7920     Y!
7921  0: Y!
7922  1: !
7923
7924 /(?<A>tom|bon)-\k{A}/
7925     tom-tom
7926  0: tom-tom
7927  1: tom
7928     bon-bon
7929  0: bon-bon
7930  1: bon
7931 \= Expect no match
7932     tom-bon
7933 No match
7934
7935 /\g{A/
7936 Failed: error 142 at offset 4: syntax error in subpattern name (missing terminator)
7937
7938 /(?|(abc)|(xyz))/B
7939 ------------------------------------------------------------------
7940         Bra
7941         Bra
7942         CBra 1
7943         abc
7944         Ket
7945         Alt
7946         CBra 1
7947         xyz
7948         Ket
7949         Ket
7950         Ket
7951         End
7952 ------------------------------------------------------------------
7953    >abc<
7954  0: abc
7955  1: abc
7956    >xyz<
7957  0: xyz
7958  1: xyz
7959
7960 /(x)(?|(abc)|(xyz))(x)/B
7961 ------------------------------------------------------------------
7962         Bra
7963         CBra 1
7964         x
7965         Ket
7966         Bra
7967         CBra 2
7968         abc
7969         Ket
7970         Alt
7971         CBra 2
7972         xyz
7973         Ket
7974         Ket
7975         CBra 3
7976         x
7977         Ket
7978         Ket
7979         End
7980 ------------------------------------------------------------------
7981     xabcx
7982  0: xabcx
7983  1: x
7984  2: abc
7985  3: x
7986     xxyzx
7987  0: xxyzx
7988  1: x
7989  2: xyz
7990  3: x
7991
7992 /(x)(?|(abc)(pqr)|(xyz))(x)/B
7993 ------------------------------------------------------------------
7994         Bra
7995         CBra 1
7996         x
7997         Ket
7998         Bra
7999         CBra 2
8000         abc
8001         Ket
8002         CBra 3
8003         pqr
8004         Ket
8005         Alt
8006         CBra 2
8007         xyz
8008         Ket
8009         Ket
8010         CBra 4
8011         x
8012         Ket
8013         Ket
8014         End
8015 ------------------------------------------------------------------
8016     xabcpqrx
8017  0: xabcpqrx
8018  1: x
8019  2: abc
8020  3: pqr
8021  4: x
8022     xxyzx
8023  0: xxyzx
8024  1: x
8025  2: xyz
8026  3: <unset>
8027  4: x
8028
8029 /\H++X/B
8030 ------------------------------------------------------------------
8031         Bra
8032         \H++
8033         X
8034         Ket
8035         End
8036 ------------------------------------------------------------------
8037 \= Expect no match
8038     XXXX
8039 No match
8040
8041 /\H+\hY/B
8042 ------------------------------------------------------------------
8043         Bra
8044         \H++
8045         \h
8046         Y
8047         Ket
8048         End
8049 ------------------------------------------------------------------
8050     XXXX Y
8051  0: XXXX Y
8052
8053 /\H+ Y/B
8054 ------------------------------------------------------------------
8055         Bra
8056         \H++
8057          Y
8058         Ket
8059         End
8060 ------------------------------------------------------------------
8061
8062 /\h+A/B
8063 ------------------------------------------------------------------
8064         Bra
8065         \h++
8066         A
8067         Ket
8068         End
8069 ------------------------------------------------------------------
8070
8071 /\v*B/B
8072 ------------------------------------------------------------------
8073         Bra
8074         \v*+
8075         B
8076         Ket
8077         End
8078 ------------------------------------------------------------------
8079
8080 /\V+\x0a/B
8081 ------------------------------------------------------------------
8082         Bra
8083         \V++
8084         \x0a
8085         Ket
8086         End
8087 ------------------------------------------------------------------
8088
8089 /A+\h/B
8090 ------------------------------------------------------------------
8091         Bra
8092         A++
8093         \h
8094         Ket
8095         End
8096 ------------------------------------------------------------------
8097
8098 / *\H/B
8099 ------------------------------------------------------------------
8100         Bra
8101          *+
8102         \H
8103         Ket
8104         End
8105 ------------------------------------------------------------------
8106
8107 /A*\v/B
8108 ------------------------------------------------------------------
8109         Bra
8110         A*+
8111         \v
8112         Ket
8113         End
8114 ------------------------------------------------------------------
8115
8116 /\x0b*\V/B
8117 ------------------------------------------------------------------
8118         Bra
8119         \x0b*+
8120         \V
8121         Ket
8122         End
8123 ------------------------------------------------------------------
8124
8125 /\d+\h/B
8126 ------------------------------------------------------------------
8127         Bra
8128         \d++
8129         \h
8130         Ket
8131         End
8132 ------------------------------------------------------------------
8133
8134 /\d*\v/B
8135 ------------------------------------------------------------------
8136         Bra
8137         \d*+
8138         \v
8139         Ket
8140         End
8141 ------------------------------------------------------------------
8142
8143 /S+\h\S+\v/B
8144 ------------------------------------------------------------------
8145         Bra
8146         S++
8147         \h
8148         \S++
8149         \v
8150         Ket
8151         End
8152 ------------------------------------------------------------------
8153
8154 /\w{3,}\h\w+\v/B
8155 ------------------------------------------------------------------
8156         Bra
8157         \w{3}
8158         \w*+
8159         \h
8160         \w++
8161         \v
8162         Ket
8163         End
8164 ------------------------------------------------------------------
8165
8166 /\h+\d\h+\w\h+\S\h+\H/B
8167 ------------------------------------------------------------------
8168         Bra
8169         \h++
8170         \d
8171         \h++
8172         \w
8173         \h++
8174         \S
8175         \h++
8176         \H
8177         Ket
8178         End
8179 ------------------------------------------------------------------
8180
8181 /\v+\d\v+\w\v+\S\v+\V/B
8182 ------------------------------------------------------------------
8183         Bra
8184         \v++
8185         \d
8186         \v++
8187         \w
8188         \v++
8189         \S
8190         \v++
8191         \V
8192         Ket
8193         End
8194 ------------------------------------------------------------------
8195
8196 /\H+\h\H+\d/B
8197 ------------------------------------------------------------------
8198         Bra
8199         \H++
8200         \h
8201         \H+
8202         \d
8203         Ket
8204         End
8205 ------------------------------------------------------------------
8206
8207 /\V+\v\V+\w/B
8208 ------------------------------------------------------------------
8209         Bra
8210         \V++
8211         \v
8212         \V+
8213         \w
8214         Ket
8215         End
8216 ------------------------------------------------------------------
8217
8218 /\( (?: [^()]* | (?R) )* \)/x
8219 (0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(00)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)\=jitstack=1024
8220  0: (0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(00)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)
8221
8222 /[\E]AAA/
8223 Failed: error 106 at offset 7: missing terminating ] for character class
8224
8225 /[\Q\E]AAA/
8226 Failed: error 106 at offset 9: missing terminating ] for character class
8227
8228 /[^\E]AAA/
8229 Failed: error 106 at offset 8: missing terminating ] for character class
8230
8231 /[^\Q\E]AAA/
8232 Failed: error 106 at offset 10: missing terminating ] for character class
8233
8234 /[\E^]AAA/
8235 Failed: error 106 at offset 8: missing terminating ] for character class
8236
8237 /[\Q\E^]AAA/
8238 Failed: error 106 at offset 10: missing terminating ] for character class
8239
8240 /A(*PRUNE)B(*SKIP)C(*THEN)D(*COMMIT)E(*F)F(*FAIL)G(?!)H(*ACCEPT)I/B
8241 ------------------------------------------------------------------
8242         Bra
8243         A
8244         *PRUNE
8245         B
8246         *SKIP
8247         C
8248         *THEN
8249         D
8250         *COMMIT
8251         E
8252         *FAIL
8253         F
8254         *FAIL
8255         G
8256         *FAIL
8257         H
8258         *ACCEPT
8259         I
8260         Ket
8261         End
8262 ------------------------------------------------------------------
8263
8264 /^a+(*FAIL)/auto_callout
8265 \= Expect no match
8266     aaaaaa
8267 --->aaaaaa
8268  +0 ^          ^
8269  +1 ^          a+
8270  +3 ^     ^    (*FAIL)
8271  +3 ^    ^     (*FAIL)
8272  +3 ^   ^      (*FAIL)
8273  +3 ^  ^       (*FAIL)
8274  +3 ^ ^        (*FAIL)
8275  +3 ^^         (*FAIL)
8276 No match
8277
8278 /a+b?c+(*FAIL)/auto_callout
8279 \= Expect no match
8280     aaabccc
8281 --->aaabccc
8282  +0 ^           a+
8283  +2 ^  ^        b?
8284  +4 ^   ^       c+
8285  +6 ^      ^    (*FAIL)
8286  +6 ^     ^     (*FAIL)
8287  +6 ^    ^      (*FAIL)
8288  +0  ^          a+
8289  +2  ^ ^        b?
8290  +4  ^  ^       c+
8291  +6  ^     ^    (*FAIL)
8292  +6  ^    ^     (*FAIL)
8293  +6  ^   ^      (*FAIL)
8294  +0   ^         a+
8295  +2   ^^        b?
8296  +4   ^ ^       c+
8297  +6   ^    ^    (*FAIL)
8298  +6   ^   ^     (*FAIL)
8299  +6   ^  ^      (*FAIL)
8300 No match
8301
8302 /a+b?(*PRUNE)c+(*FAIL)/auto_callout
8303 \= Expect no match
8304     aaabccc
8305 --->aaabccc
8306  +0 ^           a+
8307  +2 ^  ^        b?
8308  +4 ^   ^       (*PRUNE)
8309 +12 ^   ^       c+
8310 +14 ^      ^    (*FAIL)
8311 +14 ^     ^     (*FAIL)
8312 +14 ^    ^      (*FAIL)
8313  +0  ^          a+
8314  +2  ^ ^        b?
8315  +4  ^  ^       (*PRUNE)
8316 +12  ^  ^       c+
8317 +14  ^     ^    (*FAIL)
8318 +14  ^    ^     (*FAIL)
8319 +14  ^   ^      (*FAIL)
8320  +0   ^         a+
8321  +2   ^^        b?
8322  +4   ^ ^       (*PRUNE)
8323 +12   ^ ^       c+
8324 +14   ^    ^    (*FAIL)
8325 +14   ^   ^     (*FAIL)
8326 +14   ^  ^      (*FAIL)
8327 No match
8328
8329 /a+b?(*COMMIT)c+(*FAIL)/auto_callout
8330 \= Expect no match
8331     aaabccc
8332 --->aaabccc
8333  +0 ^           a+
8334  +2 ^  ^        b?
8335  +4 ^   ^       (*COMMIT)
8336 +13 ^   ^       c+
8337 +15 ^      ^    (*FAIL)
8338 +15 ^     ^     (*FAIL)
8339 +15 ^    ^      (*FAIL)
8340 No match
8341
8342 /a+b?(*SKIP)c+(*FAIL)/auto_callout
8343 \= Expect no match
8344     aaabcccaaabccc
8345 --->aaabcccaaabccc
8346  +0 ^                  a+
8347  +2 ^  ^               b?
8348  +4 ^   ^              (*SKIP)
8349 +11 ^   ^              c+
8350 +13 ^      ^           (*FAIL)
8351 +13 ^     ^            (*FAIL)
8352 +13 ^    ^             (*FAIL)
8353  +0        ^           a+
8354  +2        ^  ^        b?
8355  +4        ^   ^       (*SKIP)
8356 +11        ^   ^       c+
8357 +13        ^      ^    (*FAIL)
8358 +13        ^     ^     (*FAIL)
8359 +13        ^    ^      (*FAIL)
8360 No match
8361
8362 /a+b?(*THEN)c+(*FAIL)/auto_callout
8363 \= Expect no match
8364     aaabccc
8365 --->aaabccc
8366  +0 ^           a+
8367  +2 ^  ^        b?
8368  +4 ^   ^       (*THEN)
8369 +11 ^   ^       c+
8370 +13 ^      ^    (*FAIL)
8371 +13 ^     ^     (*FAIL)
8372 +13 ^    ^      (*FAIL)
8373  +0  ^          a+
8374  +2  ^ ^        b?
8375  +4  ^  ^       (*THEN)
8376 +11  ^  ^       c+
8377 +13  ^     ^    (*FAIL)
8378 +13  ^    ^     (*FAIL)
8379 +13  ^   ^      (*FAIL)
8380  +0   ^         a+
8381  +2   ^^        b?
8382  +4   ^ ^       (*THEN)
8383 +11   ^ ^       c+
8384 +13   ^    ^    (*FAIL)
8385 +13   ^   ^     (*FAIL)
8386 +13   ^  ^      (*FAIL)
8387 No match
8388
8389 /a(*MARK)b/
8390 Failed: error 166 at offset 7: (*MARK) must have an argument
8391
8392 /(?i:A{1,}\6666666666)/
8393 Failed: error 161 at offset 19: group number is too big
8394
8395 /\g6666666666/
8396 Failed: error 161 at offset 7: group number is too big
8397
8398 /[\g6666666666]/B
8399 ------------------------------------------------------------------
8400         Bra
8401         [6g]
8402         Ket
8403         End
8404 ------------------------------------------------------------------
8405
8406 /(?1)\c[/
8407 Failed: error 115 at offset 3: reference to non-existent subpattern
8408
8409 /.+A/newline=crlf
8410 \= Expect no match
8411     \r\nA
8412 No match
8413
8414 /\nA/newline=crlf
8415     \r\nA
8416  0: \x0aA
8417
8418 /[\r\n]A/newline=crlf
8419     \r\nA
8420  0: \x0aA
8421
8422 /(\r|\n)A/newline=crlf
8423     \r\nA
8424  0: \x0aA
8425  1: \x0a
8426
8427 /a(*CR)b/
8428 Failed: error 160 at offset 5: (*VERB) not recognized or malformed
8429
8430 /(*CR)a.b/
8431     a\nb
8432  0: a\x0ab
8433 \= Expect no match
8434     a\rb
8435 No match
8436
8437 /(*CR)a.b/newline=lf
8438     a\nb
8439  0: a\x0ab
8440 \= Expect no match
8441     a\rb
8442 No match
8443
8444 /(*LF)a.b/newline=CRLF
8445     a\rb
8446  0: a\x0db
8447 \= Expect no match
8448     a\nb
8449 No match
8450
8451 /(*CRLF)a.b/
8452     a\rb
8453  0: a\x0db
8454     a\nb
8455  0: a\x0ab
8456 \= Expect no match
8457     a\r\nb
8458 No match
8459
8460 /(*ANYCRLF)a.b/newline=CR
8461 \= Expect no match
8462     a\rb
8463 No match
8464     a\nb
8465 No match
8466     a\r\nb
8467 No match
8468
8469 /(*ANY)a.b/newline=cr
8470 \= Expect no match
8471     a\rb
8472 No match
8473     a\nb
8474 No match
8475     a\r\nb
8476 No match
8477     a\x85b
8478 No match
8479
8480 /(*ANY).*/g
8481     abc\r\ndef
8482  0: abc
8483  0: 
8484  0: def
8485  0: 
8486
8487 /(*ANYCRLF).*/g
8488     abc\r\ndef
8489  0: abc
8490  0: 
8491  0: def
8492  0: 
8493
8494 /(*CRLF).*/g
8495     abc\r\ndef
8496  0: abc
8497  0: 
8498  0: def
8499  0: 
8500
8501 /(*NUL)^.*/
8502     a\nb\x00ccc
8503  0: a\x0ab
8504
8505 /(*NUL)^.*/s
8506     a\nb\x00ccc
8507  0: a\x0ab\x00ccc
8508
8509 /^x/m,newline=NUL
8510     ab\x00xy
8511  0: x
8512
8513 /'#comment' 0d 0a 00 '^x\' 0a 'y'/x,newline=nul,hex
8514     x\nyz
8515  0: x\x0ay
8516
8517 /(*NUL)^X\NY/
8518     X\nY
8519  0: X\x0aY
8520     X\rY
8521  0: X\x0dY
8522 \= Expect no match
8523     X\x00Y
8524 No match
8525
8526 /a\Rb/I,bsr=anycrlf
8527 Capturing subpattern count = 0
8528 \R matches CR, LF, or CRLF
8529 First code unit = 'a'
8530 Last code unit = 'b'
8531 Subject length lower bound = 3
8532     a\rb
8533  0: a\x0db
8534     a\nb
8535  0: a\x0ab
8536     a\r\nb
8537  0: a\x0d\x0ab
8538 \= Expect no match
8539     a\x85b
8540 No match
8541     a\x0bb
8542 No match
8543
8544 /a\Rb/I,bsr=unicode
8545 Capturing subpattern count = 0
8546 \R matches any Unicode newline
8547 First code unit = 'a'
8548 Last code unit = 'b'
8549 Subject length lower bound = 3
8550     a\rb
8551  0: a\x0db
8552     a\nb
8553  0: a\x0ab
8554     a\r\nb
8555  0: a\x0d\x0ab
8556     a\x85b
8557  0: a\x85b
8558     a\x0bb
8559  0: a\x0bb
8560
8561 /a\R?b/I,bsr=anycrlf
8562 Capturing subpattern count = 0
8563 \R matches CR, LF, or CRLF
8564 First code unit = 'a'
8565 Last code unit = 'b'
8566 Subject length lower bound = 2
8567     a\rb
8568  0: a\x0db
8569     a\nb
8570  0: a\x0ab
8571     a\r\nb
8572  0: a\x0d\x0ab
8573 \= Expect no match
8574     a\x85b
8575 No match
8576     a\x0bb
8577 No match
8578
8579 /a\R?b/I,bsr=unicode
8580 Capturing subpattern count = 0
8581 \R matches any Unicode newline
8582 First code unit = 'a'
8583 Last code unit = 'b'
8584 Subject length lower bound = 2
8585     a\rb
8586  0: a\x0db
8587     a\nb
8588  0: a\x0ab
8589     a\r\nb
8590  0: a\x0d\x0ab
8591     a\x85b
8592  0: a\x85b
8593     a\x0bb
8594  0: a\x0bb
8595
8596 /a\R{2,4}b/I,bsr=anycrlf
8597 Capturing subpattern count = 0
8598 \R matches CR, LF, or CRLF
8599 First code unit = 'a'
8600 Last code unit = 'b'
8601 Subject length lower bound = 4
8602     a\r\n\nb
8603  0: a\x0d\x0a\x0ab
8604     a\n\r\rb
8605  0: a\x0a\x0d\x0db
8606     a\r\n\r\n\r\n\r\nb
8607  0: a\x0d\x0a\x0d\x0a\x0d\x0a\x0d\x0ab
8608 \= Expect no match
8609     a\x85\x85b
8610 No match
8611     a\x0b\x0bb
8612 No match
8613
8614 /a\R{2,4}b/I,bsr=unicode
8615 Capturing subpattern count = 0
8616 \R matches any Unicode newline
8617 First code unit = 'a'
8618 Last code unit = 'b'
8619 Subject length lower bound = 4
8620     a\r\rb
8621  0: a\x0d\x0db
8622     a\n\n\nb
8623  0: a\x0a\x0a\x0ab
8624     a\r\n\n\r\rb
8625  0: a\x0d\x0a\x0a\x0d\x0db
8626     a\x85\x85b
8627  0: a\x85\x85b
8628     a\x0b\x0bb
8629  0: a\x0b\x0bb
8630 \= Expect no match
8631     a\r\r\r\r\rb
8632 No match
8633
8634 /(*BSR_ANYCRLF)a\Rb/I
8635 Capturing subpattern count = 0
8636 \R matches CR, LF, or CRLF
8637 First code unit = 'a'
8638 Last code unit = 'b'
8639 Subject length lower bound = 3
8640     a\nb
8641  0: a\x0ab
8642     a\rb
8643  0: a\x0db
8644
8645 /(*BSR_UNICODE)a\Rb/I
8646 Capturing subpattern count = 0
8647 \R matches any Unicode newline
8648 First code unit = 'a'
8649 Last code unit = 'b'
8650 Subject length lower bound = 3
8651     a\x85b
8652  0: a\x85b
8653
8654 /(*BSR_ANYCRLF)(*CRLF)a\Rb/I
8655 Capturing subpattern count = 0
8656 \R matches CR, LF, or CRLF
8657 Forced newline is CRLF
8658 First code unit = 'a'
8659 Last code unit = 'b'
8660 Subject length lower bound = 3
8661     a\nb
8662  0: a\x0ab
8663     a\rb
8664  0: a\x0db
8665
8666 /(*CRLF)(*BSR_UNICODE)a\Rb/I
8667 Capturing subpattern count = 0
8668 \R matches any Unicode newline
8669 Forced newline is CRLF
8670 First code unit = 'a'
8671 Last code unit = 'b'
8672 Subject length lower bound = 3
8673     a\x85b
8674  0: a\x85b
8675
8676 /(*CRLF)(*BSR_ANYCRLF)(*CR)ab/I
8677 Capturing subpattern count = 0
8678 \R matches CR, LF, or CRLF
8679 Forced newline is CR
8680 First code unit = 'a'
8681 Last code unit = 'b'
8682 Subject length lower bound = 2
8683
8684 /(?<a>)(?&)/
8685 Failed: error 162 at offset 9: subpattern name expected
8686
8687 /(?<abc>)(?&a)/
8688 Failed: error 115 at offset 11: reference to non-existent subpattern
8689
8690 /(?<a>)(?&aaaaaaaaaaaaaaaaaaaaaaa)/
8691 Failed: error 115 at offset 9: reference to non-existent subpattern
8692
8693 /(?+-a)/
8694 Failed: error 129 at offset 2: digit expected after (?+ or (?-
8695
8696 /(?-+a)/
8697 Failed: error 111 at offset 3: unrecognized character after (? or (?-
8698
8699 /(?(-1))/
8700 Failed: error 115 at offset 5: reference to non-existent subpattern
8701
8702 /(?(+10))/
8703 Failed: error 115 at offset 4: reference to non-existent subpattern
8704
8705 /(?(10))/
8706 Failed: error 115 at offset 3: reference to non-existent subpattern
8707
8708 /(?(+2))()()/
8709
8710 /(?(2))()()/
8711
8712 /\k''/
8713 Failed: error 162 at offset 3: subpattern name expected
8714
8715 /\k<>/
8716 Failed: error 162 at offset 3: subpattern name expected
8717
8718 /\k{}/
8719 Failed: error 162 at offset 3: subpattern name expected
8720
8721 /\k/
8722 Failed: error 169 at offset 2: \k is not followed by a braced, angle-bracketed, or quoted name
8723
8724 /\kabc/
8725 Failed: error 169 at offset 2: \k is not followed by a braced, angle-bracketed, or quoted name
8726
8727 /(?P=)/
8728 Failed: error 162 at offset 4: subpattern name expected
8729
8730 /(?P>)/
8731 Failed: error 162 at offset 4: subpattern name expected
8732
8733 /[[:foo:]]/
8734 Failed: error 130 at offset 3: unknown POSIX class name
8735
8736 /[[:1234:]]/
8737 Failed: error 130 at offset 3: unknown POSIX class name
8738
8739 /[[:f\oo:]]/
8740 Failed: error 130 at offset 3: unknown POSIX class name
8741
8742 /[[: :]]/
8743 Failed: error 130 at offset 3: unknown POSIX class name
8744
8745 /[[:...:]]/
8746 Failed: error 130 at offset 3: unknown POSIX class name
8747
8748 /[[:l\ower:]]/
8749 Failed: error 130 at offset 3: unknown POSIX class name
8750
8751 /[[:abc\:]]/
8752 Failed: error 130 at offset 3: unknown POSIX class name
8753
8754 /[abc[:x\]pqr:]]/
8755 Failed: error 130 at offset 6: unknown POSIX class name
8756
8757 /[[:a\dz:]]/
8758 Failed: error 130 at offset 3: unknown POSIX class name
8759
8760 /(^(a|b\g<-1'c))/
8761 Failed: error 157 at offset 8: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
8762
8763 /^(?+1)(?<a>x|y){0}z/
8764     xzxx
8765  0: xz
8766     yzyy
8767  0: yz
8768 \= Expect no match
8769     xxz
8770 No match
8771
8772 /(\3)(\1)(a)/
8773 \= Expect no match
8774     cat
8775 No match
8776
8777 /(\3)(\1)(a)/alt_bsux,allow_empty_class,match_unset_backref,dupnames
8778     cat
8779  0: a
8780  1: 
8781  2: 
8782  3: a
8783
8784 /TA]/
8785     The ACTA] comes
8786  0: TA]
8787
8788 /TA]/alt_bsux,allow_empty_class,match_unset_backref,dupnames
8789     The ACTA] comes
8790  0: TA]
8791
8792 /(?2)[]a()b](abc)/
8793 Failed: error 115 at offset 3: reference to non-existent subpattern
8794     abcbabc
8795
8796 /(?2)[^]a()b](abc)/
8797 Failed: error 115 at offset 3: reference to non-existent subpattern
8798     abcbabc
8799
8800 /(?1)[]a()b](abc)/
8801     abcbabc
8802  0: abcbabc
8803  1: abc
8804 \= Expect no match
8805     abcXabc
8806 No match
8807
8808 /(?1)[^]a()b](abc)/
8809     abcXabc
8810  0: abcXabc
8811  1: abc
8812 \= Expect no match
8813     abcbabc
8814 No match
8815
8816 /(?2)[]a()b](abc)(xyz)/
8817     xyzbabcxyz
8818  0: xyzbabcxyz
8819  1: abc
8820  2: xyz
8821
8822 /(?&N)[]a(?<N>)](?<M>abc)/
8823 Failed: error 115 at offset 3: reference to non-existent subpattern
8824    abc<abc
8825
8826 /(?&N)[]a(?<N>)](abc)/
8827 Failed: error 115 at offset 3: reference to non-existent subpattern
8828    abc<abc
8829
8830 /a[]b/
8831 Failed: error 106 at offset 4: missing terminating ] for character class
8832
8833 /a[^]b/
8834 Failed: error 106 at offset 5: missing terminating ] for character class
8835
8836 /a[]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
8837 \= Expect no match
8838     ab
8839 No match
8840
8841 /a[]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
8842 \= Expect no match
8843     ab
8844 No match
8845
8846 /a[]*+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
8847 \= Expect no match
8848     ab
8849 No match
8850
8851 /a[^]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
8852     aXb
8853  0: aXb
8854     a\nb
8855  0: a\x0ab
8856 \= Expect no match
8857     ab
8858 No match
8859
8860 /a[^]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
8861     aXb
8862  0: aXb
8863     a\nX\nXb
8864  0: a\x0aX\x0aXb
8865 \= Expect no match
8866     ab
8867 No match
8868
8869 /a(?!)b/B
8870 ------------------------------------------------------------------
8871         Bra
8872         a
8873         *FAIL
8874         b
8875         Ket
8876         End
8877 ------------------------------------------------------------------
8878
8879 /(?!)?a/B
8880 ------------------------------------------------------------------
8881         Bra
8882         Brazero
8883         Assert not
8884         Ket
8885         a
8886         Ket
8887         End
8888 ------------------------------------------------------------------
8889     ab
8890  0: a
8891
8892 /a(*FAIL)+b/
8893 Failed: error 109 at offset 8: quantifier does not follow a repeatable item
8894
8895 /(abc|pqr|123){0}[xyz]/I
8896 Capturing subpattern count = 1
8897 Starting code units: x y z 
8898 Subject length lower bound = 1
8899
8900 /(?(?=.*b)b|^)/I,auto_callout
8901 Capturing subpattern count = 0
8902 May match empty string
8903 Options: auto_callout
8904 Subject length lower bound = 0
8905    adc
8906 --->adc
8907  +0 ^       (?
8908  +2 ^       (?=
8909  +5 ^       .*
8910  +7 ^  ^    b
8911  +7 ^ ^     b
8912  +7 ^^      b
8913  +7 ^       b
8914 +11 ^       ^
8915 +12 ^       )
8916 +13 ^       End of pattern
8917  0: 
8918    abc
8919 --->abc
8920  +0 ^       (?
8921  +2 ^       (?=
8922  +5 ^       .*
8923  +7 ^  ^    b
8924  +7 ^ ^     b
8925  +7 ^^      b
8926  +8 ^ ^     )
8927  +9 ^       b
8928  +0  ^      (?
8929  +2  ^      (?=
8930  +5  ^      .*
8931  +7  ^ ^    b
8932  +7  ^^     b
8933  +7  ^      b
8934  +8  ^^     )
8935  +9  ^      b
8936 +10  ^^     |
8937 +13  ^^     End of pattern
8938  0: b
8939
8940 /(?(?=b).*b|^d)/I
8941 Capturing subpattern count = 0
8942 Subject length lower bound = 1
8943
8944 /(?(?=.*b).*b|^d)/I
8945 Capturing subpattern count = 0
8946 Subject length lower bound = 1
8947
8948 /xyz/auto_callout
8949   xyz
8950 --->xyz
8951  +0 ^       x
8952  +1 ^^      y
8953  +2 ^ ^     z
8954  +3 ^  ^    End of pattern
8955  0: xyz
8956   abcxyz
8957 --->abcxyz
8958  +0    ^       x
8959  +1    ^^      y
8960  +2    ^ ^     z
8961  +3    ^  ^    End of pattern
8962  0: xyz
8963 \= Expect no match
8964   abc
8965 No match
8966   abcxypqr
8967 No match
8968
8969 /xyz/auto_callout,no_start_optimize
8970   abcxyz
8971 --->abcxyz
8972  +0 ^          x
8973  +0  ^         x
8974  +0   ^        x
8975  +0    ^       x
8976  +1    ^^      y
8977  +2    ^ ^     z
8978  +3    ^  ^    End of pattern
8979  0: xyz
8980 \= Expect no match
8981   abc
8982 --->abc
8983  +0 ^       x
8984  +0  ^      x
8985  +0   ^     x
8986  +0    ^    x
8987 No match
8988   abcxypqr
8989 --->abcxypqr
8990  +0 ^            x
8991  +0  ^           x
8992  +0   ^          x
8993  +0    ^         x
8994  +1    ^^        y
8995  +2    ^ ^       z
8996  +0     ^        x
8997  +0      ^       x
8998  +0       ^      x
8999  +0        ^     x
9000  +0         ^    x
9001 No match
9002
9003 /(*NO_START_OPT)xyz/auto_callout
9004   abcxyz
9005 --->abcxyz
9006 +15 ^          x
9007 +15  ^         x
9008 +15   ^        x
9009 +15    ^       x
9010 +16    ^^      y
9011 +17    ^ ^     z
9012 +18    ^  ^    End of pattern
9013  0: xyz
9014
9015 /(*NO_AUTO_POSSESS)a+b/B
9016 ------------------------------------------------------------------
9017         Bra
9018         a+
9019         b
9020         Ket
9021         End
9022 ------------------------------------------------------------------
9023
9024 /xyz/auto_callout,no_start_optimize
9025   abcxyz
9026 --->abcxyz
9027  +0 ^          x
9028  +0  ^         x
9029  +0   ^        x
9030  +0    ^       x
9031  +1    ^^      y
9032  +2    ^ ^     z
9033  +3    ^  ^    End of pattern
9034  0: xyz
9035
9036 /^"((?(?=[a])[^"])|b)*"$/auto_callout
9037     "ab"
9038 --->"ab"
9039  +0 ^        ^
9040  +1 ^        "
9041  +2 ^^       (
9042  +3 ^^       (?
9043  +5 ^^       (?=
9044  +8 ^^       [a]
9045 +11 ^ ^      )
9046 +12 ^^       [^"]
9047 +16 ^ ^      )
9048 +17 ^ ^      |
9049  +3 ^ ^      (?
9050  +5 ^ ^      (?=
9051  +8 ^ ^      [a]
9052 +17 ^ ^      |
9053 +21 ^ ^      "
9054 +18 ^ ^      b
9055 +19 ^  ^     )*
9056  +3 ^  ^     (?
9057  +5 ^  ^     (?=
9058  +8 ^  ^     [a]
9059 +17 ^  ^     |
9060 +21 ^  ^     "
9061 +22 ^   ^    $
9062 +23 ^   ^    End of pattern
9063  0: "ab"
9064  1: 
9065
9066 /^"((?(?=[a])[^"])|b)*"$/
9067     "ab"
9068  0: "ab"
9069  1: 
9070
9071 /^X(?5)(a)(?|(b)|(q))(c)(d)Y/
9072 Failed: error 115 at offset 5: reference to non-existent subpattern
9073     XYabcdY
9074
9075 /^X(?&N)(a)(?|(b)|(q))(c)(d)(?<N>Y)/
9076     XYabcdY
9077  0: XYabcdY
9078  1: a
9079  2: b
9080  3: c
9081  4: d
9082  5: Y
9083
9084 /Xa{2,4}b/
9085     X\=ps
9086 Partial match: X
9087     Xa\=ps
9088 Partial match: Xa
9089     Xaa\=ps
9090 Partial match: Xaa
9091     Xaaa\=ps
9092 Partial match: Xaaa
9093     Xaaaa\=ps
9094 Partial match: Xaaaa
9095
9096 /Xa{2,4}?b/
9097     X\=ps
9098 Partial match: X
9099     Xa\=ps
9100 Partial match: Xa
9101     Xaa\=ps
9102 Partial match: Xaa
9103     Xaaa\=ps
9104 Partial match: Xaaa
9105     Xaaaa\=ps
9106 Partial match: Xaaaa
9107
9108 /Xa{2,4}+b/
9109     X\=ps
9110 Partial match: X
9111     Xa\=ps
9112 Partial match: Xa
9113     Xaa\=ps
9114 Partial match: Xaa
9115     Xaaa\=ps
9116 Partial match: Xaaa
9117     Xaaaa\=ps
9118 Partial match: Xaaaa
9119
9120 /X\d{2,4}b/
9121     X\=ps
9122 Partial match: X
9123     X3\=ps
9124 Partial match: X3
9125     X33\=ps
9126 Partial match: X33
9127     X333\=ps
9128 Partial match: X333
9129     X3333\=ps
9130 Partial match: X3333
9131
9132 /X\d{2,4}?b/
9133     X\=ps
9134 Partial match: X
9135     X3\=ps
9136 Partial match: X3
9137     X33\=ps
9138 Partial match: X33
9139     X333\=ps
9140 Partial match: X333
9141     X3333\=ps
9142 Partial match: X3333
9143
9144 /X\d{2,4}+b/
9145     X\=ps
9146 Partial match: X
9147     X3\=ps
9148 Partial match: X3
9149     X33\=ps
9150 Partial match: X33
9151     X333\=ps
9152 Partial match: X333
9153     X3333\=ps
9154 Partial match: X3333
9155
9156 /X\D{2,4}b/
9157     X\=ps
9158 Partial match: X
9159     Xa\=ps
9160 Partial match: Xa
9161     Xaa\=ps
9162 Partial match: Xaa
9163     Xaaa\=ps
9164 Partial match: Xaaa
9165     Xaaaa\=ps
9166 Partial match: Xaaaa
9167
9168 /X\D{2,4}?b/
9169     X\=ps
9170 Partial match: X
9171     Xa\=ps
9172 Partial match: Xa
9173     Xaa\=ps
9174 Partial match: Xaa
9175     Xaaa\=ps
9176 Partial match: Xaaa
9177     Xaaaa\=ps
9178 Partial match: Xaaaa
9179
9180 /X\D{2,4}+b/
9181     X\=ps
9182 Partial match: X
9183     Xa\=ps
9184 Partial match: Xa
9185     Xaa\=ps
9186 Partial match: Xaa
9187     Xaaa\=ps
9188 Partial match: Xaaa
9189     Xaaaa\=ps
9190 Partial match: Xaaaa
9191
9192 /X[abc]{2,4}b/
9193     X\=ps
9194 Partial match: X
9195     Xa\=ps
9196 Partial match: Xa
9197     Xaa\=ps
9198 Partial match: Xaa
9199     Xaaa\=ps
9200 Partial match: Xaaa
9201     Xaaaa\=ps
9202 Partial match: Xaaaa
9203
9204 /X[abc]{2,4}?b/
9205     X\=ps
9206 Partial match: X
9207     Xa\=ps
9208 Partial match: Xa
9209     Xaa\=ps
9210 Partial match: Xaa
9211     Xaaa\=ps
9212 Partial match: Xaaa
9213     Xaaaa\=ps
9214 Partial match: Xaaaa
9215
9216 /X[abc]{2,4}+b/
9217     X\=ps
9218 Partial match: X
9219     Xa\=ps
9220 Partial match: Xa
9221     Xaa\=ps
9222 Partial match: Xaa
9223     Xaaa\=ps
9224 Partial match: Xaaa
9225     Xaaaa\=ps
9226 Partial match: Xaaaa
9227
9228 /X[^a]{2,4}b/
9229     X\=ps
9230 Partial match: X
9231     Xz\=ps
9232 Partial match: Xz
9233     Xzz\=ps
9234 Partial match: Xzz
9235     Xzzz\=ps
9236 Partial match: Xzzz
9237     Xzzzz\=ps
9238 Partial match: Xzzzz
9239
9240 /X[^a]{2,4}?b/
9241     X\=ps
9242 Partial match: X
9243     Xz\=ps
9244 Partial match: Xz
9245     Xzz\=ps
9246 Partial match: Xzz
9247     Xzzz\=ps
9248 Partial match: Xzzz
9249     Xzzzz\=ps
9250 Partial match: Xzzzz
9251
9252 /X[^a]{2,4}+b/
9253     X\=ps
9254 Partial match: X
9255     Xz\=ps
9256 Partial match: Xz
9257     Xzz\=ps
9258 Partial match: Xzz
9259     Xzzz\=ps
9260 Partial match: Xzzz
9261     Xzzzz\=ps
9262 Partial match: Xzzzz
9263
9264 /(Y)X\1{2,4}b/
9265     YX\=ps
9266 Partial match: YX
9267     YXY\=ps
9268 Partial match: YXY
9269     YXYY\=ps
9270 Partial match: YXYY
9271     YXYYY\=ps
9272 Partial match: YXYYY
9273     YXYYYY\=ps
9274 Partial match: YXYYYY
9275
9276 /(Y)X\1{2,4}?b/
9277     YX\=ps
9278 Partial match: YX
9279     YXY\=ps
9280 Partial match: YXY
9281     YXYY\=ps
9282 Partial match: YXYY
9283     YXYYY\=ps
9284 Partial match: YXYYY
9285     YXYYYY\=ps
9286 Partial match: YXYYYY
9287
9288 /(Y)X\1{2,4}+b/
9289     YX\=ps
9290 Partial match: YX
9291     YXY\=ps
9292 Partial match: YXY
9293     YXYY\=ps
9294 Partial match: YXYY
9295     YXYYY\=ps
9296 Partial match: YXYYY
9297     YXYYYY\=ps
9298 Partial match: YXYYYY
9299
9300 /\++\KZ|\d+X|9+Y/startchar
9301     ++++123999\=ps
9302 Partial match: 123999
9303     ++++123999Y\=ps
9304  0: 999Y
9305     ++++Z1234\=ps
9306  0: ++++Z
9307     ^^^^
9308
9309 /Z(*F)/
9310 \= Expect no match
9311     Z\=ps
9312 No match
9313     ZA\=ps
9314 No match
9315
9316 /Z(?!)/
9317 \= Expect no match
9318     Z\=ps
9319 No match
9320     ZA\=ps
9321 No match
9322
9323 /dog(sbody)?/
9324     dogs\=ps
9325  0: dog
9326     dogs\=ph
9327 Partial match: dogs
9328
9329 /dog(sbody)??/
9330     dogs\=ps
9331  0: dog
9332     dogs\=ph
9333  0: dog
9334
9335 /dog|dogsbody/
9336     dogs\=ps
9337  0: dog
9338     dogs\=ph
9339  0: dog
9340
9341 /dogsbody|dog/
9342     dogs\=ps
9343  0: dog
9344     dogs\=ph
9345 Partial match: dogs
9346
9347 /\bthe cat\b/
9348     the cat\=ps
9349  0: the cat
9350     the cat\=ph
9351 Partial match: the cat
9352
9353 /abc/
9354    abc\=ps
9355  0: abc
9356    abc\=ph
9357  0: abc
9358
9359 /abc\K123/startchar
9360     xyzabc123pqr
9361  0: abc123
9362     ^^^
9363     xyzabc12\=ps
9364 Partial match: abc12
9365     xyzabc12\=ph
9366 Partial match: abc12
9367
9368 /(?<=abc)123/
9369     xyzabc123pqr
9370  0: 123
9371     xyzabc12\=ps
9372 Partial match: abc12
9373                <<<
9374     xyzabc12\=ph
9375 Partial match: abc12
9376                <<<
9377
9378 /\babc\b/
9379     +++abc+++
9380  0: abc
9381     +++ab\=ps
9382 Partial match: +ab
9383                <
9384     +++ab\=ph
9385 Partial match: +ab
9386                <
9387
9388 /(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/B
9389 ------------------------------------------------------------------
9390         Bra
9391         Recurse
9392         Recurse
9393         Cond
9394         Cond false
9395         CBra 1
9396         <
9397         [^m]
9398         [^>]
9399         >
9400         [^<]
9401         Ket
9402         CBra 2
9403         \w*+
9404         Ket
9405         Ket
9406         Ket
9407         End
9408 ------------------------------------------------------------------
9409
9410 /(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/B
9411 ------------------------------------------------------------------
9412         Bra
9413         Recurse
9414         Recurse
9415         Cond
9416         Cond false
9417         CBra 1
9418         <
9419         [\x00-/:-\xff] (neg)
9420         [^>]
9421         >
9422         [^<]
9423         Ket
9424         CBra 2
9425         \w*+
9426         Ket
9427         Ket
9428         Ket
9429         End
9430 ------------------------------------------------------------------
9431
9432 /(ab)(x(y)z(cd(*ACCEPT)))pq/B
9433 ------------------------------------------------------------------
9434         Bra
9435         CBra 1
9436         ab
9437         Ket
9438         CBra 2
9439         x
9440         CBra 3
9441         y
9442         Ket
9443         z
9444         CBra 4
9445         cd
9446         Close 4
9447         Close 2
9448         *ACCEPT
9449         Ket
9450         Ket
9451         pq
9452         Ket
9453         End
9454 ------------------------------------------------------------------
9455
9456 /abc\K/aftertext,startchar
9457     abcdef
9458  0: abc
9459     ^^^
9460  0+ def
9461     abcdef\=notempty_atstart
9462  0: abc
9463     ^^^
9464  0+ def
9465     xyzabcdef\=notempty_atstart
9466  0: abc
9467     ^^^
9468  0+ def
9469 \= Expect no match
9470     abcdef\=notempty
9471 No match
9472     xyzabcdef\=notempty
9473 No match
9474
9475 /^(?:(?=abc)|abc\K)/aftertext,startchar
9476     abcdef
9477  0: 
9478  0+ abcdef
9479     abcdef\=notempty_atstart
9480  0: abc
9481     ^^^
9482  0+ def
9483 \= Expect no match
9484     abcdef\=notempty
9485 No match
9486
9487 /a?b?/aftertext
9488     xyz
9489  0: 
9490  0+ xyz
9491     xyzabc
9492  0: 
9493  0+ xyzabc
9494     xyzabc\=notempty
9495  0: ab
9496  0+ c
9497     xyzabc\=notempty_atstart
9498  0: 
9499  0+ yzabc
9500     xyz\=notempty_atstart
9501  0: 
9502  0+ yz
9503 \= Expect no match
9504     xyz\=notempty
9505 No match
9506
9507 /^a?b?/aftertext
9508     xyz
9509  0: 
9510  0+ xyz
9511     xyzabc
9512  0: 
9513  0+ xyzabc
9514 \= Expect no match
9515     xyzabc\=notempty
9516 No match
9517     xyzabc\=notempty_atstart
9518 No match
9519     xyz\=notempty_atstart
9520 No match
9521     xyz\=notempty
9522 No match
9523
9524 /^(?<name>a|b\g<name>c)/
9525     aaaa
9526  0: a
9527  1: a
9528     bacxxx
9529  0: bac
9530  1: bac
9531     bbaccxxx
9532  0: bbacc
9533  1: bbacc
9534     bbbacccxx
9535  0: bbbaccc
9536  1: bbbaccc
9537
9538 /^(?<name>a|b\g'name'c)/
9539     aaaa
9540  0: a
9541  1: a
9542     bacxxx
9543  0: bac
9544  1: bac
9545     bbaccxxx
9546  0: bbacc
9547  1: bbacc
9548     bbbacccxx
9549  0: bbbaccc
9550  1: bbbaccc
9551
9552 /^(a|b\g<1>c)/
9553     aaaa
9554  0: a
9555  1: a
9556     bacxxx
9557  0: bac
9558  1: bac
9559     bbaccxxx
9560  0: bbacc
9561  1: bbacc
9562     bbbacccxx
9563  0: bbbaccc
9564  1: bbbaccc
9565
9566 /^(a|b\g'1'c)/
9567     aaaa
9568  0: a
9569  1: a
9570     bacxxx
9571  0: bac
9572  1: bac
9573     bbaccxxx
9574  0: bbacc
9575  1: bbacc
9576     bbbacccxx
9577  0: bbbaccc
9578  1: bbbaccc
9579
9580 /^(a|b\g'-1'c)/
9581     aaaa
9582  0: a
9583  1: a
9584     bacxxx
9585  0: bac
9586  1: bac
9587     bbaccxxx
9588  0: bbacc
9589  1: bbacc
9590     bbbacccxx
9591  0: bbbaccc
9592  1: bbbaccc
9593
9594 /(^(a|b\g<-1>c))/
9595     aaaa
9596  0: a
9597  1: a
9598  2: a
9599     bacxxx
9600  0: bac
9601  1: bac
9602  2: bac
9603     bbaccxxx
9604  0: bbacc
9605  1: bbacc
9606  2: bbacc
9607     bbbacccxx
9608  0: bbbaccc
9609  1: bbbaccc
9610  2: bbbaccc
9611
9612 /(?-i:\g<name>)(?i:(?<name>a))/
9613     XaaX
9614  0: aa
9615  1: a
9616     XAAX
9617  0: AA
9618  1: A
9619
9620 /(?i:\g<name>)(?-i:(?<name>a))/
9621     XaaX
9622  0: aa
9623  1: a
9624 \= Expect no match
9625     XAAX
9626 No match
9627
9628 /(?-i:\g<+1>)(?i:(a))/
9629     XaaX
9630  0: aa
9631  1: a
9632     XAAX
9633  0: AA
9634  1: A
9635
9636 /(?=(?<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>\})\}))\{/
9637
9638 /(?<n>a|b|c)\g<n>*/
9639    abc
9640  0: abc
9641  1: a
9642    accccbbb
9643  0: accccbbb
9644  1: a
9645
9646 /^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/
9647     XYabcdY
9648  0: XYabcdY
9649  1: a
9650  2: b
9651  3: <unset>
9652  4: <unset>
9653  5: c
9654  6: d
9655  7: Y
9656
9657 /(?<=b(?1)|zzz)(a)/
9658     xbaax
9659  0: a
9660  1: a
9661     xzzzax
9662  0: a
9663  1: a
9664
9665 /(a)(?<=b\1)/
9666
9667 /(a)(?<=b+(?1))/
9668 Failed: error 125 at offset 3: lookbehind assertion is not fixed length
9669
9670 /(a+)(?<=b(?1))/
9671 Failed: error 125 at offset 4: lookbehind assertion is not fixed length
9672
9673 /(a(?<=b(?1)))/
9674 Failed: error 125 at offset 2: lookbehind assertion is not fixed length
9675
9676 /(?<=b(?1))xyz/
9677 Failed: error 115 at offset 8: reference to non-existent subpattern
9678
9679 /(?<=b(?1))xyz(b+)pqrstuvew/
9680 Failed: error 125 at offset 0: lookbehind assertion is not fixed length
9681
9682 /(a|bc)\1/I
9683 Capturing subpattern count = 1
9684 Max back reference = 1
9685 Starting code units: a b 
9686 Subject length lower bound = 2
9687
9688 /(a|bc)\1{2,3}/I
9689 Capturing subpattern count = 1
9690 Max back reference = 1
9691 Starting code units: a b 
9692 Subject length lower bound = 3
9693
9694 /(a|bc)(?1)/I
9695 Capturing subpattern count = 1
9696 Starting code units: a b 
9697 Subject length lower bound = 2
9698
9699 /(a|b\1)(a|b\1)/I
9700 Capturing subpattern count = 2
9701 Max back reference = 1
9702 Starting code units: a b 
9703 Subject length lower bound = 2
9704
9705 /(a|b\1){2}/I
9706 Capturing subpattern count = 1
9707 Max back reference = 1
9708 Starting code units: a b 
9709 Subject length lower bound = 2
9710
9711 /(a|bbbb\1)(a|bbbb\1)/I
9712 Capturing subpattern count = 2
9713 Max back reference = 1
9714 Starting code units: a b 
9715 Subject length lower bound = 2
9716
9717 /(a|bbbb\1){2}/I
9718 Capturing subpattern count = 1
9719 Max back reference = 1
9720 Starting code units: a b 
9721 Subject length lower bound = 2
9722
9723 /^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]/I
9724 Capturing subpattern count = 1
9725 Compile options: <none>
9726 Overall options: anchored
9727 First code unit = 'F'
9728 Last code unit = ':'
9729 Subject length lower bound = 22
9730
9731 /<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>/Iis
9732 Capturing subpattern count = 11
9733 Options: caseless dotall
9734 First code unit = '<'
9735 Last code unit = '>'
9736 Subject length lower bound = 47
9737
9738 "(?>.*/)foo"I
9739 Capturing subpattern count = 0
9740 Last code unit = 'o'
9741 Subject length lower bound = 4
9742
9743 /(?(?=[^a-z]+[a-z])  \d{2}-[a-z]{3}-\d{2}  |  \d{2}-\d{2}-\d{2} ) /Ix
9744 Capturing subpattern count = 0
9745 Options: extended
9746 Last code unit = '-'
9747 Subject length lower bound = 8
9748
9749 /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/Ii
9750 Capturing subpattern count = 1
9751 Options: caseless
9752 Starting code units: A B C a b c 
9753 Subject length lower bound = 1
9754
9755 /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/I
9756 Capturing subpattern count = 0
9757 Starting code units: c d 
9758 Last code unit = 'b'
9759 Subject length lower bound = 41
9760
9761 /<a[\s]+href[\s]*=[\s]*          # find <a href=
9762  ([\"\'])?                       # find single or double quote
9763  (?(1) (.*?)\1 | ([^\s]+))       # if quote found, match up to next matching
9764                                  # quote, otherwise match up to next space
9765 /Iisx
9766 Capturing subpattern count = 3
9767 Max back reference = 1
9768 Options: caseless dotall extended
9769 First code unit = '<'
9770 Last code unit = '='
9771 Subject length lower bound = 9
9772
9773 /^(?!:)                       # colon disallowed at start
9774   (?:                         # start of item
9775     (?: [0-9a-f]{1,4} |       # 1-4 hex digits or
9776     (?(1)0 | () ) )           # if null previously matched, fail; else null
9777     :                         # followed by colon
9778   ){1,7}                      # end item; 1-7 of them required
9779   [0-9a-f]{1,4} $             # final hex number at end of string
9780   (?(1)|.)                    # check that there was an empty component
9781   /Iix
9782 Capturing subpattern count = 1
9783 Max back reference = 1
9784 Compile options: caseless extended
9785 Overall options: anchored caseless extended
9786 Last code unit = ':'
9787 Subject length lower bound = 2
9788
9789 /(?|(?<a>A)|(?<a>B))/I
9790 Capturing subpattern count = 1
9791 Named capturing subpatterns:
9792   a   1
9793 Starting code units: A B 
9794 Subject length lower bound = 1
9795     AB\=copy=a
9796  0: A
9797  1: A
9798   C A (1) a (group 1)
9799     BA\=copy=a
9800  0: B
9801  1: B
9802   C B (1) a (group 1)
9803
9804 /(?|(?<a>A)|(?<b>B))/
9805 Failed: error 165 at offset 16: different names for subpatterns of the same number are not allowed
9806
9807 /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |
9808     b(?<quote> (?<apostrophe>')|(?<realquote>")) )
9809     (?('quote')[a-z]+|[0-9]+)/Ix,dupnames
9810 Capturing subpattern count = 6
9811 Max back reference = 4
9812 Named capturing subpatterns:
9813   apostrophe   2
9814   apostrophe   5
9815   quote        1
9816   quote        4
9817   realquote    3
9818   realquote    6
9819 Options: dupnames extended
9820 Starting code units: a b 
9821 Subject length lower bound = 3
9822     a"aaaaa
9823  0: a"aaaaa
9824  1: "
9825  2: <unset>
9826  3: "
9827     b"aaaaa
9828  0: b"aaaaa
9829  1: <unset>
9830  2: <unset>
9831  3: <unset>
9832  4: "
9833  5: <unset>
9834  6: "
9835 \= Expect no match
9836     b"11111
9837 No match
9838     a"11111
9839 No match
9840
9841 /^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/IBx,dupnames
9842 ------------------------------------------------------------------
9843         Bra
9844         ^
9845         Bra
9846         CBra 1
9847         a
9848         Ket
9849         CBra 2
9850         b
9851         Ket
9852         CBra 3
9853         c
9854         Ket
9855         CBra 4
9856         d
9857         Ket
9858         Alt
9859         CBra 1
9860         e
9861         Ket
9862         Ket
9863         Cond
9864         Cond ref <D>2
9865         X
9866         Alt
9867         Y
9868         Ket
9869         Ket
9870         End
9871 ------------------------------------------------------------------
9872 Capturing subpattern count = 4
9873 Max back reference = 4
9874 Named capturing subpatterns:
9875   D   4
9876   D   1
9877 Compile options: dupnames extended
9878 Overall options: anchored dupnames extended
9879 Starting code units: a e 
9880 Subject length lower bound = 2
9881     abcdX
9882  0: abcdX
9883  1: a
9884  2: b
9885  3: c
9886  4: d
9887     eX
9888  0: eX
9889  1: e
9890 \= Expect no match
9891     abcdY
9892 No match
9893     ey
9894 No match
9895
9896 /(?<A>a) (b)(c)  (?<A>d  (?(R&A)$ | (?4)) )/IBx,dupnames
9897 ------------------------------------------------------------------
9898         Bra
9899         CBra 1
9900         a
9901         Ket
9902         CBra 2
9903         b
9904         Ket
9905         CBra 3
9906         c
9907         Ket
9908         CBra 4
9909         d
9910         Cond
9911         Cond recurse <A>2
9912         $
9913         Alt
9914         Recurse
9915         Ket
9916         Ket
9917         Ket
9918         End
9919 ------------------------------------------------------------------
9920 Capturing subpattern count = 4
9921 Max back reference = 4
9922 Named capturing subpatterns:
9923   A   1
9924   A   4
9925 Options: dupnames extended
9926 First code unit = 'a'
9927 Last code unit = 'd'
9928 Subject length lower bound = 4
9929     abcdd
9930  0: abcdd
9931  1: a
9932  2: b
9933  3: c
9934  4: dd
9935 \= Expect no match
9936     abcdde
9937 No match
9938
9939 /abcd*/
9940     xxxxabcd\=ps
9941  0: abcd
9942     xxxxabcd\=ph
9943 Partial match: abcd
9944
9945 /abcd*/i
9946     xxxxabcd\=ps
9947  0: abcd
9948     xxxxabcd\=ph
9949 Partial match: abcd
9950     XXXXABCD\=ps
9951  0: ABCD
9952     XXXXABCD\=ph
9953 Partial match: ABCD
9954
9955 /abc\d*/
9956     xxxxabc1\=ps
9957  0: abc1
9958     xxxxabc1\=ph
9959 Partial match: abc1
9960
9961 /(a)bc\1*/
9962     xxxxabca\=ps
9963  0: abca
9964  1: a
9965     xxxxabca\=ph
9966 Partial match: abca
9967
9968 /abc[de]*/
9969     xxxxabcde\=ps
9970  0: abcde
9971     xxxxabcde\=ph
9972 Partial match: abcde
9973
9974 /(\3)(\1)(a)/alt_bsux,allow_empty_class,match_unset_backref,dupnames
9975     cat
9976  0: a
9977  1: 
9978  2: 
9979  3: a
9980
9981 /(\3)(\1)(a)/I,alt_bsux,allow_empty_class,match_unset_backref,dupnames
9982 Capturing subpattern count = 3
9983 Max back reference = 3
9984 Options: alt_bsux allow_empty_class dupnames match_unset_backref
9985 Last code unit = 'a'
9986 Subject length lower bound = 1
9987     cat
9988  0: a
9989  1: 
9990  2: 
9991  3: a
9992
9993 /(\3)(\1)(a)/I
9994 Capturing subpattern count = 3
9995 Max back reference = 3
9996 Last code unit = 'a'
9997 Subject length lower bound = 3
9998 \= Expect no match
9999     cat
10000 No match
10001
10002 /i(?(DEFINE)(?<s>a))/I
10003 Capturing subpattern count = 1
10004 Named capturing subpatterns:
10005   s   1
10006 First code unit = 'i'
10007 Subject length lower bound = 1
10008     i
10009  0: i
10010
10011 /()i(?(1)a)/I
10012 Capturing subpattern count = 1
10013 Max back reference = 1
10014 First code unit = 'i'
10015 Subject length lower bound = 1
10016     ia
10017  0: ia
10018  1: 
10019
10020 /(?i)a(?-i)b|c/B
10021 ------------------------------------------------------------------
10022         Bra
10023      /i a
10024         b
10025         Alt
10026         c
10027         Ket
10028         End
10029 ------------------------------------------------------------------
10030     XabX
10031  0: ab
10032     XAbX
10033  0: Ab
10034     CcC
10035  0: c
10036 \= Expect no match
10037     XABX
10038 No match
10039
10040 /(?i)a(?s)b|c/B
10041 ------------------------------------------------------------------
10042         Bra
10043      /i ab
10044         Alt
10045      /i c
10046         Ket
10047         End
10048 ------------------------------------------------------------------
10049
10050 /(?i)a(?s-i)b|c/B
10051 ------------------------------------------------------------------
10052         Bra
10053      /i a
10054         b
10055         Alt
10056         c
10057         Ket
10058         End
10059 ------------------------------------------------------------------
10060
10061 /^(ab(c\1)d|x){2}$/B
10062 ------------------------------------------------------------------
10063         Bra
10064         ^
10065         Once
10066         CBra 1
10067         ab
10068         CBra 2
10069         c
10070         \1
10071         Ket
10072         d
10073         Alt
10074         x
10075         Ket
10076         Ket
10077         Once
10078         CBra 1
10079         ab
10080         CBra 2
10081         c
10082         \1
10083         Ket
10084         d
10085         Alt
10086         x
10087         Ket
10088         Ket
10089         $
10090         Ket
10091         End
10092 ------------------------------------------------------------------
10093     xabcxd
10094  0: xabcxd
10095  1: abcxd
10096  2: cx
10097
10098 /^(?&t)*+(?(DEFINE)(?<t>.))$/B
10099 ------------------------------------------------------------------
10100         Bra
10101         ^
10102         Braposzero
10103         SBraPos
10104         Recurse
10105         KetRpos
10106         Cond
10107         Cond false
10108         CBra 1
10109         Any
10110         Ket
10111         Ket
10112         $
10113         Ket
10114         End
10115 ------------------------------------------------------------------
10116
10117 /^(?&t)*(?(DEFINE)(?<t>.))$/B
10118 ------------------------------------------------------------------
10119         Bra
10120         ^
10121         Brazero
10122         SBra
10123         Recurse
10124         KetRmax
10125         Cond
10126         Cond false
10127         CBra 1
10128         Any
10129         Ket
10130         Ket
10131         $
10132         Ket
10133         End
10134 ------------------------------------------------------------------
10135
10136 # This one is here because Perl gives the match as "b" rather than "ab". I
10137 # believe this to be a Perl bug.
10138
10139 /(?>a\Kb)z|(ab)/
10140     ab\=startchar
10141  0: ab
10142  1: ab
10143
10144 /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
10145     abcd
10146  0: 
10147  1: 
10148  2: 
10149     0abc
10150  0: 0
10151  1: 0
10152  2: 0
10153
10154 /abc(*MARK:)pqr/
10155 Failed: error 166 at offset 10: (*MARK) must have an argument
10156
10157 /abc(*:)pqr/
10158 Failed: error 166 at offset 6: (*MARK) must have an argument
10159
10160 /(*COMMIT:X)/B
10161 ------------------------------------------------------------------
10162         Bra
10163         *COMMIT X
10164         Ket
10165         End
10166 ------------------------------------------------------------------
10167
10168 # This should, and does, fail. In Perl, it does not, which I think is a
10169 # bug because replacing the B in the pattern by (B|D) does make it fail.
10170 # Turning off Perl's optimization by inserting (??{""}) also makes it fail.
10171
10172 /A(*COMMIT)B/aftertext,mark
10173 \= Expect no match
10174     ACABX
10175 No match
10176
10177 # These should be different, but in Perl they are not, which I think
10178 # is a bug in Perl.
10179
10180 /A(*THEN)B|A(*THEN)C/mark
10181     AC
10182  0: AC
10183
10184 /A(*PRUNE)B|A(*PRUNE)C/mark
10185 \= Expect no match
10186     AC
10187 No match
10188
10189 # Mark names can be duplicated. Perl doesn't give a mark for this one,
10190 # though PCRE2 does.
10191
10192 /^A(*:A)B|^X(*:A)Y/mark
10193 \= Expect no match
10194     XAQQ
10195 No match, mark = A
10196
10197 # COMMIT at the start of a pattern should be the same as an anchor. Perl
10198 # optimizations defeat this. So does the PCRE2 optimization unless we disable
10199 # it.
10200
10201 /(*COMMIT)ABC/
10202     ABCDEFG
10203  0: ABC
10204
10205 /(*COMMIT)ABC/no_start_optimize
10206 \= Expect no match
10207     DEFGABC
10208 No match
10209
10210 /^(ab (c+(*THEN)cd) | xyz)/x
10211 \= Expect no match
10212     abcccd
10213 No match
10214
10215 /^(ab (c+(*PRUNE)cd) | xyz)/x
10216 \= Expect no match
10217     abcccd
10218 No match
10219
10220 /^(ab (c+(*FAIL)cd) | xyz)/x
10221 \= Expect no match
10222     abcccd
10223 No match
10224
10225 # Perl gets some of these wrong
10226
10227 /(?>.(*ACCEPT))*?5/
10228     abcde
10229  0: a
10230
10231 /(.(*ACCEPT))*?5/
10232     abcde
10233  0: a
10234  1: a
10235
10236 /(.(*ACCEPT))5/
10237     abcde
10238  0: a
10239  1: a
10240
10241 /(.(*ACCEPT))*5/
10242     abcde
10243  0: a
10244  1: a
10245
10246 /A\NB./B
10247 ------------------------------------------------------------------
10248         Bra
10249         A
10250         Any
10251         B
10252         Any
10253         Ket
10254         End
10255 ------------------------------------------------------------------
10256     ACBD
10257  0: ACBD
10258 \= Expect no match
10259     A\nB
10260 No match
10261     ACB\n
10262 No match
10263
10264 /A\NB./Bs
10265 ------------------------------------------------------------------
10266         Bra
10267         A
10268         Any
10269         B
10270         AllAny
10271         Ket
10272         End
10273 ------------------------------------------------------------------
10274     ACBD
10275  0: ACBD
10276     ACB\n
10277  0: ACB\x0a
10278 \= Expect no match
10279     A\nB
10280 No match
10281
10282 /A\NB/newline=crlf
10283     A\nB
10284  0: A\x0aB
10285     A\rB
10286  0: A\x0dB
10287 \= Expect no match
10288     A\r\nB
10289 No match
10290
10291 /\R+b/B
10292 ------------------------------------------------------------------
10293         Bra
10294         \R++
10295         b
10296         Ket
10297         End
10298 ------------------------------------------------------------------
10299
10300 /\R+\n/B
10301 ------------------------------------------------------------------
10302         Bra
10303         \R+
10304         \x0a
10305         Ket
10306         End
10307 ------------------------------------------------------------------
10308
10309 /\R+\d/B
10310 ------------------------------------------------------------------
10311         Bra
10312         \R++
10313         \d
10314         Ket
10315         End
10316 ------------------------------------------------------------------
10317
10318 /\d*\R/B
10319 ------------------------------------------------------------------
10320         Bra
10321         \d*+
10322         \R
10323         Ket
10324         End
10325 ------------------------------------------------------------------
10326
10327 /\s*\R/B
10328 ------------------------------------------------------------------
10329         Bra
10330         \s*
10331         \R
10332         Ket
10333         End
10334 ------------------------------------------------------------------
10335     \x20\x0a
10336  0:  \x0a
10337     \x20\x0d
10338  0:  \x0d
10339     \x20\x0d\x0a
10340  0:  \x0d\x0a
10341
10342 /\S*\R/B
10343 ------------------------------------------------------------------
10344         Bra
10345         \S*+
10346         \R
10347         Ket
10348         End
10349 ------------------------------------------------------------------
10350     a\x0a
10351  0: a\x0a
10352
10353 /X\h*\R/B
10354 ------------------------------------------------------------------
10355         Bra
10356         X
10357         \h*+
10358         \R
10359         Ket
10360         End
10361 ------------------------------------------------------------------
10362     X\x20\x0a
10363  0: X \x0a
10364
10365 /X\H*\R/B
10366 ------------------------------------------------------------------
10367         Bra
10368         X
10369         \H*
10370         \R
10371         Ket
10372         End
10373 ------------------------------------------------------------------
10374     X\x0d\x0a
10375  0: X\x0d\x0a
10376
10377 /X\H+\R/B
10378 ------------------------------------------------------------------
10379         Bra
10380         X
10381         \H+
10382         \R
10383         Ket
10384         End
10385 ------------------------------------------------------------------
10386     X\x0d\x0a
10387  0: X\x0d\x0a
10388
10389 /X\H++\R/B
10390 ------------------------------------------------------------------
10391         Bra
10392         X
10393         \H++
10394         \R
10395         Ket
10396         End
10397 ------------------------------------------------------------------
10398 \= Expect no match
10399     X\x0d\x0a
10400 No match
10401
10402 /(?<=abc)def/
10403     abc\=ph
10404 Partial match: abc
10405                <<<
10406
10407 /abc$/
10408     abc
10409  0: abc
10410     abc\=ps
10411  0: abc
10412     abc\=ph
10413 Partial match: abc
10414
10415 /abc$/m
10416     abc
10417  0: abc
10418     abc\n
10419  0: abc
10420     abc\=ph
10421 Partial match: abc
10422     abc\n\=ph
10423  0: abc
10424     abc\=ps
10425  0: abc
10426     abc\n\=ps
10427  0: abc
10428
10429 /abc\z/
10430     abc
10431  0: abc
10432     abc\=ps
10433  0: abc
10434     abc\=ph
10435 Partial match: abc
10436
10437 /abc\Z/
10438     abc
10439  0: abc
10440     abc\=ps
10441  0: abc
10442     abc\=ph
10443 Partial match: abc
10444
10445 /abc\b/
10446     abc
10447  0: abc
10448     abc\=ps
10449  0: abc
10450     abc\=ph
10451 Partial match: abc
10452
10453 /abc\B/
10454     abc\=ps
10455 Partial match: abc
10456     abc\=ph
10457 Partial match: abc
10458 \= Expect no match
10459     abc
10460 No match
10461
10462 /.+/
10463 \= Bad offsets
10464     abc\=offset=4
10465 Failed: error -33: bad offset value
10466     abc\=offset=-4
10467 ** Invalid value in 'offset=-4'
10468 \= Valid data
10469     abc\=offset=0
10470  0: abc
10471     abc\=offset=1
10472  0: bc
10473     abc\=offset=2
10474  0: c
10475 \= Expect no match
10476     abc\=offset=3
10477 No match
10478
10479 /^\cģ/
10480 Failed: error 168 at offset 3: \c must be followed by a printable ASCII character
10481
10482 /(?P<abn>(?P=abn)xxx)/B
10483 ------------------------------------------------------------------
10484         Bra
10485         Once
10486         CBra 1
10487         \1
10488         xxx
10489         Ket
10490         Ket
10491         Ket
10492         End
10493 ------------------------------------------------------------------
10494
10495 /(a\1z)/B
10496 ------------------------------------------------------------------
10497         Bra
10498         Once
10499         CBra 1
10500         a
10501         \1
10502         z
10503         Ket
10504         Ket
10505         Ket
10506         End
10507 ------------------------------------------------------------------
10508
10509 /(?P<abn>(?P=abn)(?<badstufxxx)/B
10510 Failed: error 142 at offset 29: syntax error in subpattern name (missing terminator)
10511
10512 /(?P<abn>(?P=axn)xxx)/B
10513 Failed: error 115 at offset 12: reference to non-existent subpattern
10514
10515 /(?P<abn>(?P=axn)xxx)(?<axn>yy)/B
10516 ------------------------------------------------------------------
10517         Bra
10518         CBra 1
10519         \2
10520         xxx
10521         Ket
10522         CBra 2
10523         yy
10524         Ket
10525         Ket
10526         End
10527 ------------------------------------------------------------------
10528
10529 # These tests are here because Perl gets the first one wrong.
10530
10531 /(\R*)(.)/s
10532     \r\n
10533  0: \x0d
10534  1: 
10535  2: \x0d
10536     \r\r\n\n\r
10537  0: \x0d\x0d\x0a\x0a\x0d
10538  1: \x0d\x0d\x0a\x0a
10539  2: \x0d
10540     \r\r\n\n\r\n
10541  0: \x0d\x0d\x0a\x0a\x0d
10542  1: \x0d\x0d\x0a\x0a
10543  2: \x0d
10544
10545 /(\R)*(.)/s
10546     \r\n
10547  0: \x0d
10548  1: <unset>
10549  2: \x0d
10550     \r\r\n\n\r
10551  0: \x0d\x0d\x0a\x0a\x0d
10552  1: \x0a
10553  2: \x0d
10554     \r\r\n\n\r\n
10555  0: \x0d\x0d\x0a\x0a\x0d
10556  1: \x0a
10557  2: \x0d
10558
10559 /((?>\r\n|\n|\x0b|\f|\r|\x85)*)(.)/s
10560     \r\n
10561  0: \x0d
10562  1: 
10563  2: \x0d
10564     \r\r\n\n\r
10565  0: \x0d\x0d\x0a\x0a\x0d
10566  1: \x0d\x0d\x0a\x0a
10567  2: \x0d
10568     \r\r\n\n\r\n
10569  0: \x0d\x0d\x0a\x0a\x0d
10570  1: \x0d\x0d\x0a\x0a
10571  2: \x0d
10572
10573 # -------------
10574
10575 /^abc$/B
10576 ------------------------------------------------------------------
10577         Bra
10578         ^
10579         abc
10580         $
10581         Ket
10582         End
10583 ------------------------------------------------------------------
10584
10585 /^abc$/Bm
10586 ------------------------------------------------------------------
10587         Bra
10588      /m ^
10589         abc
10590      /m $
10591         Ket
10592         End
10593 ------------------------------------------------------------------
10594
10595 /^(a)*+(\w)/
10596     aaaaX
10597  0: aaaaX
10598  1: a
10599  2: X
10600 \= Expect no match
10601     aaaa
10602 No match
10603
10604 /^(?:a)*+(\w)/
10605     aaaaX
10606  0: aaaaX
10607  1: X
10608 \= Expect no match
10609     aaaa
10610 No match
10611
10612 /(a)++1234/IB
10613 ------------------------------------------------------------------
10614         Bra
10615         CBraPos 1
10616         a
10617         KetRpos
10618         1234
10619         Ket
10620         End
10621 ------------------------------------------------------------------
10622 Capturing subpattern count = 1
10623 First code unit = 'a'
10624 Last code unit = '4'
10625 Subject length lower bound = 5
10626
10627 /([abc])++1234/I
10628 Capturing subpattern count = 1
10629 Starting code units: a b c 
10630 Last code unit = '4'
10631 Subject length lower bound = 5
10632
10633 /(?<=(abc)+)X/
10634 Failed: error 125 at offset 0: lookbehind assertion is not fixed length
10635
10636 /(^ab)/I
10637 Capturing subpattern count = 1
10638 Compile options: <none>
10639 Overall options: anchored
10640 First code unit = 'a'
10641 Subject length lower bound = 2
10642
10643 /(^ab)++/I
10644 Capturing subpattern count = 1
10645 Compile options: <none>
10646 Overall options: anchored
10647 First code unit = 'a'
10648 Subject length lower bound = 2
10649
10650 /(^ab|^)+/I
10651 Capturing subpattern count = 1
10652 May match empty string
10653 Compile options: <none>
10654 Overall options: anchored
10655 Subject length lower bound = 0
10656
10657 /(^ab|^)++/I
10658 Capturing subpattern count = 1
10659 May match empty string
10660 Compile options: <none>
10661 Overall options: anchored
10662 Subject length lower bound = 0
10663
10664 /(?:^ab)/I
10665 Capturing subpattern count = 0
10666 Compile options: <none>
10667 Overall options: anchored
10668 First code unit = 'a'
10669 Subject length lower bound = 2
10670
10671 /(?:^ab)++/I
10672 Capturing subpattern count = 0
10673 Compile options: <none>
10674 Overall options: anchored
10675 First code unit = 'a'
10676 Subject length lower bound = 2
10677
10678 /(?:^ab|^)+/I
10679 Capturing subpattern count = 0
10680 May match empty string
10681 Compile options: <none>
10682 Overall options: anchored
10683 Subject length lower bound = 0
10684
10685 /(?:^ab|^)++/I
10686 Capturing subpattern count = 0
10687 May match empty string
10688 Compile options: <none>
10689 Overall options: anchored
10690 Subject length lower bound = 0
10691
10692 /(.*ab)/I
10693 Capturing subpattern count = 1
10694 First code unit at start or follows newline
10695 Last code unit = 'b'
10696 Subject length lower bound = 2
10697
10698 /(.*ab)++/I
10699 Capturing subpattern count = 1
10700 First code unit at start or follows newline
10701 Last code unit = 'b'
10702 Subject length lower bound = 2
10703
10704 /(.*ab|.*)+/I
10705 Capturing subpattern count = 1
10706 May match empty string
10707 First code unit at start or follows newline
10708 Subject length lower bound = 0
10709
10710 /(.*ab|.*)++/I
10711 Capturing subpattern count = 1
10712 May match empty string
10713 First code unit at start or follows newline
10714 Subject length lower bound = 0
10715
10716 /(?:.*ab)/I
10717 Capturing subpattern count = 0
10718 First code unit at start or follows newline
10719 Last code unit = 'b'
10720 Subject length lower bound = 2
10721
10722 /(?:.*ab)++/I
10723 Capturing subpattern count = 0
10724 First code unit at start or follows newline
10725 Last code unit = 'b'
10726 Subject length lower bound = 2
10727
10728 /(?:.*ab|.*)+/I
10729 Capturing subpattern count = 0
10730 May match empty string
10731 First code unit at start or follows newline
10732 Subject length lower bound = 0
10733
10734 /(?:.*ab|.*)++/I
10735 Capturing subpattern count = 0
10736 May match empty string
10737 First code unit at start or follows newline
10738 Subject length lower bound = 0
10739
10740 /(?=a)[bcd]/I
10741 Capturing subpattern count = 0
10742 First code unit = 'a'
10743 Subject length lower bound = 1
10744
10745 /((?=a))[bcd]/I
10746 Capturing subpattern count = 1
10747 First code unit = 'a'
10748 Subject length lower bound = 1
10749
10750 /((?=a))+[bcd]/I
10751 Capturing subpattern count = 1
10752 First code unit = 'a'
10753 Subject length lower bound = 1
10754
10755 /((?=a))++[bcd]/I
10756 Capturing subpattern count = 1
10757 First code unit = 'a'
10758 Subject length lower bound = 1
10759
10760 /(?=a+)[bcd]/Ii
10761 Capturing subpattern count = 0
10762 Options: caseless
10763 First code unit = 'a' (caseless)
10764 Subject length lower bound = 1
10765
10766 /(?=a+?)[bcd]/Ii
10767 Capturing subpattern count = 0
10768 Options: caseless
10769 First code unit = 'a' (caseless)
10770 Subject length lower bound = 1
10771
10772 /(?=a++)[bcd]/Ii
10773 Capturing subpattern count = 0
10774 Options: caseless
10775 First code unit = 'a' (caseless)
10776 Subject length lower bound = 1
10777
10778 /(?=a{3})[bcd]/Ii
10779 Capturing subpattern count = 0
10780 Options: caseless
10781 First code unit = 'a' (caseless)
10782 Last code unit = 'a' (caseless)
10783 Subject length lower bound = 1
10784
10785 /(abc)\1+/
10786
10787 # Perl doesn't get these right IMO (the 3rd is PCRE2-specific)
10788
10789 /(?1)(?:(b(*ACCEPT))){0}/
10790     b
10791  0: b
10792
10793 /(?1)(?:(b(*ACCEPT))){0}c/
10794     bc
10795  0: bc
10796 \= Expect no match
10797     b
10798 No match
10799
10800 /(?1)(?:((*ACCEPT))){0}c/
10801     c
10802  0: c
10803     c\=notempty
10804  0: c
10805
10806 /^.*?(?(?=a)a|b(*THEN)c)/
10807 \= Expect no match
10808     ba
10809 No match
10810
10811 /^.*?(?(?=a)a|bc)/
10812     ba
10813  0: ba
10814
10815 /^.*?(?(?=a)a(*THEN)b|c)/
10816 \= Expect no match
10817     ac
10818 No match
10819
10820 /^.*?(?(?=a)a(*THEN)b)c/
10821 \= Expect no match
10822     ac
10823 No match
10824
10825 /^.*?(a(*THEN)b)c/
10826 \= Expect no match
10827     aabc
10828 No match
10829
10830 /^.*? (?1) c (?(DEFINE)(a(*THEN)b))/x
10831     aabc
10832  0: aabc
10833
10834 /^.*?(a(*THEN)b|z)c/
10835     aabc
10836  0: aabc
10837  1: ab
10838
10839 /^.*?(z|a(*THEN)b)c/
10840     aabc
10841  0: aabc
10842  1: ab
10843
10844 # These are here because they are not Perl-compatible; the studying means the
10845 # mark is not seen.
10846
10847 /(*MARK:A)(*SKIP:B)(C|X)/mark
10848     C
10849  0: C
10850  1: C
10851 MK: A
10852 \= Expect no match
10853     D
10854 No match, mark = A
10855
10856 /(*:A)A+(*SKIP:A)(B|Z)/mark
10857 \= Expect no match
10858     AAAC
10859 No match, mark = A
10860
10861 # ----------------------------
10862
10863 "(?=a*(*ACCEPT)b)c"
10864     c
10865  0: c
10866     c\=notempty
10867  0: c
10868
10869 /(?1)c(?(DEFINE)((*ACCEPT)b))/
10870     c
10871  0: c
10872     c\=notempty
10873  0: c
10874
10875 /(?>(*ACCEPT)b)c/
10876     c
10877  0: 
10878 \= Expect no match
10879     c\=notempty
10880 No match
10881
10882 /(?:(?>(a)))+a%/allaftertext
10883     %aa%
10884  0: aa%
10885  0+ 
10886  1: a
10887  1+ a%
10888
10889 /(a)b|ac/allaftertext
10890     ac\=ovector=1
10891  0: ac
10892  0+ 
10893
10894 /(a)(b)x|abc/allaftertext
10895      abc\=ovector=2
10896  0: abc
10897  0+ 
10898
10899 /(a)bc|(a)(b)\2/
10900     abc\=ovector=1
10901 Matched, but too many substrings
10902  0: abc
10903     abc\=ovector=2
10904  0: abc
10905  1: a
10906     aba\=ovector=1
10907 Matched, but too many substrings
10908  0: aba
10909     aba\=ovector=2
10910 Matched, but too many substrings
10911  0: aba
10912  1: <unset>
10913     aba\=ovector=3
10914 Matched, but too many substrings
10915  0: aba
10916  1: <unset>
10917  2: a
10918     aba\=ovector=4
10919  0: aba
10920  1: <unset>
10921  2: a
10922  3: b
10923
10924 /(?(DEFINE)(a(?2)|b)(b(?1)|a))(?:(?1)|(?2))/I
10925 Capturing subpattern count = 2
10926 May match empty string
10927 Subject length lower bound = 0
10928
10929 /(a(?2)|b)(b(?1)|a)(?:(?1)|(?2))/I
10930 Capturing subpattern count = 2
10931 Starting code units: a b 
10932 Subject length lower bound = 3
10933
10934 /(a(?2)|b)(b(?1)|a)(?1)(?2)/I
10935 Capturing subpattern count = 2
10936 Starting code units: a b 
10937 Subject length lower bound = 4
10938
10939 /(abc)(?1)/I
10940 Capturing subpattern count = 1
10941 First code unit = 'a'
10942 Last code unit = 'c'
10943 Subject length lower bound = 6
10944
10945 /(?:(foo)|(bar)|(baz))X/allcaptures
10946     bazfooX
10947  0: fooX
10948  1: foo
10949  2: <unset>
10950  3: <unset>
10951     foobazbarX
10952  0: barX
10953  1: <unset>
10954  2: bar
10955  3: <unset>
10956     barfooX
10957  0: fooX
10958  1: foo
10959  2: <unset>
10960  3: <unset>
10961     bazX
10962  0: bazX
10963  1: <unset>
10964  2: <unset>
10965  3: baz
10966     foobarbazX
10967  0: bazX
10968  1: <unset>
10969  2: <unset>
10970  3: baz
10971     bazfooX\=ovector=0
10972  0: fooX
10973  1: foo
10974  2: <unset>
10975  3: <unset>
10976     bazfooX\=ovector=1
10977 Matched, but too many substrings
10978  0: fooX
10979     bazfooX\=ovector=2
10980  0: fooX
10981  1: foo
10982     bazfooX\=ovector=3
10983  0: fooX
10984  1: foo
10985  2: <unset>
10986
10987 /(?=abc){3}abc/B
10988 ------------------------------------------------------------------
10989         Bra
10990         Assert
10991         abc
10992         Ket
10993         abc
10994         Ket
10995         End
10996 ------------------------------------------------------------------
10997
10998 /(?=abc)+abc/B
10999 ------------------------------------------------------------------
11000         Bra
11001         Assert
11002         abc
11003         Ket
11004         abc
11005         Ket
11006         End
11007 ------------------------------------------------------------------
11008
11009 /(?=abc)++abc/B
11010 ------------------------------------------------------------------
11011         Bra
11012         Assert
11013         abc
11014         Ket
11015         abc
11016         Ket
11017         End
11018 ------------------------------------------------------------------
11019
11020 /(?=abc){0}xyz/B
11021 ------------------------------------------------------------------
11022         Bra
11023         Skip zero
11024         Assert
11025         abc
11026         Ket
11027         xyz
11028         Ket
11029         End
11030 ------------------------------------------------------------------
11031
11032 /(?=(a))?./B
11033 ------------------------------------------------------------------
11034         Bra
11035         Brazero
11036         Assert
11037         CBra 1
11038         a
11039         Ket
11040         Ket
11041         Any
11042         Ket
11043         End
11044 ------------------------------------------------------------------
11045
11046 /(?=(a))??./B
11047 ------------------------------------------------------------------
11048         Bra
11049         Braminzero
11050         Assert
11051         CBra 1
11052         a
11053         Ket
11054         Ket
11055         Any
11056         Ket
11057         End
11058 ------------------------------------------------------------------
11059
11060 /^(?=(a)){0}b(?1)/B
11061 ------------------------------------------------------------------
11062         Bra
11063         ^
11064         Skip zero
11065         Assert
11066         CBra 1
11067         a
11068         Ket
11069         Ket
11070         b
11071         Recurse
11072         Ket
11073         End
11074 ------------------------------------------------------------------
11075
11076 /(?(DEFINE)(a))?b(?1)/B
11077 ------------------------------------------------------------------
11078         Bra
11079         Cond
11080         Cond false
11081         CBra 1
11082         a
11083         Ket
11084         Ket
11085         b
11086         Recurse
11087         Ket
11088         End
11089 ------------------------------------------------------------------
11090
11091 /^(?=(?1))?[az]([abc])d/B
11092 ------------------------------------------------------------------
11093         Bra
11094         ^
11095         Brazero
11096         Assert
11097         Recurse
11098         Ket
11099         [az]
11100         CBra 1
11101         [a-c]
11102         Ket
11103         d
11104         Ket
11105         End
11106 ------------------------------------------------------------------
11107
11108 /^(?!a){0}\w+/B
11109 ------------------------------------------------------------------
11110         Bra
11111         ^
11112         Skip zero
11113         Assert not
11114         a
11115         Ket
11116         \w++
11117         Ket
11118         End
11119 ------------------------------------------------------------------
11120
11121 /(?<=(abc))?xyz/B
11122 ------------------------------------------------------------------
11123         Bra
11124         Brazero
11125         AssertB
11126         Reverse
11127         CBra 1
11128         abc
11129         Ket
11130         Ket
11131         xyz
11132         Ket
11133         End
11134 ------------------------------------------------------------------
11135
11136 /[:a[:abc]b:]/B
11137 ------------------------------------------------------------------
11138         Bra
11139         [:[a-c]
11140         b:]
11141         Ket
11142         End
11143 ------------------------------------------------------------------
11144
11145 /^(a(*:A)(d|e(*:B))z|aeq)/auto_callout
11146     adz
11147 --->adz
11148  +0 ^       ^
11149  +1 ^       (
11150  +2 ^       a
11151  +3 ^^      (*:A)
11152  +8 ^^      (
11153 Latest Mark: A
11154  +9 ^^      d
11155 +10 ^ ^     |
11156 +18 ^ ^     z
11157 +19 ^  ^    |
11158 +24 ^  ^    End of pattern
11159  0: adz
11160  1: adz
11161  2: d
11162     aez
11163 --->aez
11164  +0 ^       ^
11165  +1 ^       (
11166  +2 ^       a
11167  +3 ^^      (*:A)
11168  +8 ^^      (
11169 Latest Mark: A
11170  +9 ^^      d
11171 +11 ^^      e
11172 +12 ^ ^     (*:B)
11173 +17 ^ ^     )
11174 Latest Mark: B
11175 +18 ^ ^     z
11176 +19 ^  ^    |
11177 +24 ^  ^    End of pattern
11178  0: aez
11179  1: aez
11180  2: e
11181     aeqwerty
11182 --->aeqwerty
11183  +0 ^            ^
11184  +1 ^            (
11185  +2 ^            a
11186  +3 ^^           (*:A)
11187  +8 ^^           (
11188 Latest Mark: A
11189  +9 ^^           d
11190 +11 ^^           e
11191 +12 ^ ^          (*:B)
11192 +17 ^ ^          )
11193 Latest Mark: B
11194 +18 ^ ^          z
11195 +20 ^            a
11196 +21 ^^           e
11197 +22 ^ ^          q
11198 +23 ^  ^         )
11199 +24 ^  ^         End of pattern
11200  0: aeq
11201  1: aeq
11202
11203 /.(*F)/
11204 \= Expect no match
11205     abc\=ph
11206 No match
11207
11208 /\btype\b\W*?\btext\b\W*?\bjavascript\b/I
11209 Capturing subpattern count = 0
11210 Max lookbehind = 1
11211 First code unit = 't'
11212 Last code unit = 't'
11213 Subject length lower bound = 18
11214
11215 /\btype\b\W*?\btext\b\W*?\bjavascript\b|\burl\b\W*?\bshell:|<input\b.*?\btype\b\W*?\bimage\b|\bonkeyup\b\W*?\=/I
11216 Capturing subpattern count = 0
11217 Max lookbehind = 1
11218 Starting code units: < o t u 
11219 Subject length lower bound = 8
11220
11221 /a(*SKIP)c|b(*ACCEPT)|/I,aftertext
11222 Capturing subpattern count = 0
11223 May match empty string
11224 Subject length lower bound = 0
11225     a
11226  0: 
11227  0+ 
11228
11229 /a(*SKIP)c|b(*ACCEPT)cd(*ACCEPT)|x/I
11230 Capturing subpattern count = 0
11231 Starting code units: a b x 
11232 Subject length lower bound = 0
11233     ax
11234  0: x
11235
11236 'a*(*ACCEPT)b'aftertext
11237     abc\=notempty_atstart
11238  0: a
11239  0+ bc
11240     bbb\=notempty_atstart
11241  0: 
11242  0+ bb
11243 \= Expect no match
11244     \=notempty_atstart
11245 No match
11246
11247 /(*ACCEPT)a/I,aftertext
11248 Capturing subpattern count = 0
11249 Subject length lower bound = 0
11250     bax
11251  0: 
11252  0+ bax
11253
11254 /z(*ACCEPT)a/I,aftertext
11255 Capturing subpattern count = 0
11256 First code unit = 'z'
11257 Subject length lower bound = 0
11258     baxzbx
11259  0: z
11260  0+ bx
11261
11262 /^(?>a+)(?>(z+))\w/B
11263 ------------------------------------------------------------------
11264         Bra
11265         ^
11266         Once
11267         a++
11268         Ket
11269         Once
11270         CBra 1
11271         z++
11272         Ket
11273         Ket
11274         \w
11275         Ket
11276         End
11277 ------------------------------------------------------------------
11278     aaaazzzzb
11279  0: aaaazzzzb
11280  1: zzzz
11281 \= Expect no match
11282     aazz
11283 No match
11284
11285 /(.)(\1|a(?2))/
11286     bab
11287  0: bab
11288  1: b
11289  2: ab
11290
11291 /\1|(.)(?R)\1/
11292     cbbbc
11293  0: cbbbc
11294  1: c
11295
11296 /(.)((?(1)c|a)|a(?2))/
11297 \= Expect no match
11298     baa
11299 No match
11300
11301 /(?P<abn>(?P=abn)xxx)/B
11302 ------------------------------------------------------------------
11303         Bra
11304         Once
11305         CBra 1
11306         \1
11307         xxx
11308         Ket
11309         Ket
11310         Ket
11311         End
11312 ------------------------------------------------------------------
11313
11314 /(a\1z)/B
11315 ------------------------------------------------------------------
11316         Bra
11317         Once
11318         CBra 1
11319         a
11320         \1
11321         z
11322         Ket
11323         Ket
11324         Ket
11325         End
11326 ------------------------------------------------------------------
11327
11328 /^a\x41z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
11329     aAz
11330  0: aAz
11331 \= Expect no match
11332     ax41z
11333 No match
11334
11335 /^a[m\x41]z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
11336     aAz
11337  0: aAz
11338
11339 /^a\x1z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
11340     ax1z
11341  0: ax1z
11342
11343 /^a\u0041z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
11344     aAz
11345  0: aAz
11346 \= Expect no match
11347     au0041z
11348 No match
11349
11350 /^a[m\u0041]z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
11351     aAz
11352  0: aAz
11353
11354 /^a\u041z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
11355     au041z
11356  0: au041z
11357 \= Expect no match
11358     aAz
11359 No match
11360
11361 /^a\U0041z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
11362     aU0041z
11363  0: aU0041z
11364 \= Expect no match
11365     aAz
11366 No match
11367
11368 /(?(?=c)c|d)++Y/B
11369 ------------------------------------------------------------------
11370         Bra
11371         BraPos
11372         Cond
11373         Assert
11374         c
11375         Ket
11376         c
11377         Alt
11378         d
11379         Ket
11380         KetRpos
11381         Y
11382         Ket
11383         End
11384 ------------------------------------------------------------------
11385
11386 /(?(?=c)c|d)*+Y/B
11387 ------------------------------------------------------------------
11388         Bra
11389         Braposzero
11390         BraPos
11391         Cond
11392         Assert
11393         c
11394         Ket
11395         c
11396         Alt
11397         d
11398         Ket
11399         KetRpos
11400         Y
11401         Ket
11402         End
11403 ------------------------------------------------------------------
11404
11405 /a[\NB]c/
11406 Failed: error 171 at offset 4: \N is not supported in a class
11407     aNc
11408
11409 /a[B-\Nc]/
11410 Failed: error 150 at offset 6: invalid range in character class
11411
11412 /a[B\Nc]/
11413 Failed: error 171 at offset 5: \N is not supported in a class
11414
11415 /(a)(?2){0,1999}?(b)/
11416
11417 /(a)(?(DEFINE)(b))(?2){0,1999}?(?2)/
11418
11419 # This test, with something more complicated than individual letters, causes
11420 # different behaviour in Perl. Perhaps it disables some optimization; no tag is
11421 # passed back for the failures, whereas in PCRE2 there is a tag.
11422
11423 /(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/x,mark
11424     AABC
11425  0: AB
11426  1: A
11427  2: B
11428 MK: A
11429     XXYZ
11430  0: XXY
11431  1: <unset>
11432  2: <unset>
11433  3: X
11434  4: X
11435  5: Y
11436 MK: B
11437 \= Expect no match
11438     XAQQ
11439 No match, mark = A
11440     XAQQXZZ
11441 No match, mark = A
11442     AXQQQ
11443 No match, mark = A
11444     AXXQQQ
11445 No match, mark = B
11446
11447 # Perl doesn't give marks for these, though it does if the alternatives are
11448 # replaced by single letters.
11449
11450 /(b|q)(*:m)f|a(*:n)w/mark
11451     aw
11452  0: aw
11453 MK: n
11454 \= Expect no match
11455     abc
11456 No match, mark = m
11457
11458 /(q|b)(*:m)f|a(*:n)w/mark
11459     aw
11460  0: aw
11461 MK: n
11462 \= Expect no match
11463     abc
11464 No match, mark = m
11465
11466 # After a partial match, the behaviour is as for a failure.
11467
11468 /^a(*:X)bcde/mark
11469    abc\=ps
11470 Partial match, mark=X: abc
11471
11472 # These are here because Perl doesn't return a mark, except for the first.
11473
11474 /(?=(*:x))(q|)/aftertext,mark
11475     abc
11476  0: 
11477  0+ abc
11478  1: 
11479 MK: x
11480
11481 /(?=(*:x))((*:y)q|)/aftertext,mark
11482     abc
11483  0: 
11484  0+ abc
11485  1: 
11486 MK: x
11487
11488 /(?=(*:x))(?:(*:y)q|)/aftertext,mark
11489     abc
11490  0: 
11491  0+ abc
11492 MK: x
11493
11494 /(?=(*:x))(?>(*:y)q|)/aftertext,mark
11495     abc
11496  0: 
11497  0+ abc
11498 MK: x
11499
11500 /(?=a(*:x))(?!a(*:y)c)/aftertext,mark
11501     ab
11502  0: 
11503  0+ ab
11504 MK: x
11505
11506 /(?=a(*:x))(?=a(*:y)c|)/aftertext,mark
11507     ab
11508  0: 
11509  0+ ab
11510 MK: x
11511
11512 /(..)\1/
11513     ab\=ps
11514 Partial match: ab
11515     aba\=ps
11516 Partial match: aba
11517     abab\=ps
11518  0: abab
11519  1: ab
11520
11521 /(..)\1/i
11522     ab\=ps
11523 Partial match: ab
11524     abA\=ps
11525 Partial match: abA
11526     aBAb\=ps
11527  0: aBAb
11528  1: aB
11529
11530 /(..)\1{2,}/
11531     ab\=ps
11532 Partial match: ab
11533     aba\=ps
11534 Partial match: aba
11535     abab\=ps
11536 Partial match: abab
11537     ababa\=ps
11538 Partial match: ababa
11539     ababab\=ps
11540  0: ababab
11541  1: ab
11542     ababab\=ph
11543 Partial match: ababab
11544     abababa\=ps
11545  0: ababab
11546  1: ab
11547     abababa\=ph
11548 Partial match: abababa
11549
11550 /(..)\1{2,}/i
11551     ab\=ps
11552 Partial match: ab
11553     aBa\=ps
11554 Partial match: aBa
11555     aBAb\=ps
11556 Partial match: aBAb
11557     AbaBA\=ps
11558 Partial match: AbaBA
11559     abABAb\=ps
11560  0: abABAb
11561  1: ab
11562     aBAbaB\=ph
11563 Partial match: aBAbaB
11564     abABabA\=ps
11565  0: abABab
11566  1: ab
11567     abaBABa\=ph
11568 Partial match: abaBABa
11569
11570 /(..)\1{2,}?x/i
11571     ab\=ps
11572 Partial match: ab
11573     abA\=ps
11574 Partial match: abA
11575     aBAb\=ps
11576 Partial match: aBAb
11577     abaBA\=ps
11578 Partial match: abaBA
11579     abAbaB\=ps
11580 Partial match: abAbaB
11581     abaBabA\=ps
11582 Partial match: abaBabA
11583     abAbABaBx\=ps
11584  0: abAbABaBx
11585  1: ab
11586
11587 /^(..)\1/
11588     aba\=ps
11589 Partial match: aba
11590
11591 /^(..)\1{2,3}x/
11592     aba\=ps
11593 Partial match: aba
11594     ababa\=ps
11595 Partial match: ababa
11596     ababa\=ph
11597 Partial match: ababa
11598     abababx
11599  0: abababx
11600  1: ab
11601     ababababx
11602  0: ababababx
11603  1: ab
11604
11605 /^(..)\1{2,3}?x/
11606     aba\=ps
11607 Partial match: aba
11608     ababa\=ps
11609 Partial match: ababa
11610     ababa\=ph
11611 Partial match: ababa
11612     abababx
11613  0: abababx
11614  1: ab
11615     ababababx
11616  0: ababababx
11617  1: ab
11618
11619 /^(..)(\1{2,3})ab/
11620     abababab
11621  0: abababab
11622  1: ab
11623  2: abab
11624
11625 /^\R/
11626     \r\=ps
11627  0: \x0d
11628     \r\=ph
11629 Partial match: \x0d
11630
11631 /^\R{2,3}x/
11632     \r\=ps
11633 Partial match: \x0d
11634     \r\=ph
11635 Partial match: \x0d
11636     \r\r\=ps
11637 Partial match: \x0d\x0d
11638     \r\r\=ph
11639 Partial match: \x0d\x0d
11640     \r\r\r\=ps
11641 Partial match: \x0d\x0d\x0d
11642     \r\r\r\=ph
11643 Partial match: \x0d\x0d\x0d
11644     \r\rx
11645  0: \x0d\x0dx
11646     \r\r\rx
11647  0: \x0d\x0d\x0dx
11648
11649 /^\R{2,3}?x/
11650     \r\=ps
11651 Partial match: \x0d
11652     \r\=ph
11653 Partial match: \x0d
11654     \r\r\=ps
11655 Partial match: \x0d\x0d
11656     \r\r\=ph
11657 Partial match: \x0d\x0d
11658     \r\r\r\=ps
11659 Partial match: \x0d\x0d\x0d
11660     \r\r\r\=ph
11661 Partial match: \x0d\x0d\x0d
11662     \r\rx
11663  0: \x0d\x0dx
11664     \r\r\rx
11665  0: \x0d\x0d\x0dx
11666
11667 /^\R?x/
11668     \r\=ps
11669 Partial match: \x0d
11670     \r\=ph
11671 Partial match: \x0d
11672     x
11673  0: x
11674     \rx
11675  0: \x0dx
11676
11677 /^\R+x/
11678     \r\=ps
11679 Partial match: \x0d
11680     \r\=ph
11681 Partial match: \x0d
11682     \r\n\=ps
11683 Partial match: \x0d\x0a
11684     \r\n\=ph
11685 Partial match: \x0d\x0a
11686     \rx
11687  0: \x0dx
11688
11689 /^a$/newline=crlf
11690     a\r\=ps
11691 Partial match: a\x0d
11692     a\r\=ph
11693 Partial match: a\x0d
11694
11695 /^a$/m,newline=crlf
11696     a\r\=ps
11697 Partial match: a\x0d
11698     a\r\=ph
11699 Partial match: a\x0d
11700
11701 /^(a$|a\r)/newline=crlf
11702     a\r\=ps
11703  0: a\x0d
11704  1: a\x0d
11705     a\r\=ph
11706 Partial match: a\x0d
11707
11708 /^(a$|a\r)/m,newline=crlf
11709     a\r\=ps
11710  0: a\x0d
11711  1: a\x0d
11712     a\r\=ph
11713 Partial match: a\x0d
11714
11715 /./newline=crlf
11716     \r\=ps
11717  0: \x0d
11718     \r\=ph
11719 Partial match: \x0d
11720
11721 /.{2,3}/newline=crlf
11722     \r\=ps
11723 Partial match: \x0d
11724     \r\=ph
11725 Partial match: \x0d
11726     \r\r\=ps
11727  0: \x0d\x0d
11728     \r\r\=ph
11729 Partial match: \x0d\x0d
11730     \r\r\r\=ps
11731  0: \x0d\x0d\x0d
11732     \r\r\r\=ph
11733 Partial match: \x0d\x0d\x0d
11734
11735 /.{2,3}?/newline=crlf
11736     \r\=ps
11737 Partial match: \x0d
11738     \r\=ph
11739 Partial match: \x0d
11740     \r\r\=ps
11741  0: \x0d\x0d
11742     \r\r\=ph
11743 Partial match: \x0d\x0d
11744     \r\r\r\=ps
11745  0: \x0d\x0d
11746     \r\r\r\=ph
11747  0: \x0d\x0d
11748
11749 "AB(C(D))(E(F))?(?(?=\2)(?=\4))"
11750     ABCDGHI\=ovector=01
11751 Matched, but too many substrings
11752  0: ABCD
11753
11754 # These are all run as real matches in test 1; here we are just checking the
11755 # settings of the anchored and startline bits.
11756
11757 /(?>.*?a)(?<=ba)/I
11758 Capturing subpattern count = 0
11759 Max lookbehind = 2
11760 Last code unit = 'a'
11761 Subject length lower bound = 1
11762
11763 /(?:.*?a)(?<=ba)/I
11764 Capturing subpattern count = 0
11765 Max lookbehind = 2
11766 First code unit at start or follows newline
11767 Last code unit = 'a'
11768 Subject length lower bound = 1
11769
11770 /.*?a(*PRUNE)b/I
11771 Capturing subpattern count = 0
11772 Last code unit = 'b'
11773 Subject length lower bound = 2
11774
11775 /.*?a(*PRUNE)b/Is
11776 Capturing subpattern count = 0
11777 Options: dotall
11778 Last code unit = 'b'
11779 Subject length lower bound = 2
11780
11781 /^a(*PRUNE)b/Is
11782 Capturing subpattern count = 0
11783 Compile options: dotall
11784 Overall options: anchored dotall
11785 First code unit = 'a'
11786 Subject length lower bound = 2
11787
11788 /.*?a(*SKIP)b/I
11789 Capturing subpattern count = 0
11790 Last code unit = 'b'
11791 Subject length lower bound = 2
11792
11793 /(?>.*?a)b/Is
11794 Capturing subpattern count = 0
11795 Options: dotall
11796 Last code unit = 'b'
11797 Subject length lower bound = 2
11798
11799 /(?>.*?a)b/I
11800 Capturing subpattern count = 0
11801 Last code unit = 'b'
11802 Subject length lower bound = 2
11803
11804 /(?>^a)b/Is
11805 Capturing subpattern count = 0
11806 Compile options: dotall
11807 Overall options: anchored dotall
11808 First code unit = 'a'
11809 Subject length lower bound = 2
11810
11811 /(?>.*?)(?<=(abcd)|(wxyz))/I
11812 Capturing subpattern count = 2
11813 Max lookbehind = 4
11814 May match empty string
11815 Subject length lower bound = 0
11816
11817 /(?>.*)(?<=(abcd)|(wxyz))/I
11818 Capturing subpattern count = 2
11819 Max lookbehind = 4
11820 May match empty string
11821 Subject length lower bound = 0
11822
11823 "(?>.*)foo"I
11824 Capturing subpattern count = 0
11825 Last code unit = 'o'
11826 Subject length lower bound = 3
11827
11828 "(?>.*?)foo"I
11829 Capturing subpattern count = 0
11830 Last code unit = 'o'
11831 Subject length lower bound = 3
11832
11833 /(?>^abc)/Im
11834 Capturing subpattern count = 0
11835 Options: multiline
11836 First code unit at start or follows newline
11837 Last code unit = 'c'
11838 Subject length lower bound = 3
11839
11840 /(?>.*abc)/Im
11841 Capturing subpattern count = 0
11842 Options: multiline
11843 Last code unit = 'c'
11844 Subject length lower bound = 3
11845
11846 /(?:.*abc)/Im
11847 Capturing subpattern count = 0
11848 Options: multiline
11849 First code unit at start or follows newline
11850 Last code unit = 'c'
11851 Subject length lower bound = 3
11852
11853 /(?:(a)+(?C1)bb|aa(?C2)b)/
11854     aab\=callout_capture
11855 Callout 1: last capture = 1
11856  1: a
11857 --->aab
11858     ^ ^     b
11859 Callout 1: last capture = 1
11860  1: a
11861 --->aab
11862     ^^      b
11863 Callout 2: last capture = 0
11864 --->aab
11865     ^ ^     b
11866  0: aab
11867
11868 /(?:(a)++(?C1)bb|aa(?C2)b)/
11869     aab\=callout_capture
11870 Callout 1: last capture = 1
11871  1: a
11872 --->aab
11873     ^ ^     b
11874 Callout 2: last capture = 0
11875 --->aab
11876     ^ ^     b
11877  0: aab
11878
11879 /(?:(?>(a))(?C1)bb|aa(?C2)b)/
11880     aab\=callout_capture
11881 Callout 1: last capture = 1
11882  1: a
11883 --->aab
11884     ^^      b
11885 Callout 2: last capture = 0
11886 --->aab
11887     ^ ^     b
11888  0: aab
11889
11890 /(?:(?1)(?C1)x|ab(?C2))((a)){0}/
11891     aab\=callout_capture
11892 Callout 1: last capture = 0
11893 --->aab
11894     ^^      x
11895 Callout 1: last capture = 0
11896 --->aab
11897      ^^     x
11898 Callout 2: last capture = 0
11899 --->aab
11900      ^ ^    )
11901  0: ab
11902
11903 /(?1)(?C1)((a)(?C2)){0}/
11904     aab\=callout_capture
11905 Callout 2: last capture = 2
11906  1: <unset>
11907  2: a
11908 --->aab
11909     ^^      ){0}
11910 Callout 1: last capture = 0
11911 --->aab
11912     ^^      (
11913  0: a
11914
11915 /(?:(a)+(?C1)bb|aa(?C2)b)++/
11916     aab\=callout_capture
11917 Callout 1: last capture = 1
11918  1: a
11919 --->aab
11920     ^ ^     b
11921 Callout 1: last capture = 1
11922  1: a
11923 --->aab
11924     ^^      b
11925 Callout 2: last capture = 0
11926 --->aab
11927     ^ ^     b
11928  0: aab
11929     aab\=callout_capture,ovector=1
11930 Callout 1: last capture = 1
11931  1: a
11932 --->aab
11933     ^ ^     b
11934 Callout 1: last capture = 1
11935  1: a
11936 --->aab
11937     ^^      b
11938 Callout 2: last capture = 0
11939 --->aab
11940     ^ ^     b
11941  0: aab
11942
11943 /(ab)x|ab/
11944     ab\=ovector=0
11945  0: ab
11946     ab\=ovector=1
11947  0: ab
11948
11949 /(?<=123)(*MARK:xx)abc/mark
11950     xxxx123a\=ph
11951 Partial match, mark=xx: 123a
11952                         <<<
11953     xxxx123a\=ps
11954 Partial match, mark=xx: 123a
11955                         <<<
11956
11957 /123\Kabc/startchar
11958     xxxx123a\=ph
11959 Partial match: 123a
11960     xxxx123a\=ps
11961 Partial match: 123a
11962
11963 /^(?(?=a)aa|bb)/auto_callout
11964     bb
11965 --->bb
11966  +0 ^      ^
11967  +1 ^      (?
11968  +3 ^      (?=
11969  +6 ^      a
11970 +11 ^      b
11971 +12 ^^     b
11972 +13 ^ ^    )
11973 +14 ^ ^    End of pattern
11974  0: bb
11975
11976 /(?C1)^(?C2)(?(?C99)(?=(?C3)a(?C4))(?C5)a(?C6)a(?C7)|(?C8)b(?C9)b(?C10))(?C11)/
11977     bb
11978 --->bb
11979   1 ^      ^
11980   2 ^      (?
11981  99 ^      (?=
11982   3 ^      a
11983   8 ^      b
11984   9 ^^     b
11985  10 ^ ^    )
11986  11 ^ ^    End of pattern
11987  0: bb
11988
11989 # Perl seems to have a bug with this one.
11990
11991 /aaaaa(*COMMIT)(*PRUNE)b|a+c/
11992     aaaaaac
11993  0: aaaac
11994
11995 # Here are some that Perl treats differently because of the way it handles
11996 # backtracking verbs.
11997
11998 /(?!a(*COMMIT)b)ac|ad/
11999      ac
12000  0: ac
12001      ad
12002  0: ad
12003
12004 /^(?!a(*THEN)b|ac)../
12005      ad
12006  0: ad
12007 \= Expect no match
12008      ac
12009 No match
12010
12011 /^(?=a(*THEN)b|ac)/
12012     ac
12013  0: 
12014
12015 /\A.*?(?:a|b(*THEN)c)/
12016     ba
12017  0: ba
12018
12019 /\A.*?(?:a|b(*THEN)c)++/
12020     ba
12021  0: ba
12022
12023 /\A.*?(?:a|b(*THEN)c|d)/
12024     ba
12025  0: ba
12026
12027 /(?:(a(*MARK:X)a+(*SKIP:X)b)){0}(?:(?1)|aac)/
12028     aac
12029  0: aac
12030
12031 /\A.*?(a|b(*THEN)c)/
12032     ba
12033  0: ba
12034  1: a
12035
12036 /^(A(*THEN)B|A(*THEN)D)/
12037     AD
12038  0: AD
12039  1: AD
12040
12041 /(?!b(*THEN)a)bn|bnn/
12042     bnn
12043  0: bn
12044
12045 /(?(?=b(*SKIP)a)bn|bnn)/
12046     bnn
12047  0: bnn
12048
12049 /(?=b(*THEN)a|)bn|bnn/
12050     bnn
12051  0: bn
12052
12053 # This test causes a segfault with Perl 5.18.0
12054
12055 /^(?=(a)){0}b(?1)/
12056     backgammon
12057  0: ba
12058
12059 /(?|(?<n>f)|(?<n>b))/I,dupnames
12060 Capturing subpattern count = 1
12061 Named capturing subpatterns:
12062   n   1
12063 Options: dupnames
12064 Starting code units: b f 
12065 Subject length lower bound = 1
12066
12067 /(?<a>abc)(?<a>z)\k<a>()/IB,dupnames
12068 ------------------------------------------------------------------
12069         Bra
12070         CBra 1
12071         abc
12072         Ket
12073         CBra 2
12074         z
12075         Ket
12076         \k<a>2
12077         CBra 3
12078         Ket
12079         Ket
12080         End
12081 ------------------------------------------------------------------
12082 Capturing subpattern count = 3
12083 Max back reference = 2
12084 Named capturing subpatterns:
12085   a   1
12086   a   2
12087 Options: dupnames
12088 First code unit = 'a'
12089 Last code unit = 'z'
12090 Subject length lower bound = 5
12091
12092 /a*[bcd]/B
12093 ------------------------------------------------------------------
12094         Bra
12095         a*+
12096         [b-d]
12097         Ket
12098         End
12099 ------------------------------------------------------------------
12100
12101 /[bcd]*a/B
12102 ------------------------------------------------------------------
12103         Bra
12104         [b-d]*+
12105         a
12106         Ket
12107         End
12108 ------------------------------------------------------------------
12109
12110 # A complete set of tests for auto-possessification of character types, but
12111 # omitting \C because it might be disabled (it has its own tests).
12112
12113 /\D+\D \D+\d \D+\S \D+\s \D+\W \D+\w \D+. \D+\R \D+\H \D+\h \D+\V \D+\v \D+\Z \D+\z \D+$/Bx
12114 ------------------------------------------------------------------
12115         Bra
12116         \D+
12117         \D
12118         \D++
12119         \d
12120         \D+
12121         \S
12122         \D+
12123         \s
12124         \D+
12125         \W
12126         \D+
12127         \w
12128         \D+
12129         Any
12130         \D+
12131         \R
12132         \D+
12133         \H
12134         \D+
12135         \h
12136         \D+
12137         \V
12138         \D+
12139         \v
12140         \D+
12141         \Z
12142         \D++
12143         \z
12144         \D+
12145         $
12146         Ket
12147         End
12148 ------------------------------------------------------------------
12149
12150 /\d+\D \d+\d \d+\S \d+\s \d+\W \d+\w \d+. \d+\R \d+\H \d+\h \d+\V \d+\v \d+\Z \d+\z \d+$/Bx
12151 ------------------------------------------------------------------
12152         Bra
12153         \d++
12154         \D
12155         \d+
12156         \d
12157         \d+
12158         \S
12159         \d++
12160         \s
12161         \d++
12162         \W
12163         \d+
12164         \w
12165         \d+
12166         Any
12167         \d++
12168         \R
12169         \d+
12170         \H
12171         \d++
12172         \h
12173         \d+
12174         \V
12175         \d++
12176         \v
12177         \d++
12178         \Z
12179         \d++
12180         \z
12181         \d++
12182         $
12183         Ket
12184         End
12185 ------------------------------------------------------------------
12186
12187 /\S+\D \S+\d \S+\S \S+\s \S+\W \S+\w \S+. \S+\R \S+\H \S+\h \S+\V \S+\v \S+\Z \S+\z \S+$/Bx
12188 ------------------------------------------------------------------
12189         Bra
12190         \S+
12191         \D
12192         \S+
12193         \d
12194         \S+
12195         \S
12196         \S++
12197         \s
12198         \S+
12199         \W
12200         \S+
12201         \w
12202         \S+
12203         Any
12204         \S++
12205         \R
12206         \S+
12207         \H
12208         \S++
12209         \h
12210         \S+
12211         \V
12212         \S++
12213         \v
12214         \S++
12215         \Z
12216         \S++
12217         \z
12218         \S++
12219         $
12220         Ket
12221         End
12222 ------------------------------------------------------------------
12223
12224 /\s+\D \s+\d \s+\S \s+\s \s+\W \s+\w \s+. \s+\R \s+\H \s+\h \s+\V \s+\v \s+\Z \s+\z \s+$/Bx
12225 ------------------------------------------------------------------
12226         Bra
12227         \s+
12228         \D
12229         \s++
12230         \d
12231         \s++
12232         \S
12233         \s+
12234         \s
12235         \s+
12236         \W
12237         \s++
12238         \w
12239         \s+
12240         Any
12241         \s+
12242         \R
12243         \s+
12244         \H
12245         \s+
12246         \h
12247         \s+
12248         \V
12249         \s+
12250         \v
12251         \s+
12252         \Z
12253         \s++
12254         \z
12255         \s+
12256         $
12257         Ket
12258         End
12259 ------------------------------------------------------------------
12260
12261 /\W+\D \W+\d \W+\S \W+\s \W+\W \W+\w \W+. \W+\R \W+\H \W+\h \W+\V \W+\v \W+\Z \W+\z \W+$/Bx
12262 ------------------------------------------------------------------
12263         Bra
12264         \W+
12265         \D
12266         \W++
12267         \d
12268         \W+
12269         \S
12270         \W+
12271         \s
12272         \W+
12273         \W
12274         \W++
12275         \w
12276         \W+
12277         Any
12278         \W+
12279         \R
12280         \W+
12281         \H
12282         \W+
12283         \h
12284         \W+
12285         \V
12286         \W+
12287         \v
12288         \W+
12289         \Z
12290         \W++
12291         \z
12292         \W+
12293         $
12294         Ket
12295         End
12296 ------------------------------------------------------------------
12297
12298 /\w+\D \w+\d \w+\S \w+\s \w+\W \w+\w \w+. \w+\R \w+\H \w+\h \w+\V \w+\v \w+\Z \w+\z \w+$/Bx
12299 ------------------------------------------------------------------
12300         Bra
12301         \w+
12302         \D
12303         \w+
12304         \d
12305         \w+
12306         \S
12307         \w++
12308         \s
12309         \w++
12310         \W
12311         \w+
12312         \w
12313         \w+
12314         Any
12315         \w++
12316         \R
12317         \w+
12318         \H
12319         \w++
12320         \h
12321         \w+
12322         \V
12323         \w++
12324         \v
12325         \w++
12326         \Z
12327         \w++
12328         \z
12329         \w++
12330         $
12331         Ket
12332         End
12333 ------------------------------------------------------------------
12334
12335 /\R+\D \R+\d \R+\S \R+\s \R+\W \R+\w \R+. \R+\R \R+\H \R+\h \R+\V \R+\v \R+\Z \R+\z \R+$/Bx
12336 ------------------------------------------------------------------
12337         Bra
12338         \R+
12339         \D
12340         \R++
12341         \d
12342         \R+
12343         \S
12344         \R++
12345         \s
12346         \R+
12347         \W
12348         \R++
12349         \w
12350         \R++
12351         Any
12352         \R+
12353         \R
12354         \R+
12355         \H
12356         \R++
12357         \h
12358         \R+
12359         \V
12360         \R+
12361         \v
12362         \R+
12363         \Z
12364         \R++
12365         \z
12366         \R+
12367         $
12368         Ket
12369         End
12370 ------------------------------------------------------------------
12371
12372 /\H+\D \H+\d \H+\S \H+\s \H+\W \H+\w \H+. \H+\R \H+\H \H+\h \H+\V \H+\v \H+\Z \H+\z \H+$/Bx
12373 ------------------------------------------------------------------
12374         Bra
12375         \H+
12376         \D
12377         \H+
12378         \d
12379         \H+
12380         \S
12381         \H+
12382         \s
12383         \H+
12384         \W
12385         \H+
12386         \w
12387         \H+
12388         Any
12389         \H+
12390         \R
12391         \H+
12392         \H
12393         \H++
12394         \h
12395         \H+
12396         \V
12397         \H+
12398         \v
12399         \H+
12400         \Z
12401         \H++
12402         \z
12403         \H+
12404         $
12405         Ket
12406         End
12407 ------------------------------------------------------------------
12408
12409 /\h+\D \h+\d \h+\S \h+\s \h+\W \h+\w \h+. \h+\R \h+\H \h+\h \h+\V \h+\v \h+\Z \h+\z \h+$/Bx
12410 ------------------------------------------------------------------
12411         Bra
12412         \h+
12413         \D
12414         \h++
12415         \d
12416         \h++
12417         \S
12418         \h+
12419         \s
12420         \h+
12421         \W
12422         \h++
12423         \w
12424         \h+
12425         Any
12426         \h++
12427         \R
12428         \h++
12429         \H
12430         \h+
12431         \h
12432         \h+
12433         \V
12434         \h++
12435         \v
12436         \h+
12437         \Z
12438         \h++
12439         \z
12440         \h+
12441         $
12442         Ket
12443         End
12444 ------------------------------------------------------------------
12445
12446 /\V+\D \V+\d \V+\S \V+\s \V+\W \V+\w \V+. \V+\R \V+\H \V+\h \V+\V \V+\v \V+\Z \V+\z \V+$/Bx
12447 ------------------------------------------------------------------
12448         Bra
12449         \V+
12450         \D
12451         \V+
12452         \d
12453         \V+
12454         \S
12455         \V+
12456         \s
12457         \V+
12458         \W
12459         \V+
12460         \w
12461         \V+
12462         Any
12463         \V++
12464         \R
12465         \V+
12466         \H
12467         \V+
12468         \h
12469         \V+
12470         \V
12471         \V++
12472         \v
12473         \V+
12474         \Z
12475         \V++
12476         \z
12477         \V+
12478         $
12479         Ket
12480         End
12481 ------------------------------------------------------------------
12482
12483 /\v+\D \v+\d \v+\S \v+\s \v+\W \v+\w \v+. \v+\R \v+\H \v+\h \v+\V \v+\v \v+\Z \v+\z \v+$/Bx
12484 ------------------------------------------------------------------
12485         Bra
12486         \v+
12487         \D
12488         \v++
12489         \d
12490         \v++
12491         \S
12492         \v+
12493         \s
12494         \v+
12495         \W
12496         \v++
12497         \w
12498         \v+
12499         Any
12500         \v+
12501         \R
12502         \v+
12503         \H
12504         \v++
12505         \h
12506         \v++
12507         \V
12508         \v+
12509         \v
12510         \v+
12511         \Z
12512         \v++
12513         \z
12514         \v+
12515         $
12516         Ket
12517         End
12518 ------------------------------------------------------------------
12519
12520 / a+\D  a+\d  a+\S  a+\s  a+\W  a+\w  a+.  a+\R  a+\H  a+\h  a+\V  a+\v  a+\Z  a+\z  a+$/Bx
12521 ------------------------------------------------------------------
12522         Bra
12523         a+
12524         \D
12525         a++
12526         \d
12527         a+
12528         \S
12529         a++
12530         \s
12531         a++
12532         \W
12533         a+
12534         \w
12535         a+
12536         Any
12537         a++
12538         \R
12539         a+
12540         \H
12541         a++
12542         \h
12543         a+
12544         \V
12545         a++
12546         \v
12547         a++
12548         \Z
12549         a++
12550         \z
12551         a++
12552         $
12553         Ket
12554         End
12555 ------------------------------------------------------------------
12556
12557 /\n+\D \n+\d \n+\S \n+\s \n+\W \n+\w \n+. \n+\R \n+\H \n+\h \n+\V \n+\v \n+\Z \n+\z \n+$/Bx
12558 ------------------------------------------------------------------
12559         Bra
12560         \x0a+
12561         \D
12562         \x0a++
12563         \d
12564         \x0a++
12565         \S
12566         \x0a+
12567         \s
12568         \x0a+
12569         \W
12570         \x0a++
12571         \w
12572         \x0a+
12573         Any
12574         \x0a+
12575         \R
12576         \x0a+
12577         \H
12578         \x0a++
12579         \h
12580         \x0a++
12581         \V
12582         \x0a+
12583         \v
12584         \x0a+
12585         \Z
12586         \x0a++
12587         \z
12588         \x0a+
12589         $
12590         Ket
12591         End
12592 ------------------------------------------------------------------
12593
12594 / .+\D  .+\d  .+\S  .+\s  .+\W  .+\w  .+.  .+\R  .+\H  .+\h  .+\V  .+\v  .+\Z  .+\z  .+$/Bx
12595 ------------------------------------------------------------------
12596         Bra
12597         Any+
12598         \D
12599         Any+
12600         \d
12601         Any+
12602         \S
12603         Any+
12604         \s
12605         Any+
12606         \W
12607         Any+
12608         \w
12609         Any+
12610         Any
12611         Any++
12612         \R
12613         Any+
12614         \H
12615         Any+
12616         \h
12617         Any+
12618         \V
12619         Any+
12620         \v
12621         Any+
12622         \Z
12623         Any++
12624         \z
12625         Any+
12626         $
12627         Ket
12628         End
12629 ------------------------------------------------------------------
12630
12631 / .+\D  .+\d  .+\S  .+\s  .+\W  .+\w  .+.  .+\R  .+\H  .+\h  .+\V  .+\v  .+\Z  .+\z  .+$/Bsx
12632 ------------------------------------------------------------------
12633         Bra
12634         AllAny+
12635         \D
12636         AllAny+
12637         \d
12638         AllAny+
12639         \S
12640         AllAny+
12641         \s
12642         AllAny+
12643         \W
12644         AllAny+
12645         \w
12646         AllAny+
12647         AllAny
12648         AllAny+
12649         \R
12650         AllAny+
12651         \H
12652         AllAny+
12653         \h
12654         AllAny+
12655         \V
12656         AllAny+
12657         \v
12658         AllAny+
12659         \Z
12660         AllAny++
12661         \z
12662         AllAny+
12663         $
12664         Ket
12665         End
12666 ------------------------------------------------------------------
12667
12668 / \D+$  \d+$  \S+$  \s+$  \W+$  \w+$  \R+$  \H+$  \h+$  \V+$ \v+$  a+$   \n+$  .+$  .+$/Bmx
12669 ------------------------------------------------------------------
12670         Bra
12671         \D+
12672      /m $
12673         \d++
12674      /m $
12675         \S++
12676      /m $
12677         \s+
12678      /m $
12679         \W+
12680      /m $
12681         \w++
12682      /m $
12683         \R+
12684      /m $
12685         \H+
12686      /m $
12687         \h+
12688      /m $
12689         \V+
12690      /m $
12691         \v+
12692      /m $
12693         a+
12694      /m $
12695         \x0a+
12696      /m $
12697         Any+
12698      /m $
12699         Any+
12700      /m $
12701         Ket
12702         End
12703 ------------------------------------------------------------------
12704
12705 /(?=a+)a(a+)++a/B
12706 ------------------------------------------------------------------
12707         Bra
12708         Assert
12709         a++
12710         Ket
12711         a
12712         CBraPos 1
12713         a+
12714         KetRpos
12715         a
12716         Ket
12717         End
12718 ------------------------------------------------------------------
12719
12720 /a+(bb|cc)a+(?:bb|cc)a+(?>bb|cc)a+(?:bb|cc)+a+(aa)a+(?:bb|aa)/B
12721 ------------------------------------------------------------------
12722         Bra
12723         a++
12724         CBra 1
12725         bb
12726         Alt
12727         cc
12728         Ket
12729         a++
12730         Bra
12731         bb
12732         Alt
12733         cc
12734         Ket
12735         a++
12736         Once
12737         bb
12738         Alt
12739         cc
12740         Ket
12741         a++
12742         Bra
12743         bb
12744         Alt
12745         cc
12746         KetRmax
12747         a+
12748         CBra 2
12749         aa
12750         Ket
12751         a+
12752         Bra
12753         bb
12754         Alt
12755         aa
12756         Ket
12757         Ket
12758         End
12759 ------------------------------------------------------------------
12760
12761 /a+(bb|cc)?#a+(?:bb|cc)??#a+(?:bb|cc)?+#a+(?:bb|cc)*#a+(bb|cc)?a#a+(?:aa)?/B
12762 ------------------------------------------------------------------
12763         Bra
12764         a++
12765         Brazero
12766         CBra 1
12767         bb
12768         Alt
12769         cc
12770         Ket
12771         #
12772         a++
12773         Braminzero
12774         Bra
12775         bb
12776         Alt
12777         cc
12778         Ket
12779         #
12780         a++
12781         Once
12782         Brazero
12783         Bra
12784         bb
12785         Alt
12786         cc
12787         Ket
12788         Ket
12789         #
12790         a++
12791         Brazero
12792         Bra
12793         bb
12794         Alt
12795         cc
12796         KetRmax
12797         #
12798         a+
12799         Brazero
12800         CBra 2
12801         bb
12802         Alt
12803         cc
12804         Ket
12805         a#
12806         a+
12807         Brazero
12808         Bra
12809         aa
12810         Ket
12811         Ket
12812         End
12813 ------------------------------------------------------------------
12814
12815 /a+(?:bb)?a#a+(?:|||)#a+(?:|b)a#a+(?:|||)?a/B
12816 ------------------------------------------------------------------
12817         Bra
12818         a+
12819         Brazero
12820         Bra
12821         bb
12822         Ket
12823         a#
12824         a++
12825         Bra
12826         Alt
12827         Alt
12828         Alt
12829         Ket
12830         #
12831         a+
12832         Bra
12833         Alt
12834         b
12835         Ket
12836         a#
12837         a+
12838         Brazero
12839         Bra
12840         Alt
12841         Alt
12842         Alt
12843         Ket
12844         a
12845         Ket
12846         End
12847 ------------------------------------------------------------------
12848
12849 /[ab]*/B
12850 ------------------------------------------------------------------
12851         Bra
12852         [ab]*+
12853         Ket
12854         End
12855 ------------------------------------------------------------------
12856     aaaa
12857  0: aaaa
12858
12859 /[ab]*?/B
12860 ------------------------------------------------------------------
12861         Bra
12862         [ab]*?
12863         Ket
12864         End
12865 ------------------------------------------------------------------
12866     aaaa
12867  0: 
12868
12869 /[ab]?/B
12870 ------------------------------------------------------------------
12871         Bra
12872         [ab]?+
12873         Ket
12874         End
12875 ------------------------------------------------------------------
12876     aaaa
12877  0: a
12878
12879 /[ab]??/B
12880 ------------------------------------------------------------------
12881         Bra
12882         [ab]??
12883         Ket
12884         End
12885 ------------------------------------------------------------------
12886     aaaa
12887  0: 
12888
12889 /[ab]+/B
12890 ------------------------------------------------------------------
12891         Bra
12892         [ab]++
12893         Ket
12894         End
12895 ------------------------------------------------------------------
12896     aaaa
12897  0: aaaa
12898
12899 /[ab]+?/B
12900 ------------------------------------------------------------------
12901         Bra
12902         [ab]+?
12903         Ket
12904         End
12905 ------------------------------------------------------------------
12906     aaaa
12907  0: a
12908
12909 /[ab]{2,3}/B
12910 ------------------------------------------------------------------
12911         Bra
12912         [ab]{2,3}+
12913         Ket
12914         End
12915 ------------------------------------------------------------------
12916     aaaa
12917  0: aaa
12918
12919 /[ab]{2,3}?/B
12920 ------------------------------------------------------------------
12921         Bra
12922         [ab]{2,3}?
12923         Ket
12924         End
12925 ------------------------------------------------------------------
12926     aaaa
12927  0: aa
12928
12929 /[ab]{2,}/B
12930 ------------------------------------------------------------------
12931         Bra
12932         [ab]{2,}+
12933         Ket
12934         End
12935 ------------------------------------------------------------------
12936     aaaa
12937  0: aaaa
12938
12939 /[ab]{2,}?/B
12940 ------------------------------------------------------------------
12941         Bra
12942         [ab]{2,}?
12943         Ket
12944         End
12945 ------------------------------------------------------------------
12946     aaaa
12947  0: aa
12948
12949 /\d+\s{0,5}=\s*\S?=\w{0,4}\W*/B
12950 ------------------------------------------------------------------
12951         Bra
12952         \d++
12953         \s{0,5}+
12954         =
12955         \s*+
12956         \S?
12957         =
12958         \w{0,4}+
12959         \W*+
12960         Ket
12961         End
12962 ------------------------------------------------------------------
12963
12964 /[a-d]{5,12}[e-z0-9]*#[^a-z]+[b-y]*a[2-7]?[^0-9a-z]+/B
12965 ------------------------------------------------------------------
12966         Bra
12967         [a-d]{5,12}+
12968         [0-9e-z]*+
12969         #
12970         [\x00-`{-\xff] (neg)++
12971         [b-y]*+
12972         a
12973         [2-7]?+
12974         [\x00-/:-`{-\xff] (neg)++
12975         Ket
12976         End
12977 ------------------------------------------------------------------
12978
12979 /[a-z]*\s#[ \t]?\S#[a-c]*\S#[C-G]+?\d#[4-8]*\D#[4-9,]*\D#[!$]{0,5}\w#[M-Xf-l]+\W#[a-c,]?\W/B
12980 ------------------------------------------------------------------
12981         Bra
12982         [a-z]*+
12983         \s
12984         #
12985         [\x09 ]?+
12986         \S
12987         #
12988         [a-c]*
12989         \S
12990         #
12991         [C-G]++
12992         \d
12993         #
12994         [4-8]*+
12995         \D
12996         #
12997         [,4-9]*
12998         \D
12999         #
13000         [!$]{0,5}+
13001         \w
13002         #
13003         [M-Xf-l]++
13004         \W
13005         #
13006         [,a-c]?
13007         \W
13008         Ket
13009         End
13010 ------------------------------------------------------------------
13011
13012 /a+(aa|bb)*c#a*(bb|cc)*a#a?(bb|cc)*d#[a-f]*(g|hh)*f/B
13013 ------------------------------------------------------------------
13014         Bra
13015         a+
13016         Brazero
13017         CBra 1
13018         aa
13019         Alt
13020         bb
13021         KetRmax
13022         c#
13023         a*
13024         Brazero
13025         CBra 2
13026         bb
13027         Alt
13028         cc
13029         KetRmax
13030         a#
13031         a?+
13032         Brazero
13033         CBra 3
13034         bb
13035         Alt
13036         cc
13037         KetRmax
13038         d#
13039         [a-f]*
13040         Brazero
13041         CBra 4
13042         g
13043         Alt
13044         hh
13045         KetRmax
13046         f
13047         Ket
13048         End
13049 ------------------------------------------------------------------
13050
13051 /[a-f]*(g|hh|i)*i#[a-x]{4,}(y{0,6})*y#[a-k]+(ll|mm)+n/B
13052 ------------------------------------------------------------------
13053         Bra
13054         [a-f]*+
13055         Brazero
13056         CBra 1
13057         g
13058         Alt
13059         hh
13060         Alt
13061         i
13062         KetRmax
13063         i#
13064         [a-x]{4,}
13065         Brazero
13066         SCBra 2
13067         y{0,6}
13068         KetRmax
13069         y#
13070         [a-k]++
13071         CBra 3
13072         ll
13073         Alt
13074         mm
13075         KetRmax
13076         n
13077         Ket
13078         End
13079 ------------------------------------------------------------------
13080
13081 /[a-f]*(?>gg|hh)+#[a-f]*(?>gg|hh)?#[a-f]*(?>gg|hh)*a#[a-f]*(?>gg|hh)*h/B
13082 ------------------------------------------------------------------
13083         Bra
13084         [a-f]*+
13085         Once
13086         gg
13087         Alt
13088         hh
13089         KetRmax
13090         #
13091         [a-f]*+
13092         Brazero
13093         Once
13094         gg
13095         Alt
13096         hh
13097         Ket
13098         #
13099         [a-f]*
13100         Brazero
13101         Once
13102         gg
13103         Alt
13104         hh
13105         KetRmax
13106         a#
13107         [a-f]*+
13108         Brazero
13109         Once
13110         gg
13111         Alt
13112         hh
13113         KetRmax
13114         h
13115         Ket
13116         End
13117 ------------------------------------------------------------------
13118
13119 /[a-c]*d/IB
13120 ------------------------------------------------------------------
13121         Bra
13122         [a-c]*+
13123         d
13124         Ket
13125         End
13126 ------------------------------------------------------------------
13127 Capturing subpattern count = 0
13128 Starting code units: a b c d 
13129 Last code unit = 'd'
13130 Subject length lower bound = 1
13131
13132 /[a-c]+d/IB
13133 ------------------------------------------------------------------
13134         Bra
13135         [a-c]++
13136         d
13137         Ket
13138         End
13139 ------------------------------------------------------------------
13140 Capturing subpattern count = 0
13141 Starting code units: a b c 
13142 Last code unit = 'd'
13143 Subject length lower bound = 2
13144
13145 /[a-c]?d/IB
13146 ------------------------------------------------------------------
13147         Bra
13148         [a-c]?+
13149         d
13150         Ket
13151         End
13152 ------------------------------------------------------------------
13153 Capturing subpattern count = 0
13154 Starting code units: a b c d 
13155 Last code unit = 'd'
13156 Subject length lower bound = 1
13157
13158 /[a-c]{4,6}d/IB
13159 ------------------------------------------------------------------
13160         Bra
13161         [a-c]{4,6}+
13162         d
13163         Ket
13164         End
13165 ------------------------------------------------------------------
13166 Capturing subpattern count = 0
13167 Starting code units: a b c 
13168 Last code unit = 'd'
13169 Subject length lower bound = 5
13170
13171 /[a-c]{0,6}d/IB
13172 ------------------------------------------------------------------
13173         Bra
13174         [a-c]{0,6}+
13175         d
13176         Ket
13177         End
13178 ------------------------------------------------------------------
13179 Capturing subpattern count = 0
13180 Starting code units: a b c d 
13181 Last code unit = 'd'
13182 Subject length lower bound = 1
13183
13184 # End of special auto-possessive tests
13185
13186 /^A\o{1239}B/
13187 Failed: error 164 at offset 8: non-octal character in \o{} (closing brace missing?)
13188     A\123B
13189
13190 /^A\oB/
13191 Failed: error 155 at offset 4: missing opening brace after \o
13192
13193 /^A\x{zz}B/
13194 Failed: error 167 at offset 5: non-hex character in \x{} (closing brace missing?)
13195
13196 /^A\x{12Z/
13197 Failed: error 167 at offset 7: non-hex character in \x{} (closing brace missing?)
13198
13199 /^A\x{/
13200 Failed: error 178 at offset 5: digits missing in \x{} or \o{} or \N{U+}
13201
13202 /[ab]++/B,no_auto_possess
13203 ------------------------------------------------------------------
13204         Bra
13205         [ab]++
13206         Ket
13207         End
13208 ------------------------------------------------------------------
13209
13210 /[^ab]*+/B,no_auto_possess
13211 ------------------------------------------------------------------
13212         Bra
13213         [\x00-`c-\xff] (neg)*+
13214         Ket
13215         End
13216 ------------------------------------------------------------------
13217
13218 /a{4}+/B,no_auto_possess
13219 ------------------------------------------------------------------
13220         Bra
13221         a{4}
13222         Ket
13223         End
13224 ------------------------------------------------------------------
13225
13226 /a{4}+/Bi,no_auto_possess
13227 ------------------------------------------------------------------
13228         Bra
13229      /i a{4}
13230         Ket
13231         End
13232 ------------------------------------------------------------------
13233
13234 /[a-[:digit:]]+/
13235 Failed: error 150 at offset 4: invalid range in character class
13236
13237 /[A-[:digit:]]+/
13238 Failed: error 150 at offset 4: invalid range in character class
13239
13240 /[a-[.xxx.]]+/
13241 Failed: error 150 at offset 4: invalid range in character class
13242
13243 /[a-[=xxx=]]+/
13244 Failed: error 150 at offset 4: invalid range in character class
13245
13246 /[a-[!xxx!]]+/
13247 Failed: error 108 at offset 3: range out of order in character class
13248
13249 /[A-[!xxx!]]+/
13250     A]]]
13251  0: A]]]
13252
13253 /[a-\d]+/
13254 Failed: error 150 at offset 5: invalid range in character class
13255
13256 /(?<0abc>xx)/
13257 Failed: error 144 at offset 3: group name must start with a non-digit
13258
13259 /(?&1abc)xx(?<1abc>y)/
13260 Failed: error 144 at offset 3: group name must start with a non-digit
13261
13262 /(?<ab-cd>xx)/
13263 Failed: error 142 at offset 5: syntax error in subpattern name (missing terminator)
13264
13265 /(?'0abc'xx)/
13266 Failed: error 144 at offset 3: group name must start with a non-digit
13267
13268 /(?P<0abc>xx)/
13269 Failed: error 144 at offset 4: group name must start with a non-digit
13270
13271 /\k<5ghj>/
13272 Failed: error 144 at offset 3: group name must start with a non-digit
13273
13274 /\k'5ghj'/
13275 Failed: error 144 at offset 3: group name must start with a non-digit
13276
13277 /\k{2fgh}/
13278 Failed: error 144 at offset 3: group name must start with a non-digit
13279
13280 /(?P=8yuki)/
13281 Failed: error 144 at offset 4: group name must start with a non-digit
13282
13283 /\g{4df}/
13284 Failed: error 157 at offset 2: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
13285
13286 /(?&1abc)xx(?<1abc>y)/
13287 Failed: error 144 at offset 3: group name must start with a non-digit
13288
13289 /(?P>1abc)xx(?<1abc>y)/
13290 Failed: error 144 at offset 4: group name must start with a non-digit
13291
13292 /\g'3gh'/
13293 Failed: error 157 at offset 2: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
13294
13295 /\g<5fg>/
13296 Failed: error 157 at offset 2: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
13297
13298 /(?(<4gh>)abc)/
13299 Failed: error 144 at offset 4: group name must start with a non-digit
13300
13301 /(?('4gh')abc)/
13302 Failed: error 144 at offset 4: group name must start with a non-digit
13303
13304 /(?(4gh)abc)/
13305 Failed: error 124 at offset 4: missing closing parenthesis for condition
13306
13307 /(?(R&6yh)abc)/
13308 Failed: error 144 at offset 5: group name must start with a non-digit
13309
13310 /(((a\2)|(a*)\g<-1>))*a?/B
13311 ------------------------------------------------------------------
13312         Bra
13313         Brazero
13314         SCBra 1
13315         Once
13316         CBra 2
13317         CBra 3
13318         a
13319         \2
13320         Ket
13321         Alt
13322         CBra 4
13323         a*
13324         Ket
13325         Recurse
13326         Ket
13327         Ket
13328         KetRmax
13329         a?+
13330         Ket
13331         End
13332 ------------------------------------------------------------------
13333
13334 # Test the ugly "start or end of word" compatibility syntax.
13335
13336 /[[:<:]]red[[:>:]]/B
13337 ------------------------------------------------------------------
13338         Bra
13339         \b
13340         Assert
13341         \w
13342         Ket
13343         red
13344         \b
13345         AssertB
13346         Reverse
13347         \w
13348         Ket
13349         Ket
13350         End
13351 ------------------------------------------------------------------
13352     little red riding hood
13353  0: red
13354     a /red/ thing
13355  0: red
13356     red is a colour
13357  0: red
13358     put it all on red
13359  0: red
13360 \= Expect no match
13361     no reduction
13362 No match
13363     Alfred Winifred
13364 No match
13365
13366 /[a[:<:]] should give error/
13367 Failed: error 130 at offset 4: unknown POSIX class name
13368
13369 /(?=ab\K)/aftertext
13370     abcd\=startchar
13371 Start of matched string is beyond its end - displaying from end to start.
13372  0: ab
13373  0+ abcd
13374
13375 /abcd/newline=lf,firstline
13376 \= Expect no match
13377     xx\nxabcd
13378 No match
13379
13380 # Test stack guard external calls.
13381
13382 /(((a)))/stackguard=1
13383 Failed: error 133 at offset 7: parentheses are too deeply nested (stack check)
13384
13385 /(((a)))/stackguard=2
13386 Failed: error 133 at offset 7: parentheses are too deeply nested (stack check)
13387
13388 /(((a)))/stackguard=3
13389
13390 /(((((a)))))/
13391
13392 # End stack guard tests
13393
13394 /^\w+(?>\s*)(?<=\w)/B
13395 ------------------------------------------------------------------
13396         Bra
13397         ^
13398         \w+
13399         Once
13400         \s*+
13401         Ket
13402         AssertB
13403         Reverse
13404         \w
13405         Ket
13406         Ket
13407         End
13408 ------------------------------------------------------------------
13409
13410 /\othing/
13411 Failed: error 155 at offset 2: missing opening brace after \o
13412
13413 /\o{}/
13414 Failed: error 178 at offset 3: digits missing in \x{} or \o{} or \N{U+}
13415
13416 /\o{whatever}/
13417 Failed: error 164 at offset 3: non-octal character in \o{} (closing brace missing?)
13418
13419 /\xthing/
13420
13421 /\x{}/
13422 Failed: error 178 at offset 3: digits missing in \x{} or \o{} or \N{U+}
13423
13424 /\x{whatever}/
13425 Failed: error 167 at offset 3: non-hex character in \x{} (closing brace missing?)
13426
13427 /A\8B/
13428 Failed: error 115 at offset 2: reference to non-existent subpattern
13429
13430 /A\9B/
13431 Failed: error 115 at offset 2: reference to non-existent subpattern
13432
13433 # This one is here because Perl fails to match "12" for this pattern when the $
13434 # is present.
13435
13436 /^(?(?=abc)\w{3}:|\d\d)$/
13437     abc:
13438  0: abc:
13439     12
13440  0: 12
13441 \= Expect no match
13442     123
13443 No match
13444     xyz
13445 No match
13446
13447 # Perl gets this one wrong, giving "a" as the after text for ca and failing to
13448 # match for cd.
13449
13450 /(?(?=ab)ab)/aftertext
13451     abxxx
13452  0: ab
13453  0+ xxx
13454     ca
13455  0: 
13456  0+ ca
13457     cd
13458  0: 
13459  0+ cd
13460
13461 # This should test both paths for processing OP_RECURSE.
13462
13463 /(?(R)a+|(?R)b)/
13464     aaaabcde
13465  0: aaaab
13466     aaaabcde\=ovector=100
13467  0: aaaab
13468
13469 /a*?b*?/
13470     ab
13471  0: 
13472
13473 /(*NOTEMPTY)a*?b*?/
13474     ab
13475  0: a
13476     ba
13477  0: b
13478     cb
13479  0: b
13480
13481 /(*NOTEMPTY_ATSTART)a*?b*?/aftertext
13482     ab
13483  0: a
13484  0+ b
13485     cdab
13486  0: 
13487  0+ dab
13488
13489 /(?(VERSION>=10.0)yes|no)/I
13490 Capturing subpattern count = 0
13491 Subject length lower bound = 2
13492     yesno
13493  0: yes
13494
13495 /(?(VERSION>=10.04)yes|no)/
13496     yesno
13497  0: yes
13498
13499 /(?(VERSION=8)yes){3}/BI,aftertext
13500 ------------------------------------------------------------------
13501         Bra
13502         Cond
13503         Cond false
13504         yes
13505         Ket
13506         Ket
13507         End
13508 ------------------------------------------------------------------
13509 Capturing subpattern count = 0
13510 May match empty string
13511 Subject length lower bound = 0
13512     yesno
13513  0: 
13514  0+ yesno
13515
13516 /(?(VERSION=8)yes|no){3}/I
13517 Capturing subpattern count = 0
13518 Subject length lower bound = 6
13519     yesnononoyes
13520  0: nonono
13521 \= Expect no match
13522     yesno
13523 No match
13524
13525 /(?:(?<VERSION>abc)|xyz)(?(VERSION)yes|no)/I
13526 Capturing subpattern count = 1
13527 Max back reference = 1
13528 Named capturing subpatterns:
13529   VERSION   1
13530 Starting code units: a x 
13531 Subject length lower bound = 5
13532     abcyes
13533  0: abcyes
13534  1: abc
13535     xyzno
13536  0: xyzno
13537 \= Expect no match
13538     abcno
13539 No match
13540     xyzyes
13541 No match
13542
13543 /(?(VERSION<10)yes|no)/
13544 Failed: error 179 at offset 10: syntax error or number too big in (?(VERSION condition
13545
13546 /(?(VERSION>10)yes|no)/
13547 Failed: error 179 at offset 11: syntax error or number too big in (?(VERSION condition
13548
13549 /(?(VERSION>=10.0.0)yes|no)/
13550 Failed: error 179 at offset 16: syntax error or number too big in (?(VERSION condition
13551
13552 /(?(VERSION=10.101)yes|no)/
13553 Failed: error 179 at offset 16: syntax error or number too big in (?(VERSION condition
13554
13555 /abcd/I
13556 Capturing subpattern count = 0
13557 First code unit = 'a'
13558 Last code unit = 'd'
13559 Subject length lower bound = 4
13560
13561 /abcd/I,no_start_optimize
13562 Capturing subpattern count = 0
13563 Options: no_start_optimize
13564 Subject length lower bound = 0
13565
13566 /(|ab)*?d/I
13567 Capturing subpattern count = 1
13568 Starting code units: a d 
13569 Last code unit = 'd'
13570 Subject length lower bound = 1
13571    abd
13572  0: abd
13573  1: ab
13574    xyd
13575  0: d
13576
13577 /(|ab)*?d/I,no_start_optimize
13578 Capturing subpattern count = 1
13579 Options: no_start_optimize
13580 Subject length lower bound = 0
13581    abd
13582  0: abd
13583  1: ab
13584    xyd
13585  0: d
13586
13587 /\k<A>*(?<A>aa)(?<A>bb)/match_unset_backref,dupnames
13588     aabb
13589  0: aabb
13590  1: aa
13591  2: bb
13592
13593 /(((((a)))))/parens_nest_limit=2
13594 Failed: error 119 at offset 3: parentheses are too deeply nested
13595
13596 /abc/replace=XYZ
13597     123123
13598  0: 123123
13599     123abc123
13600  1: 123XYZ123
13601     123abc123abc123
13602  1: 123XYZ123abc123
13603     123123\=zero_terminate
13604  0: 123123
13605     123abc123\=zero_terminate
13606  1: 123XYZ123
13607     123abc123abc123\=zero_terminate
13608  1: 123XYZ123abc123
13609
13610 /abc/g,replace=XYZ
13611     123abc123
13612  1: 123XYZ123
13613     123abc123abc123
13614  2: 123XYZ123XYZ123
13615
13616 /abc/replace=X$$Z
13617     123abc123
13618  1: 123X$Z123
13619
13620 /abc/g,replace=X$$Z
13621     123abc123abc123
13622  2: 123X$Z123X$Z123
13623
13624 /a(b)c(d)e/replace=X$1Y${2}Z
13625     "abcde"
13626  1: "XbYdZ"
13627
13628 /a(b)c(d)e/replace=X$1Y${2}Z,global
13629     "abcde-abcde"
13630  2: "XbYdZ-XbYdZ"
13631
13632 /a(?<ONE>b)c(?<TWO>d)e/replace=X$ONE+${TWO}Z
13633     "abcde"
13634  1: "Xb+dZ"
13635
13636 /a(?<ONE>b)c(?<TWO>d)e/g,replace=X$ONE+${TWO}Z
13637     "abcde-abcde-"
13638  2: "Xb+dZ-Xb+dZ-"
13639
13640 /abc/replace=a$++
13641     123abc
13642 Failed: error -35 at offset 2 in replacement: invalid replacement string
13643
13644 /abc/replace=a$bad
13645     123abc
13646 Failed: error -49 at offset 5 in replacement: unknown substring
13647
13648 /abc/replace=a${A234567890123456789_123456789012}z
13649     123abc
13650 Failed: error -49 at offset 36 in replacement: unknown substring
13651
13652 /abc/replace=a${A23456789012345678901234567890123}z
13653     123abc
13654 Failed: error -35 at offset 35 in replacement: invalid replacement string
13655
13656 /abc/replace=a${bcd
13657     123abc
13658 Failed: error -58 at offset 6 in replacement: expected closing curly bracket in replacement string
13659
13660 /abc/replace=a${b+d}z
13661     123abc
13662 Failed: error -58 at offset 4 in replacement: expected closing curly bracket in replacement string
13663
13664 /abc/replace=[10]XYZ
13665     123abc123
13666  1: 123XYZ123
13667
13668 /abc/replace=[9]XYZ
13669     123abc123
13670 Failed: error -48: no more memory
13671
13672 /abc/replace=xyz
13673     1abc2\=partial_hard
13674 Failed: error -34: bad option value
13675
13676 /abc/replace=xyz
13677     123abc456
13678  1: 123xyz456
13679     123abc456\=replace=pqr
13680  1: 123pqr456
13681     123abc456abc789
13682  1: 123xyz456abc789
13683     123abc456abc789\=g
13684  2: 123xyz456xyz789
13685
13686 /(?<=abc)(|def)/g,replace=<$0>
13687     123abcxyzabcdef789abcpqr
13688  4: 123abc<>xyzabc<><def>789abc<>pqr
13689
13690 /./replace=$0
13691     a
13692  1: a
13693
13694 /(.)(.)/replace=$2+$1
13695     abc
13696  1: b+ac
13697
13698 /(?<A>.)(?<B>.)/replace=$B+$A
13699     abc
13700  1: b+ac
13701
13702 /(.)(.)/g,replace=$2$1
13703     abcdefgh
13704  4: badcfehg
13705
13706 /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=${*MARK}
13707     apple lemon blackberry
13708  3: pear orange strawberry
13709     apple strudel
13710  1: pear strudel
13711     fruitless
13712  0: fruitless
13713
13714 /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/replace=${*MARK} sauce,
13715     apple lemon blackberry
13716  1: pear sauce lemon blackberry
13717
13718 /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=<$*MARK>
13719     apple lemon blackberry
13720  3: <pear> <orange> <strawberry>
13721     apple strudel
13722  1: <pear> strudel
13723     fruitless
13724  0: fruitless
13725
13726 /(*:pear)apple/g,replace=${*MARKING}
13727     apple lemon blackberry
13728 Failed: error -35 at offset 11 in replacement: invalid replacement string
13729
13730 /(*:pear)apple/g,replace=${*MARK-time
13731     apple lemon blackberry
13732 Failed: error -58 at offset 7 in replacement: expected closing curly bracket in replacement string
13733
13734 /(*:pear)apple/g,replace=${*mark}
13735     apple lemon blackberry
13736 Failed: error -35 at offset 8 in replacement: invalid replacement string
13737
13738 /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=<$*MARKET>
13739     apple lemon blackberry
13740 Failed: error -35 at offset 9 in replacement: invalid replacement string
13741
13742 /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=[22]${*MARK}
13743     apple lemon blackberry
13744 Failed: error -48: no more memory
13745     apple lemon blackberry\=substitute_overflow_length
13746 Failed: error -48: no more memory: 23 code units are needed
13747
13748 /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=[23]${*MARK}
13749     apple lemon blackberry
13750  3: pear orange strawberry
13751
13752 /abc/
13753     123abc123\=replace=[9]XYZ
13754 Failed: error -48: no more memory
13755     123abc123\=substitute_overflow_length,replace=[9]XYZ
13756 Failed: error -48: no more memory: 10 code units are needed
13757     123abc123\=substitute_overflow_length,replace=[6]XYZ
13758 Failed: error -48: no more memory: 10 code units are needed
13759     123abc123\=substitute_overflow_length,replace=[1]XYZ
13760 Failed: error -48: no more memory: 10 code units are needed
13761     123abc123\=substitute_overflow_length,replace=[0]XYZ
13762 Failed: error -48: no more memory: 10 code units are needed
13763
13764 /a(b)c/
13765     123abc123\=replace=[9]x$1z
13766 Failed: error -48: no more memory
13767     123abc123\=substitute_overflow_length,replace=[9]x$1z
13768 Failed: error -48: no more memory: 10 code units are needed
13769     123abc123\=substitute_overflow_length,replace=[6]x$1z
13770 Failed: error -48: no more memory: 10 code units are needed
13771     123abc123\=substitute_overflow_length,replace=[1]x$1z
13772 Failed: error -48: no more memory: 10 code units are needed
13773     123abc123\=substitute_overflow_length,replace=[0]x$1z
13774 Failed: error -48: no more memory: 10 code units are needed
13775
13776 "((?=(?(?=(?(?=(?(?=()))))))))"
13777     a
13778  0: 
13779  1: 
13780  2: 
13781
13782 "(?(?=)==)(((((((((?=)))))))))"
13783 \= Expect no match
13784     a
13785 No match
13786
13787 /(a)(b)|(c)/
13788     XcX\=ovector=2,get=1,get=2,get=3,get=4,getall
13789 Matched, but too many substrings
13790  0: c
13791  1: <unset>
13792 Get substring 1 failed (-55): requested value is not set
13793 Get substring 2 failed (-54): requested value is not available
13794 Get substring 3 failed (-54): requested value is not available
13795 Get substring 4 failed (-49): unknown substring
13796  0L c
13797  1L 
13798
13799 /x(?=ab\K)/
13800     xab\=get=0
13801 Start of matched string is beyond its end - displaying from end to start.
13802  0: ab
13803  0G  (0)
13804     xab\=copy=0
13805 Start of matched string is beyond its end - displaying from end to start.
13806  0: ab
13807  0C  (0)
13808     xab\=getall
13809 Start of matched string is beyond its end - displaying from end to start.
13810  0: ab
13811  0L 
13812
13813 /(?<A>a)|(?<A>b)/dupnames
13814     a\=ovector=1,copy=A,get=A,get=2
13815 Matched, but too many substrings
13816  0: a
13817 Copy substring 'A' failed (-54): requested value is not available
13818 Get substring 2 failed (-54): requested value is not available
13819 Get substring 'A' failed (-54): requested value is not available
13820     a\=ovector=2,copy=A,get=A,get=2
13821  0: a
13822  1: a
13823   C a (1) A (non-unique)
13824 Get substring 2 failed (-54): requested value is not available
13825   G a (1) A (non-unique)
13826     b\=ovector=2,copy=A,get=A,get=2
13827 Matched, but too many substrings
13828  0: b
13829  1: <unset>
13830 Copy substring 'A' failed (-55): requested value is not set
13831 Get substring 2 failed (-54): requested value is not available
13832 Get substring 'A' failed (-55): requested value is not set
13833
13834 /a(b)c(d)/
13835     abc\=ph,copy=0,copy=1,getall
13836 Partial match: abc
13837  0C abc (3)
13838 Copy substring 1 failed (-2): partial match
13839 get substring list failed (-2): partial match
13840
13841 /^abc/info
13842 Capturing subpattern count = 0
13843 Compile options: <none>
13844 Overall options: anchored
13845 First code unit = 'a'
13846 Subject length lower bound = 3
13847
13848 /^abc/info,no_dotstar_anchor
13849 Capturing subpattern count = 0
13850 Compile options: no_dotstar_anchor
13851 Overall options: anchored no_dotstar_anchor
13852 First code unit = 'a'
13853 Subject length lower bound = 3
13854
13855 /.*\d/info,auto_callout
13856 Capturing subpattern count = 0
13857 Options: auto_callout
13858 First code unit at start or follows newline
13859 Subject length lower bound = 1
13860 \= Expect no match
13861     aaa
13862 --->aaa
13863  +0 ^       .*
13864  +2 ^  ^    \d
13865  +2 ^ ^     \d
13866  +2 ^^      \d
13867  +2 ^       \d
13868 No match
13869
13870 /.*\d/info,no_dotstar_anchor,auto_callout
13871 Capturing subpattern count = 0
13872 Options: auto_callout no_dotstar_anchor
13873 Subject length lower bound = 1
13874 \= Expect no match
13875     aaa
13876 --->aaa
13877  +0 ^       .*
13878  +2 ^  ^    \d
13879  +2 ^ ^     \d
13880  +2 ^^      \d
13881  +2 ^       \d
13882  +0  ^      .*
13883  +2  ^ ^    \d
13884  +2  ^^     \d
13885  +2  ^      \d
13886  +0   ^     .*
13887  +2   ^^    \d
13888  +2   ^     \d
13889 No match
13890
13891 /.*\d/dotall,info
13892 Capturing subpattern count = 0
13893 Compile options: dotall
13894 Overall options: anchored dotall
13895 Subject length lower bound = 1
13896
13897 /.*\d/dotall,no_dotstar_anchor,info
13898 Capturing subpattern count = 0
13899 Options: dotall no_dotstar_anchor
13900 Subject length lower bound = 1
13901
13902 /(*NO_DOTSTAR_ANCHOR)(?s).*\d/info
13903 Capturing subpattern count = 0
13904 Compile options: <none>
13905 Overall options: no_dotstar_anchor
13906 Subject length lower bound = 1
13907
13908 '^(?:(a)|b)(?(1)A|B)'
13909     aA123\=ovector=1
13910 Matched, but too many substrings
13911  0: aA
13912     aA123\=ovector=2
13913  0: aA
13914  1: a
13915
13916 '^(?:(?<AA>a)|b)(?(<AA>)A|B)'
13917     aA123\=ovector=1
13918 Matched, but too many substrings
13919  0: aA
13920     aA123\=ovector=2
13921  0: aA
13922  1: a
13923
13924 '^(?<AA>)(?:(?<AA>a)|b)(?(<AA>)A|B)'dupnames
13925     aA123\=ovector=1
13926 Matched, but too many substrings
13927  0: aA
13928     aA123\=ovector=2
13929 Matched, but too many substrings
13930  0: aA
13931  1: 
13932     aA123\=ovector=3
13933  0: aA
13934  1: 
13935  2: a
13936
13937 '^(?:(?<AA>X)|)(?:(?<AA>a)|b)\k{AA}'dupnames
13938     aa123\=ovector=1
13939 Matched, but too many substrings
13940  0: aa
13941     aa123\=ovector=2
13942 Matched, but too many substrings
13943  0: aa
13944  1: <unset>
13945     aa123\=ovector=3
13946  0: aa
13947  1: <unset>
13948  2: a
13949
13950 /(?<N111>(?J)(?<N111>1(111111)11|)1|1|)(?(<N111>)1)/
13951
13952 /(?<N>(?J)(?<N>))(?-J)\k<N>/
13953
13954 # Quantifiers are not allowed on condition assertions, but are otherwise
13955 # OK in conditions.
13956
13957 /(?(?=0)?)+/
13958 Failed: error 109 at offset 7: quantifier does not follow a repeatable item
13959
13960 /(?(?=0)(?=00)?00765)/
13961      00765
13962  0: 00765
13963
13964 /(?(?=0)(?=00)?00765|(?!3).56)/
13965      00765
13966  0: 00765
13967      456
13968  0: 456
13969 \= Expect no match
13970      356
13971 No match
13972
13973 '^(a)*+(\w)'
13974     g
13975  0: g
13976  1: <unset>
13977  2: g
13978     g\=ovector=1
13979 Matched, but too many substrings
13980  0: g
13981
13982 '^(?:a)*+(\w)'
13983     g
13984  0: g
13985  1: g
13986     g\=ovector=1
13987 Matched, but too many substrings
13988  0: g
13989
13990 # These two pattern showeds up compile-time bugs
13991
13992 "((?2){0,1999}())?"
13993
13994 /((?+1)(\1))/B
13995 ------------------------------------------------------------------
13996         Bra
13997         Once
13998         CBra 1
13999         Recurse
14000         CBra 2
14001         \1
14002         Ket
14003         Ket
14004         Ket
14005         Ket
14006         End
14007 ------------------------------------------------------------------
14008
14009 # Callouts with string arguments
14010
14011 /a(?C"/
14012 Failed: error 181 at offset 4: missing terminating delimiter for callout with string argument
14013
14014 /a(?C"a/
14015 Failed: error 181 at offset 4: missing terminating delimiter for callout with string argument
14016
14017 /a(?C"a"/
14018 Failed: error 139 at offset 7: closing parenthesis for (?C expected
14019
14020 /a(?C"a"bcde(?C"b")xyz/
14021 Failed: error 139 at offset 7: closing parenthesis for (?C expected
14022
14023 /a(?C"a)b""c")/B
14024 ------------------------------------------------------------------
14025         Bra
14026         a
14027         CalloutStr "a)b"c" 5 13 0
14028         Ket
14029         End
14030 ------------------------------------------------------------------
14031
14032 /ab(?C" any text with spaces ")cde/B
14033 ------------------------------------------------------------------
14034         Bra
14035         ab
14036         CalloutStr " any text with spaces " 6 30 1
14037         cde
14038         Ket
14039         End
14040 ------------------------------------------------------------------
14041     abcde
14042 Callout (6): " any text with spaces "
14043 --->abcde
14044     ^ ^       c
14045  0: abcde
14046     12abcde
14047 Callout (6): " any text with spaces "
14048 --->12abcde
14049       ^ ^       c
14050  0: abcde
14051
14052 /^a(b)c(?C1)def/
14053       abcdef
14054 --->abcdef
14055   1 ^  ^       d
14056  0: abcdef
14057  1: b
14058
14059 /^a(b)c(?C"AB")def/
14060       abcdef
14061 Callout (10): "AB"
14062 --->abcdef
14063     ^  ^       d
14064  0: abcdef
14065  1: b
14066
14067 /^a(b)c(?C1)def/
14068       abcdef\=callout_capture
14069 Callout 1: last capture = 1
14070  1: b
14071 --->abcdef
14072     ^  ^       d
14073  0: abcdef
14074  1: b
14075
14076 /^a(b)c(?C{AB})def/B
14077 ------------------------------------------------------------------
14078         Bra
14079         ^
14080         a
14081         CBra 1
14082         b
14083         Ket
14084         c
14085         CalloutStr {AB} 10 14 1
14086         def
14087         Ket
14088         End
14089 ------------------------------------------------------------------
14090       abcdef\=callout_capture
14091 Callout (10): {AB} last capture = 1
14092  1: b
14093 --->abcdef
14094     ^  ^       d
14095  0: abcdef
14096  1: b
14097
14098 /(?C`a``b`)(?C'a''b')(?C"a""b")(?C^a^^b^)(?C%a%%b%)(?C#a##b#)(?C$a$$b$)(?C{a}}b})/B,callout_info
14099 ------------------------------------------------------------------
14100         Bra
14101         CalloutStr `a`b` 4 10 0
14102         CalloutStr 'a'b' 14 20 0
14103         CalloutStr "a"b" 24 30 0
14104         CalloutStr ^a^b^ 34 40 0
14105         CalloutStr %a%b% 44 50 0
14106         CalloutStr #a#b# 54 60 0
14107         CalloutStr $a$b$ 64 70 0
14108         CalloutStr {a}b} 74 80 0
14109         Ket
14110         End
14111 ------------------------------------------------------------------
14112 Callout `a`b`  (
14113 Callout 'a'b'  (
14114 Callout "a"b"  (
14115 Callout ^a^b^  (
14116 Callout %a%b%  (
14117 Callout #a#b#  (
14118 Callout $a$b$  (
14119 Callout {a}b}  
14120
14121 /(?:a(?C`code`)){3}/B
14122 ------------------------------------------------------------------
14123         Bra
14124         Bra
14125         a
14126         CalloutStr `code` 8 14 4
14127         Ket
14128         Bra
14129         a
14130         CalloutStr `code` 8 14 4
14131         Ket
14132         Bra
14133         a
14134         CalloutStr `code` 8 14 4
14135         Ket
14136         Ket
14137         End
14138 ------------------------------------------------------------------
14139
14140 /^(?(?C25)(?=abc)abcd|xyz)/B,callout_info
14141 ------------------------------------------------------------------
14142         Bra
14143         ^
14144         Cond
14145         Callout 25 9 3
14146         Assert
14147         abc
14148         Ket
14149         abcd
14150         Alt
14151         xyz
14152         Ket
14153         Ket
14154         End
14155 ------------------------------------------------------------------
14156 Callout 25  (?=
14157     abcdefg
14158 --->abcdefg
14159  25 ^           (?=
14160  0: abcd
14161     xyz123
14162 --->xyz123
14163  25 ^          (?=
14164  0: xyz
14165
14166 /^(?(?C$abc$)(?=abc)abcd|xyz)/B
14167 ------------------------------------------------------------------
14168         Bra
14169         ^
14170         Cond
14171         CalloutStr $abc$ 7 12 3
14172         Assert
14173         abc
14174         Ket
14175         abcd
14176         Alt
14177         xyz
14178         Ket
14179         Ket
14180         End
14181 ------------------------------------------------------------------
14182     abcdefg
14183 Callout (7): $abc$
14184 --->abcdefg
14185     ^           (?=
14186  0: abcd
14187     xyz123
14188 Callout (7): $abc$
14189 --->xyz123
14190     ^          (?=
14191  0: xyz
14192
14193 /^ab(?C'first')cd(?C"second")ef/
14194     abcdefg
14195 Callout (7): 'first'
14196 --->abcdefg
14197     ^ ^         c
14198 Callout (20): "second"
14199 --->abcdefg
14200     ^   ^       e
14201  0: abcdef
14202
14203 /(?:a(?C`code`)){3}X/
14204     aaaXY
14205 Callout (8): `code`
14206 --->aaaXY
14207     ^^        ){3}
14208 Callout (8): `code`
14209 --->aaaXY
14210     ^ ^       ){3}
14211 Callout (8): `code`
14212 --->aaaXY
14213     ^  ^      ){3}
14214  0: aaaX
14215
14216 # Binary zero in callout string
14217 #  a  (  ?  C  '  x     z  '  )  b
14218 / 61 28 3f 43 27 78 00 7a 27 29 62/hex,callout_info
14219 Callout 'x\x00z'  b
14220     abcdefgh
14221 Callout (5): 'x\x00z'
14222 --->abcdefgh
14223     ^^           b
14224  0: ab
14225
14226 /(?(?!)^)/
14227
14228 /(?(?!)a|b)/
14229     bbb
14230  0: b
14231 \= Expect no match
14232     aaa
14233 No match
14234
14235 # JIT gives a different error message for the infinite recursion
14236
14237 "(*NO_JIT)((?2)+)((?1)){"
14238     abcd{
14239 Failed: error -52: nested recursion at the same subject position
14240
14241 # Perl fails to diagnose the absence of an assertion
14242
14243 "(?(?<E>.*!.*)?)"
14244 Failed: error 128 at offset 2: assertion expected after (?( or (?(?C)
14245
14246 "X((?2)()*+){2}+"B
14247 ------------------------------------------------------------------
14248         Bra
14249         X
14250         Once
14251         CBra 1
14252         Recurse
14253         Braposzero
14254         SCBraPos 2
14255         KetRpos
14256         Ket
14257         CBra 1
14258         Recurse
14259         Braposzero
14260         SCBraPos 2
14261         KetRpos
14262         Ket
14263         Ket
14264         Ket
14265         End
14266 ------------------------------------------------------------------
14267
14268 "X((?2)()*+){2}"B
14269 ------------------------------------------------------------------
14270         Bra
14271         X
14272         CBra 1
14273         Recurse
14274         Braposzero
14275         SCBraPos 2
14276         KetRpos
14277         Ket
14278         CBra 1
14279         Recurse
14280         Braposzero
14281         SCBraPos 2
14282         KetRpos
14283         Ket
14284         Ket
14285         End
14286 ------------------------------------------------------------------
14287
14288 /(?<=\bABQ(3(?-7)))/
14289 Failed: error 115 at offset 15: reference to non-existent subpattern
14290
14291 /(?<=\bABQ(3(?+7)))/
14292 Failed: error 115 at offset 15: reference to non-existent subpattern
14293
14294 ";(?<=()((?3))((?2)))"
14295 Failed: error 125 at offset 1: lookbehind assertion is not fixed length
14296
14297 # Perl loops on this (PCRE2 used to!)
14298
14299 /(?<=\Ka)/g,aftertext
14300     aaaaa
14301  0: a
14302  0+ aaaa
14303  0: a
14304  0+ aaa
14305  0: a
14306  0+ aa
14307  0: a
14308  0+ a
14309  0: a
14310  0+ 
14311
14312 /(?<=\Ka)/altglobal,aftertext
14313     aaaaa
14314  0: a
14315  0+ aaaa
14316  0: a
14317  0+ aaa
14318  0: a
14319  0+ aa
14320  0: a
14321  0+ a
14322  0: a
14323  0+ 
14324
14325 /((?2){73}(?2))((?1))/info
14326 Capturing subpattern count = 2
14327 May match empty string
14328 Subject length lower bound = 0
14329
14330 /abc/
14331 \= Expect no match
14332     \[9x!xxx(]{9999}
14333 No match
14334
14335 /(abc)*/
14336     \[abc]{5}
14337  0: abcabcabcabcabc
14338  1: abc
14339
14340 /^/gm
14341     \n\n\n
14342  0: 
14343  0: 
14344  0: 
14345
14346 /^/gm,alt_circumflex
14347     \n\n\n
14348  0: 
14349  0: 
14350  0: 
14351  0: 
14352
14353 /((((((((x))))))))\81/
14354 Failed: error 115 at offset 19: reference to non-existent subpattern
14355     xx1
14356
14357 /((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((x))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))\80/
14358     xx
14359 Matched, but too many substrings
14360  0: xx
14361  1: x
14362  2: x
14363  3: x
14364  4: x
14365  5: x
14366  6: x
14367  7: x
14368  8: x
14369  9: x
14370 10: x
14371 11: x
14372 12: x
14373 13: x
14374 14: x
14375
14376 /\80/
14377 Failed: error 115 at offset 2: reference to non-existent subpattern
14378
14379 /A\8B\9C/
14380 Failed: error 115 at offset 2: reference to non-existent subpattern
14381     A8B9C
14382
14383 /(?x:((?'a')) # comment (with parentheses) and | vertical
14384 (?-x:#not a comment (?'b')) # this is a comment ()
14385 (?'c')) # not a comment (?'d')/info
14386 Capturing subpattern count = 5
14387 Named capturing subpatterns:
14388   a   2
14389   b   3
14390   c   4
14391   d   5
14392 First code unit = '#'
14393 Last code unit = ' '
14394 Subject length lower bound = 32
14395
14396 /(?|(?'a')(2)(?'b')|(?'a')(?'a')(3))/I,dupnames
14397 Capturing subpattern count = 3
14398 Named capturing subpatterns:
14399   a   1
14400   a   2
14401   b   3
14402 Options: dupnames
14403 Starting code units: 2 3 
14404 Subject length lower bound = 1
14405     A23B
14406  0: 2
14407  1: 
14408  2: 2
14409  3: 
14410     B32A
14411  0: 3
14412  1: 
14413  2: 
14414  3: 3
14415
14416 # These are some patterns that used to cause buffer overflows or other errors
14417 # while compiling.
14418
14419 /.((?2)(?R)|\1|$)()/B
14420 ------------------------------------------------------------------
14421         Bra
14422         Any
14423         Once
14424         CBra 1
14425         Recurse
14426         Recurse
14427         Alt
14428         \1
14429         Alt
14430         $
14431         Ket
14432         Ket
14433         CBra 2
14434         Ket
14435         Ket
14436         End
14437 ------------------------------------------------------------------
14438
14439 /.((?3)(?R)()(?2)|\1|$)()/B
14440 ------------------------------------------------------------------
14441         Bra
14442         Any
14443         Once
14444         CBra 1
14445         Recurse
14446         Recurse
14447         CBra 2
14448         Ket
14449         Recurse
14450         Alt
14451         \1
14452         Alt
14453         $
14454         Ket
14455         Ket
14456         CBra 3
14457         Ket
14458         Ket
14459         End
14460 ------------------------------------------------------------------
14461
14462 /(\9*+(?2);\3++()2|)++{/
14463 Failed: error 115 at offset 2: reference to non-existent subpattern
14464
14465 /\V\x85\9*+((?2)\3++()2)*:2/
14466 Failed: error 115 at offset 7: reference to non-existent subpattern
14467
14468 /(((?(R)){0,2}) (?'x'((?'R')((?'R')))))/dupnames
14469
14470 /(((?(X)){0,2}) (?'x'((?'X')((?'X')))))/dupnames
14471
14472 /(((?(R)){0,2}) (?'x'((?'X')((?'R')))))/
14473
14474 "(?J)(?'d'(?'d'\g{d}))"
14475
14476 "(?=!((?2)(?))({8(?<=(?1){29}8bbbb\x16\xd\xc6^($(\xa9H4){4}h}?1)B))\x15')"
14477 Failed: error 125 at offset 16: lookbehind assertion is not fixed length
14478
14479 /A(?'')Z/
14480 Failed: error 162 at offset 4: subpattern name expected
14481
14482 "(?J:(?|(?'R')(\k'R')|((?'R'))))"
14483
14484 /(?<=|(\,\$(?73591620449005828816)\xa8.{7}){6}\x09)/
14485 Failed: error 161 at offset 17: group number is too big
14486
14487 /^(?:(?(1)x|)+)+$()/B
14488 ------------------------------------------------------------------
14489         Bra
14490         ^
14491         SBra
14492         SCond
14493       1 Cond ref
14494         x
14495         Alt
14496         KetRmax
14497         KetRmax
14498         $
14499         CBra 1
14500         Ket
14501         Ket
14502         End
14503 ------------------------------------------------------------------
14504
14505 /[[:>:]](?<)/
14506 Failed: error 162 at offset 10: subpattern name expected
14507
14508 /((?x)(*:0))#(?'/
14509 Failed: error 162 at offset 15: subpattern name expected
14510
14511 /(?C$[$)(?<]/
14512 Failed: error 162 at offset 10: subpattern name expected
14513
14514 /(?C$)$)(?<]/
14515 Failed: error 162 at offset 10: subpattern name expected
14516
14517 /(?(R))*+/B
14518 ------------------------------------------------------------------
14519         Bra
14520         Braposzero
14521         SBraPos
14522         SCond
14523         Cond recurse any
14524         Ket
14525         KetRpos
14526         Ket
14527         End
14528 ------------------------------------------------------------------
14529     abcd
14530  0: 
14531
14532 /((?x)(?#))#(?'/
14533 Failed: error 162 at offset 14: subpattern name expected
14534
14535 /((?x)(?#))#(?'abc')/I
14536 Capturing subpattern count = 2
14537 Named capturing subpatterns:
14538   abc   2
14539 First code unit = '#'
14540 Subject length lower bound = 1
14541
14542 /[[:\\](?<[::]/
14543 Failed: error 162 at offset 9: subpattern name expected
14544
14545 /[[:\\](?'abc')[a:]/I
14546 Capturing subpattern count = 1
14547 Named capturing subpatterns:
14548   abc   1
14549 Starting code units: : [ \ 
14550 Subject length lower bound = 2
14551
14552 "[[[.\xe8Nq\xffq\xff\xe0\x2|||::Nq\xffq\xff\xe0\x6\x2|||::[[[:[::::::[[[[[::::::::[:[[[:[:::[[[[[[[[[[[[:::::::::::::::::[[.\xe8Nq\xffq\xff\xe0\x2|||::Nq\xffq\xff\xe0\x6\x2|||::[[[:[::::::[[[[[::::::::[:[[[:[:::[[[[[[[[[[[[[[:::E[[[:[:[[:[:::[[:::E[[[:[:[[:'[:::::E[[[:[::::::[[[:[[[[[[[::E[[[:[::::::[[[:[[[[[[[[:[[::[::::[[:::::::[[:[[[[[[[:[[::[:[[:[~"
14553 Failed: error 106 at offset 353: missing terminating ] for character class
14554
14555 /()(?(R)0)*+/B
14556 ------------------------------------------------------------------
14557         Bra
14558         CBra 1
14559         Ket
14560         Braposzero
14561         SBraPos
14562         SCond
14563         Cond recurse any
14564         0
14565         Ket
14566         KetRpos
14567         Ket
14568         End
14569 ------------------------------------------------------------------
14570
14571 /(?R-:(?</
14572 Failed: error 158 at offset 3: (?R (recursive pattern call) must be followed by a closing parenthesis
14573
14574 /(?R-:(?<)/
14575 Failed: error 158 at offset 3: (?R (recursive pattern call) must be followed by a closing parenthesis
14576
14577 /(?(?C{\Q})(?!(?'/
14578 Failed: error 162 at offset 16: subpattern name expected
14579
14580 /(?(?C{\Q})(?!(?'abc')))/I
14581 Capturing subpattern count = 1
14582 Named capturing subpatterns:
14583   abc   1
14584 May match empty string
14585 Subject length lower bound = 0
14586
14587 /(?1){3918}(((((0(\k'R'))))(?J)(?'R'(?'R'\3){99})))/I
14588 Capturing subpattern count = 8
14589 Max back reference = 8
14590 Named capturing subpatterns:
14591   R   7
14592   R   8
14593 Duplicate name status changes
14594 Last code unit = '0'
14595 Subject length lower bound = 65535
14596
14597 /(?|(aaa)|(b))\g{1}/I
14598 Capturing subpattern count = 1
14599 Max back reference = 1
14600 Starting code units: a b 
14601 Subject length lower bound = 0
14602
14603 /(?|(aaa)|(b))(?1)/I
14604 Capturing subpattern count = 1
14605 Starting code units: a b 
14606 Subject length lower bound = 4
14607
14608 /(?|(aaa)|(b))/I
14609 Capturing subpattern count = 1
14610 Starting code units: a b 
14611 Subject length lower bound = 1
14612
14613 /(?|(?'a'aaa)|(?'a'b))\k'a'/I
14614 Capturing subpattern count = 1
14615 Max back reference = 1
14616 Named capturing subpatterns:
14617   a   1
14618 Starting code units: a b 
14619 Subject length lower bound = 0
14620
14621 /(?|(?'a'aaa)|(?'a'b))(?'a'cccc)\k'a'/I,dupnames
14622 Capturing subpattern count = 2
14623 Max back reference = 2
14624 Named capturing subpatterns:
14625   a   1
14626   a   2
14627 Options: dupnames
14628 Starting code units: a b 
14629 Last code unit = 'c'
14630 Subject length lower bound = 0
14631
14632 /ab{3cd/
14633     ab{3cd
14634  0: ab{3cd
14635
14636 /ab{3,cd/
14637     ab{3,cd
14638  0: ab{3,cd
14639
14640 /ab{3,4a}cd/
14641     ab{3,4a}cd
14642  0: ab{3,4a}cd
14643
14644 /{4,5a}bc/
14645     {4,5a}bc
14646  0: {4,5a}bc
14647
14648 /\x0{ab}/
14649     \0{ab}
14650  0: \x00{ab}
14651
14652 /^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/
14653     ababababbbabZXXXX
14654  0: ababababbbabZ
14655  1: ab
14656  2: b
14657
14658 /.*?a(*PRUNE)b/
14659     aab
14660  0: ab
14661
14662 /.*?a(*PRUNE)b/s
14663     aab
14664  0: ab
14665
14666 /^a(*PRUNE)b/s
14667 \= Expect no match
14668     aab
14669 No match
14670
14671 /.*?a(*SKIP)b/
14672     aab
14673  0: ab
14674
14675 /(?(8000000000/
14676 Failed: error 161 at offset 8: group number is too big
14677
14678 /((?(R8000000000)))/
14679 Failed: error 161 at offset 9: group number is too big
14680
14681 /0(?0)|(1)(*THEN)(*SKIP:0)(*FAIL)/
14682 \= Expect no match
14683     01
14684 No match
14685
14686 /(?(1)()\983040\2)/
14687 Failed: error 161 at offset 14: group number is too big
14688
14689 /(*LIMIT_MATCH=)abc/
14690 Failed: error 160 at offset 14: (*VERB) not recognized or malformed
14691
14692 /(*CRLF)(*LIMIT_MATCH=)abc/
14693 Failed: error 160 at offset 21: (*VERB) not recognized or malformed
14694
14695 /(?:ab)?(?:ab)(?:ab)/
14696     abab
14697  0: abab
14698     ababab
14699  0: ababab
14700 \= Expect no match
14701     aba
14702 No match
14703
14704 /((*MARK:A))++a(*SKIP:B)b/
14705 \= Expect no match
14706     aacb
14707 No match
14708
14709 /(*MARK:a\zb)z/alt_verbnames
14710 Failed: error 140 at offset 10: invalid escape sequence in (*VERB) name
14711
14712 /(*:ab\t(d\)c)xxx/
14713 Failed: error 122 at offset 12: unmatched closing parenthesis
14714
14715 /(*:ab\t(d\)c)xxx/alt_verbnames,mark
14716     cxxxz
14717  0: xxx
14718 MK: ab\x09(d)c
14719
14720 /(*:A\Qxx)x\EB)x/alt_verbnames,mark
14721     x
14722  0: x
14723 MK: Axx)xB
14724
14725 /(*:A\ExxxB)x/alt_verbnames,mark
14726     x
14727  0: x
14728 MK: AxxxB
14729
14730 /(*: A \ and #comment
14731      \ B)x/x,alt_verbnames,mark
14732     x
14733  0: x
14734 MK: A and B
14735
14736 /(*: A \ and #comment
14737      \ B)x/alt_verbnames,mark
14738     x
14739  0: x
14740 MK:  A  and #comment\x0a      B
14741
14742 /(*: A \ and #comment
14743      \ B)x/x,mark
14744     x
14745  0: x
14746 MK:  A \ and #comment\x0a     \ B
14747
14748 /(*: A \ and #comment
14749      \ B)x/mark
14750     x
14751  0: x
14752 MK:  A \ and #comment\x0a     \ B
14753
14754 /(*:A
14755 B)x/alt_verbnames,mark
14756     x
14757  0: x
14758 MK: A\x0aB
14759
14760 /(*:abc\Qpqr)/alt_verbnames
14761 Failed: error 160 at offset 12: (*VERB) not recognized or malformed
14762
14763 /abc/use_offset_limit
14764     1234abcde\=offset_limit=100
14765  0: abc
14766     1234abcde\=offset_limit=9
14767  0: abc
14768     1234abcde\=offset_limit=4
14769  0: abc
14770     1234abcde\=offset_limit=4,offset=4
14771  0: abc
14772 \= Expect no match
14773     1234abcde\=offset_limit=4,offset=5
14774 No match
14775     1234abcde\=offset_limit=3
14776 No match
14777
14778 /(?<=abc)/use_offset_limit
14779     1234abc\=offset_limit=7
14780  0: 
14781 \= Expect no match
14782     1234abc\=offset_limit=6
14783 No match
14784
14785 /A/g,replace=-,use_offset_limit
14786     XAXAXAXAXA\=offset_limit=4
14787  2: X-X-XAXAXA
14788
14789 /abc/
14790 \= Expect error
14791     1234abcde\=offset_limit=4
14792 Failed: error -56: offset limit set without PCRE2_USE_OFFSET_LIMIT
14793
14794 /^\w/m,use_offset_limit
14795     \n..\naa\=offset_limit=3
14796 No match
14797     \n..\naa\=offset_limit=4
14798  0: a
14799
14800 /abcd/null_context
14801     abcd\=null_context
14802  0: abcd
14803 \= Expect error
14804     abcd\=null_context,find_limits
14805 ** Not allowed together: find_limits null_context
14806     abcd\=allusedtext,startchar
14807 ** Not allowed together: allusedtext startchar
14808
14809 /abcd/replace=w\rx\x82y\o{333}z(\Q12\$34$$\x34\E5$$),substitute_extended
14810     abcd
14811  1: w\x0dx\x82y\xdbz(12\$34$$\x345$)
14812
14813 /a(bc)(DE)/replace=a\u$1\U$1\E$1\l$2\L$2\Eab\Uab\LYZ\EDone,substitute_extended
14814     abcDE
14815  1: aBcBCbcdEdeabAByzDone
14816
14817 /abcd/replace=xy\kz,substitute_extended
14818     abcd
14819 Failed: error -57 at offset 4 in replacement: bad escape sequence in replacement string
14820
14821 /a(?:(b)|(c))/substitute_extended,replace=X${1:+1:-1}X${2:+2:-2}
14822     ab
14823  1: X1X-2
14824     ac
14825  1: X-1X2
14826     ab\=replace=${1:+$1\:$1:$2}
14827  1: b:b
14828     ac\=replace=${1:+$1\:$1:$2}
14829  1: c
14830
14831 /a(?:(b)|(c))/substitute_extended,replace=X${1:-1:-1}X${2:-2:-2}
14832     ab
14833  1: XbX2:-2
14834     ac
14835  1: X1:-1Xc
14836
14837 /(a)/substitute_extended,replace=>${1:+\Q$1:{}$$\E+\U$1}<
14838     a
14839  1: >$1:{}$$+A<
14840
14841 /X(b)Y/substitute_extended
14842     XbY\=replace=x${1:+$1\U$1}y
14843  1: xbBY
14844     XbY\=replace=\Ux${1:+$1$1}y
14845  1: XBBY
14846
14847 /a/substitute_extended,replace=${*MARK:+a:b}
14848     a
14849 Failed: error -58 at offset 7 in replacement: expected closing curly bracket in replacement string
14850
14851 /(abcd)/replace=${1:+xy\kz},substitute_extended
14852     abcd
14853 Failed: error -57 at offset 8 in replacement: bad escape sequence in replacement string
14854
14855 /(abcd)/
14856     abcd\=replace=${1:+xy\kz},substitute_extended
14857 Failed: error -57 at offset 8 in replacement: bad escape sequence in replacement string
14858
14859 /abcd/substitute_extended,replace=>$1<
14860     abcd
14861 Failed: error -49 at offset 3 in replacement: unknown substring
14862
14863 /abcd/substitute_extended,replace=>xxx${xyz}<<<
14864     abcd
14865 Failed: error -49 at offset 10 in replacement: unknown substring
14866
14867 /(?J)(?:(?<A>a)|(?<A>b))/replace=<$A>
14868     [a]
14869  1: [<a>]
14870     [b]
14871  1: [<b>]
14872 \= Expect error
14873     (a)\=ovector=1
14874 Failed: error -54 at offset 3 in replacement: requested value is not available
14875
14876 /(a)|(b)/replace=<$1>
14877 \= Expect error
14878     b
14879 Failed: error -55 at offset 3 in replacement: requested value is not set
14880
14881 /(aa)(BB)/substitute_extended,replace=\U$1\L$2\E$1..\U$1\l$2$1
14882     aaBB
14883  1: AAbbaa..AAbBaa
14884
14885 /^(o(\1{72}{\"{\\{00000059079}\d*){74}}){19}/I
14886 Capturing subpattern count = 2
14887 Max back reference = 1
14888 Compile options: <none>
14889 Overall options: anchored
14890 First code unit = 'o'
14891 Last code unit = '}'
14892 Subject length lower bound = 65535
14893
14894 /((p(?'K/
14895 Failed: error 142 at offset 7: syntax error in subpattern name (missing terminator)
14896
14897 /((p(?'K/no_auto_capture
14898 Failed: error 142 at offset 7: syntax error in subpattern name (missing terminator)
14899
14900 /abc/replace=A$3123456789Z
14901     abc
14902 Failed: error -49 at offset 3 in replacement: unknown substring
14903
14904 /(?<!a{65535}a{5})x/I
14905 Failed: error 187 at offset 0: lookbehind assertion is too long
14906
14907 /(?<!a{65535})x/I
14908 Capturing subpattern count = 0
14909 Max lookbehind = 65535
14910 First code unit = 'x'
14911 Subject length lower bound = 1
14912
14913 /(?=a\K)/replace=z
14914     BaCaD
14915 Failed: error -60: match with end before start or start moved backwards is not supported
14916     
14917 /(?<=\K.)/g,replace=-
14918     ab
14919 Failed: error -60: match with end before start or start moved backwards is not supported
14920
14921 /(?'abcdefghijklmnopqrstuvwxyzABCDEFG'toolong)/
14922 Failed: error 148 at offset 36: subpattern name is too long (maximum 32 characters)
14923
14924 /(?'abcdefghijklmnopqrstuvwxyzABCDEF'justright)/
14925
14926 # These two use zero-termination
14927 /abcd/max_pattern_length=3
14928 Failed: error 188 at offset 0: pattern string is longer than the limit set by the application
14929
14930 /abc/max_pattern_length=3
14931
14932 # These two, being hex, pass the length
14933 /abcdefab/hex,max_pattern_length=3
14934 Failed: error 188 at offset 0: pattern string is longer than the limit set by the application
14935
14936 /abcdef/hex,max_pattern_length=3
14937
14938 # These patterns used to take a long time to compile
14939
14940 "(.*)
14941 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
14942 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
14943 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))"xI
14944 Capturing subpattern count = 12
14945 May match empty string
14946 Options: extended
14947 First code unit at start or follows newline
14948 Subject length lower bound = 0
14949
14950 "(?<=a()
14951 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
14952 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
14953 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
14954 a)"xI
14955 Capturing subpattern count = 12
14956 Max lookbehind = 2
14957 May match empty string
14958 Options: extended
14959 Subject length lower bound = 0
14960
14961 "(?|()|())(.*)
14962 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
14963 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
14964 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))"xI
14965 Capturing subpattern count = 13
14966 May match empty string
14967 Options: extended
14968 Subject length lower bound = 0
14969
14970 "(?|()|())(?<=a()
14971 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
14972 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
14973 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
14974 a)"xI
14975 Failed: error 135 at offset 9: lookbehind is too complicated
14976
14977 # Test the use of malloc for caching group information when there are more
14978 # groups than fit into the on-stack workspace.
14979
14980 /\[()]{1024}/I,expand
14981 Expanded: ()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()
14982 Capturing subpattern count = 1024
14983 May match empty string
14984 Subject length lower bound = 0
14985
14986 # Test minlength capped at 65535
14987
14988 /(A{65000})\1{65000}/I
14989 Capturing subpattern count = 1
14990 Max back reference = 1
14991 First code unit = 'A'
14992 Last code unit = 'A'
14993 Subject length lower bound = 65535
14994
14995 # Test group scans when numbers are not unique
14996
14997 /(?|()+|(a)+)/BI
14998 ------------------------------------------------------------------
14999         Bra
15000         Bra
15001         SCBra 1
15002         KetRmax
15003         Alt
15004         CBra 1
15005         a
15006         KetRmax
15007         Ket
15008         Ket
15009         End
15010 ------------------------------------------------------------------
15011 Capturing subpattern count = 1
15012 May match empty string
15013 Subject length lower bound = 0
15014
15015 /(?|(a)+|()+)/BI
15016 ------------------------------------------------------------------
15017         Bra
15018         Bra
15019         CBra 1
15020         a
15021         KetRmax
15022         Alt
15023         SCBra 1
15024         KetRmax
15025         Ket
15026         Ket
15027         End
15028 ------------------------------------------------------------------
15029 Capturing subpattern count = 1
15030 May match empty string
15031 Subject length lower bound = 0
15032
15033 /(?|()|(a))/BI
15034 ------------------------------------------------------------------
15035         Bra
15036         Bra
15037         CBra 1
15038         Ket
15039         Alt
15040         CBra 1
15041         a
15042         Ket
15043         Ket
15044         Ket
15045         End
15046 ------------------------------------------------------------------
15047 Capturing subpattern count = 1
15048 May match empty string
15049 Subject length lower bound = 0
15050
15051 /(?|(a)|())/BI
15052 ------------------------------------------------------------------
15053         Bra
15054         Bra
15055         CBra 1
15056         a
15057         Ket
15058         Alt
15059         CBra 1
15060         Ket
15061         Ket
15062         Ket
15063         End
15064 ------------------------------------------------------------------
15065 Capturing subpattern count = 1
15066 May match empty string
15067 Subject length lower bound = 0
15068
15069 # Test CRLF handling in empty string substitutions
15070
15071 /^$/gm,newline=anycrlf,replace=-
15072     X\r\n\r\nY
15073  1: X\x0d\x0a-\x0d\x0aY
15074
15075 /^$/gm,newline=crlf,replace=-
15076     X\r\n\r\nY
15077  1: X\x0d\x0a-\x0d\x0aY
15078
15079 /^$/gm,newline=any,replace=-
15080     X\r\n\r\nY
15081  1: X\x0d\x0a-\x0d\x0aY
15082
15083 "(*ANYCRLF)(?m)^(.*[^0-9\r\n].*|)$"g,replace=NaN
15084     15\r\nfoo\r\n20\r\nbar\r\nbaz\r\n\r\n20
15085  4: 15\x0d\x0aNaN\x0d\x0a20\x0d\x0aNaN\x0d\x0aNaN\x0d\x0aNaN\x0d\x0a20
15086
15087 /a[[:punct:]b]/bincode
15088 ------------------------------------------------------------------
15089         Bra
15090         a
15091         [!-/:-@[-`b{-~]
15092         Ket
15093         End
15094 ------------------------------------------------------------------
15095
15096 /a[b[:punct:]]/bincode
15097 ------------------------------------------------------------------
15098         Bra
15099         a
15100         [!-/:-@[-`b{-~]
15101         Ket
15102         End
15103 ------------------------------------------------------------------
15104
15105 /L(?#(|++<!(2)?/B
15106 ------------------------------------------------------------------
15107         Bra
15108         L?+
15109         Ket
15110         End
15111 ------------------------------------------------------------------
15112
15113 /L(?#(|++<!(2)?/B,no_auto_possess
15114 ------------------------------------------------------------------
15115         Bra
15116         L?
15117         Ket
15118         End
15119 ------------------------------------------------------------------
15120
15121 /L(?#(|++<!(2)?/B,auto_callout
15122 ------------------------------------------------------------------
15123         Bra
15124         Callout 255 0 14
15125         L?+
15126         Callout 255 14 0
15127         Ket
15128         End
15129 ------------------------------------------------------------------
15130
15131 /L(?#(|++<!(2)?/B,no_auto_possess,auto_callout
15132 ------------------------------------------------------------------
15133         Bra
15134         Callout 255 0 14
15135         L?
15136         Callout 255 14 0
15137         Ket
15138         End
15139 ------------------------------------------------------------------
15140
15141 /(A*)\E+/B,auto_callout
15142 ------------------------------------------------------------------
15143         Bra
15144         Callout 255 0 1
15145         SCBra 1
15146         Callout 255 1 2
15147         A*
15148         Callout 255 3 4
15149         KetRmax
15150         Callout 255 7 0
15151         Ket
15152         End
15153 ------------------------------------------------------------------
15154
15155 /()\Q\E*]/B,auto_callout
15156 ------------------------------------------------------------------
15157         Bra
15158         Callout 255 0 1
15159         Brazero
15160         SCBra 1
15161         Callout 255 1 6
15162         KetRmax
15163         Callout 255 7 1
15164         ]
15165         Callout 255 8 0
15166         Ket
15167         End
15168 ------------------------------------------------------------------
15169     a[bc]d
15170 --->a[bc]d
15171  +0     ^      (
15172  +1     ^      )\Q\E*
15173  +7     ^      ]
15174  +8     ^^     End of pattern
15175  0: ]
15176  1: 
15177
15178 /\x8a+f|;T?(*:;.'?`(\xeap ){![^()!y*''C*(?';]{1;(\x08)/B,alt_verbnames,dupnames,extended
15179 ------------------------------------------------------------------
15180         Bra
15181         \x{8a}++
15182         f
15183         Alt
15184         ;
15185         T?
15186         *MARK ;.'?`(\x{ea}p
15187         {!
15188         [\x00- "-&+-:<->@-BD-xz-\xff] (neg)
15189         {1;
15190         CBra 1
15191         \x08
15192         Ket
15193         Ket
15194         End
15195 ------------------------------------------------------------------
15196
15197 # Tests for NULL characters in comments and verb "names" and callouts
15198
15199 # /A#B\x00C\x0aZ/
15200 /41 23 42 00 43 0a 5a/Bx,hex
15201 ------------------------------------------------------------------
15202         Bra
15203         AZ
15204         Ket
15205         End
15206 ------------------------------------------------------------------
15207
15208 # /A+#B\x00C\x0a+/
15209 /41 2b 23 42 00 43 0a 2b/Bx,hex
15210 ------------------------------------------------------------------
15211         Bra
15212         A++
15213         Ket
15214         End
15215 ------------------------------------------------------------------
15216
15217 # /A(*:B\x00W#X\00Y\x0aC)Z/
15218 /41 28 2a 3a 42 00 57 23 58 00 59 0a 43 29 5a/Bx,hex,alt_verbnames
15219 ------------------------------------------------------------------
15220         Bra
15221         A
15222         *MARK B\x{0}WC
15223         Z
15224         Ket
15225         End
15226 ------------------------------------------------------------------
15227
15228 # /A(*:B\x00W#X\00Y\x0aC)Z/
15229 /41 28 2a 3a 42 00 57 23 58 00 59 0a 43 29 5a/Bx,hex
15230 ------------------------------------------------------------------
15231         Bra
15232         A
15233         *MARK B\x{0}W#X\x{0}Y\x{a}C
15234         Z
15235         Ket
15236         End
15237 ------------------------------------------------------------------
15238
15239 # /A(?C{X\x00Y})B/
15240 /41 28 3f 43 7b 58 00 59 7d 29 42/B,hex
15241 ------------------------------------------------------------------
15242         Bra
15243         A
15244         CalloutStr {X\x{0}Y} 5 10 1
15245         B
15246         Ket
15247         End
15248 ------------------------------------------------------------------
15249
15250 # /A(?#X\x00Y)B/
15251 /41 28 3f 23 7b 00 7d 29 42/B,hex
15252 ------------------------------------------------------------------
15253         Bra
15254         AB
15255         Ket
15256         End
15257 ------------------------------------------------------------------
15258
15259 # Tests for leading comment in extended patterns
15260
15261 / (?-x):?/extended
15262
15263 /\v(?-x):?/extended
15264
15265 /0b 28 3f 2d 78 29 3a/hex,extended
15266
15267 /#comment
15268 (?-x):?/extended
15269
15270 /(8(*:6^\x09x\xa6l\)6!|\xd0:[^:|)\x09d\Z\d{85*m(?'(?<1!)*\W[*\xff]!!h\w]*\xbe;/alt_bsux,alt_verbnames,allow_empty_class,dollar_endonly,extended,multiline,never_utf,no_dotstar_anchor,no_start_optimize
15271 Failed: error 162 at offset 49: subpattern name expected
15272
15273 /a|(b)c/replace=>$1<,substitute_unset_empty
15274     cat
15275  1: c><t
15276     xbcom
15277  1: x>b<om
15278
15279 /a|(b)c/
15280     cat\=replace=>$1<
15281 Failed: error -55 at offset 3 in replacement: requested value is not set
15282     cat\=replace=>$1<,substitute_unset_empty
15283  1: c><t
15284     xbcom\=replace=>$1<,substitute_unset_empty
15285  1: x>b<om
15286
15287 /a|(b)c/substitute_extended
15288     cat\=replace=>${2:-xx}<
15289 Failed: error -49 at offset 9 in replacement: unknown substring
15290     cat\=replace=>${2:-xx}<,substitute_unknown_unset
15291  1: c>xx<t
15292     cat\=replace=>${X:-xx}<,substitute_unknown_unset
15293  1: c>xx<t
15294
15295 /a|(?'X'b)c/replace=>$X<,substitute_unset_empty
15296     cat
15297  1: c><t
15298     xbcom
15299  1: x>b<om
15300
15301 /a|(?'X'b)c/replace=>$Y<,substitute_unset_empty
15302     cat
15303 Failed: error -49 at offset 3 in replacement: unknown substring
15304     cat\=substitute_unknown_unset
15305  1: c><t
15306     cat\=substitute_unknown_unset,-substitute_unset_empty
15307 Failed: error -55 at offset 3 in replacement: requested value is not set
15308
15309 /a|(b)c/replace=>$2<,substitute_unset_empty
15310     cat
15311 Failed: error -49 at offset 3 in replacement: unknown substring
15312     cat\=substitute_unknown_unset
15313  1: c><t
15314     cat\=substitute_unknown_unset,-substitute_unset_empty
15315 Failed: error -55 at offset 3 in replacement: requested value is not set
15316
15317 /()()()/use_offset_limit
15318     \=ovector=11000000000
15319 ** Invalid value in 'ovector=11000000000'
15320     \=callout_fail=11000000000
15321 ** Invalid value in 'callout_fail=11000000000'
15322     \=callout_fail=1:11000000000
15323 ** Invalid value in 'callout_fail=1:11000000000'
15324     \=callout_data=11000000000
15325 ** Invalid value in 'callout_data=11000000000'
15326     \=callout_data=-11000000000
15327 ** Invalid value in 'callout_data=-11000000000'
15328     \=offset_limit=1100000000000000000000
15329 ** Invalid value in 'offset_limit=1100000000000000000000'
15330     \=copy=11000000000
15331 ** Invalid value in 'copy=11000000000'
15332
15333 /(*MARK:A\x00b)/mark
15334     abc
15335  0: 
15336 MK: A\x00b
15337
15338 /(*MARK:A\x00b)/mark,alt_verbnames
15339     abc
15340  0: 
15341 MK: A\x00b
15342
15343 /"(*MARK:A" 00 "b)"/mark,hex
15344     abc
15345  0: 
15346 MK: A\x00b
15347
15348 /"(*MARK:A" 00 "b)"/mark,hex,alt_verbnames
15349     abc
15350  0: 
15351 MK: A\x00b
15352
15353 /efg/hex
15354 ** Unexpected non-hex-digit 'g' at offset 2 in hex pattern: quote missing?
15355
15356 /eff/hex
15357 ** Odd number of digits in hex pattern
15358
15359 /effg/hex
15360 ** Unexpected non-hex-digit 'g' at offset 3 in hex pattern: quote missing?
15361
15362 /(?J)(?'a'))(?'a')/
15363 Failed: error 122 at offset 10: unmatched closing parenthesis
15364
15365 /(?<=((?C)0))/
15366     9010
15367 --->9010
15368   0  ^       0
15369   0   ^      0
15370  0: 
15371  1: 0
15372 \= Expect no match
15373     abc
15374 --->abc
15375   0  ^      0
15376   0   ^     0
15377   0    ^    0
15378 No match
15379
15380 /aaa/
15381 \[abc]{10000000000000000000000000000}
15382 ** Repeat count too large
15383 \[a]{3}
15384  0: aaa
15385
15386 /\[AB]{6000000000000000000000}/expand
15387 ** Pattern repeat count too large
15388
15389 # Hex uses pattern length, not zero-terminated. This tests for overrunning
15390 # the given length of a pattern.
15391
15392 /'(*U'/hex
15393 Failed: error 160 at offset 3: (*VERB) not recognized or malformed
15394
15395 /'(*'/hex
15396 Failed: error 109 at offset 1: quantifier does not follow a repeatable item
15397
15398 /'('/hex
15399 Failed: error 114 at offset 1: missing closing parenthesis
15400
15401 //hex
15402
15403 # These tests are here because Perl never allows a back reference in a
15404 # lookbehind. PCRE2 supports some limited cases.
15405
15406 /([ab])...(?<=\1)z/
15407     a11az
15408  0: a11az
15409  1: a
15410     b11bz
15411  0: b11bz
15412  1: b
15413 \= Expect no match
15414     b11az
15415 No match
15416
15417 /(?|([ab]))...(?<=\1)z/
15418 Failed: error 125 at offset 13: lookbehind assertion is not fixed length
15419
15420 /([ab])(\1)...(?<=\2)z/
15421     aa11az
15422  0: aa11az
15423  1: a
15424  2: a
15425
15426 /(a\2)(b\1)(?<=\2)/
15427 Failed: error 125 at offset 10: lookbehind assertion is not fixed length
15428
15429 /(?<A>[ab])...(?<=\k'A')z/
15430     a11az
15431  0: a11az
15432  1: a
15433     b11bz
15434  0: b11bz
15435  1: b
15436 \= Expect no match
15437     b11az
15438 No match
15439
15440 /(?<A>[ab])...(?<=\k'A')(?<A>)z/dupnames
15441 Failed: error 125 at offset 13: lookbehind assertion is not fixed length
15442
15443 # Perl does not support \g+n
15444
15445 /((\g+1X)?([ab]))+/
15446     aaXbbXa
15447  0: aaXbbXa
15448  1: bXa
15449  2: bX
15450  3: a
15451
15452 /ab(?C1)c/auto_callout
15453     abc
15454 --->abc
15455  +0 ^       a
15456  +1 ^^      b
15457   1 ^ ^     c
15458  +8 ^  ^    End of pattern
15459  0: abc
15460
15461 /'ab(?C1)c'/hex,auto_callout
15462     abc
15463 --->abc
15464  +0 ^       a
15465  +1 ^^      b
15466   1 ^ ^     c
15467  +8 ^  ^    End of pattern
15468  0: abc
15469
15470 # Perl accepts these, but gives a warning. We can't warn, so give an error.
15471
15472 /[a-[:digit:]]+/
15473 Failed: error 150 at offset 4: invalid range in character class
15474     a-a9-a
15475
15476 /[A-[:digit:]]+/
15477 Failed: error 150 at offset 4: invalid range in character class
15478     A-A9-A
15479
15480 /[a-\d]+/
15481 Failed: error 150 at offset 5: invalid range in character class
15482     a-a9-a
15483
15484 /(?<RA>abc)(?(R)xyz)/B
15485 ------------------------------------------------------------------
15486         Bra
15487         CBra 1
15488         abc
15489         Ket
15490         Cond
15491         Cond recurse any
15492         xyz
15493         Ket
15494         Ket
15495         End
15496 ------------------------------------------------------------------
15497
15498 /(?<R>abc)(?(R)xyz)/B
15499 ------------------------------------------------------------------
15500         Bra
15501         CBra 1
15502         abc
15503         Ket
15504         Cond
15505       1 Cond ref
15506         xyz
15507         Ket
15508         Ket
15509         End
15510 ------------------------------------------------------------------
15511
15512 /(?=.*[A-Z])/I
15513 Capturing subpattern count = 0
15514 May match empty string
15515 Subject length lower bound = 0
15516
15517 /()(?<=(?0))/
15518 Failed: error 125 at offset 2: lookbehind assertion is not fixed length
15519
15520 /(?<!|!(?<!))/
15521
15522 /(?<!|!|!||||||(?<!)||(?<!)!|!||(?<!)!|!(?<!)!|!|!|!||||!!|<!)!|!||||!|/
15523
15524 /{2,2{2,2/use_length
15525
15526 /.>*?\g'0/use_length
15527 Failed: error 157 at offset 6: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
15528
15529 /.>*?\g'0/
15530 Failed: error 157 at offset 6: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
15531
15532 /{\84Í\84ÍÍ\84Í{'{22{2{{2{'{22{\12{22{2{'{22{2{{2{{222{{2{'{22{2{22{2{'{22{2{{2{'{22{2{22{2{'{'{22{2{22{2{'{22{2{{2{'{22{2{22{2{'{222{2Ä\84Í\84ÍÍ\84Í{'{22{2{{2{'{22{\12{11{2{'{22{2{{2{{'{22{2{{2{'{22{\12{22{1{'{22{2{{2{{222{{2{'{22{2{22{2{'{/auto_callout
15533
15534 //
15535 \=get=i00000000000000000000000000000000
15536 ** Group name in 'get' is too long
15537 \=get=i2345678901234567890123456789012,get=i1245678901234567890123456789012
15538 ** Too many characters in named 'get' modifiers
15539
15540 "(?(?C))"
15541 Failed: error 128 at offset 6: assertion expected after (?( or (?(?C)
15542
15543 /(?(?(?(?(?(?))))))/
15544 Failed: error 128 at offset 2: assertion expected after (?( or (?(?C)
15545
15546 /(?<=(?1))((?s))/anchored
15547
15548 /(*:ab)*/
15549 Failed: error 109 at offset 6: quantifier does not follow a repeatable item
15550
15551 %(*:\1e(:\11(\1fsvvvvvvvvvv:]*[   Z!*;[]*[^[]*!^[\19+.+{{2,7}'      _\\\\\\\\\\\\\)?.:..    *w////\\\Q\\\\\\\\\\\\\\\T\\\\\+/?/////'+\\\EEE?/////'+/*+/[^K]?]//(w)%never_backslash_c,alt_verbnames,auto_callout
15552
15553 /./newline=crlf
15554     \=ph
15555 No match
15556
15557 /(\x0e00\000000\xc)/replace=\P,substitute_extended
15558     \x0e00\000000\xc
15559 Failed: error -57 at offset 2 in replacement: bad escape sequence in replacement string
15560
15561 //replace=0
15562     \=offset=7
15563 Failed: error -33: bad offset value
15564
15565 /(?<=\G.)/g,replace=+
15566     abc
15567  3: a+b+c+
15568
15569 ".+\QX\E+"B,no_auto_possess
15570 ------------------------------------------------------------------
15571         Bra
15572         Any+
15573         X+
15574         Ket
15575         End
15576 ------------------------------------------------------------------
15577
15578 ".+\QX\E+"B,auto_callout,no_auto_possess
15579 ------------------------------------------------------------------
15580         Bra
15581         Callout 255 0 4
15582         Any+
15583         Callout 255 4 4
15584         X+
15585         Callout 255 8 0
15586         Ket
15587         End
15588 ------------------------------------------------------------------
15589
15590 # This one is here because Perl gives an 'unmatched )' error which goes away
15591 # if one of the \) sequences is removed - which is weird. PCRE finds it too
15592 # complicated to find a minimum matching length.
15593
15594 "()X|((((((((()))))))((((())))))\2())((((((\2\2)))\2)(\22((((\2\2)2))\2)))(2\ZZZ)+:)Z^|91ZiZZnter(ZZ |91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z+:)Z|91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z((Z*(\2(Z\':))\0)i|||||||||||||||loZ\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \)\0nte!rnal errpr\2\\21r(2\ZZZ)+:)Z!|91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \)\0(2\ZZZ)+:)Z^|91ZiZZnter(ZZ |91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \)\0(2\ZZZ)+:)Z^)))int \)\0(2\ZZZ)+:)Z^|91ZiZZnter(ZZernZal ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \))\ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)))\2))))((((((\2\2))))))"I
15595 Capturing subpattern count = 108
15596 Max back reference = 22
15597 Contains explicit CR or LF match
15598 Subject length lower bound = 1
15599
15600 # This checks that new code for handling groups that may match an empty string
15601 # works on a very large number of alternatives. This pattern used to provoke a
15602 # complaint that it was too complicated.
15603
15604 /(?:\[A|B|C|D|E|F|G|H|I|J|]{200}Z)/expand
15605
15606 # This one used to compile rubbish instead of a compile error, and then
15607 # behave unpredictably at match time.
15608
15609 /.+(?(?C'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'))?!XXXX.=X/
15610 Failed: error 128 at offset 63: assertion expected after (?( or (?(?C)
15611     .+(?(?C'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'))?!XXXX.=X
15612
15613 /[:[:alnum:]-[[a:lnum:]+/
15614 Failed: error 150 at offset 11: invalid range in character class
15615
15616 /((?(?C'')\QX\E(?!((?(?C'')(?!X=X));=)r*X=X));=)/
15617 Failed: error 128 at offset 11: assertion expected after (?( or (?(?C)
15618
15619 /((?(?C'')\Q\E(?!((?(?C'')(?!X=X));=)r*X=X));=)/
15620
15621 /abcd/auto_callout
15622     abcd\=callout_error=255:2
15623 --->abcd
15624  +0 ^        a
15625  +1 ^^       b
15626 Failed: error -37: callout error code
15627
15628 /()(\g+65534)/
15629 Failed: error 161 at offset 11: group number is too big
15630
15631 /()(\g+65533)/
15632 Failed: error 115 at offset 10: reference to non-existent subpattern
15633
15634 /Á\x00\x00\x00\17\9a(\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\x00k\d+\x00â\80\8e\x00\x00\x00\x00\x00\2*\x00\x00\1*.){36}int^\x00\x00\bÿÿ\x00\9a(\1{50779}?)J\w2/I
15635 Capturing subpattern count = 2
15636 Max back reference = 2
15637 First code unit = \xc1
15638 Last code unit = '2'
15639 Subject length lower bound = 65535
15640
15641 /(a)(b)\2\1\1\1\1/I
15642 Capturing subpattern count = 2
15643 Max back reference = 2
15644 First code unit = 'a'
15645 Last code unit = 'b'
15646 Subject length lower bound = 7
15647
15648 /(?<a>a)(?<b>b)\g{b}\g{a}\g{a}\g{a}\g{a}(?<a>xx)(?<b>zz)/I,dupnames
15649 Capturing subpattern count = 4
15650 Max back reference = 4
15651 Named capturing subpatterns:
15652   a   1
15653   a   3
15654   b   2
15655   b   4
15656 Options: dupnames
15657 First code unit = 'a'
15658 Last code unit = 'z'
15659 Subject length lower bound = 11
15660
15661 //
15662     \=ovector=7777777777
15663 ** Invalid value in 'ovector=7777777777'
15664
15665 # This is here because Perl matches, even though a COMMIT is encountered
15666 # outside of the recursion.
15667
15668 /(?1)(A(*COMMIT)|B)D/
15669     BAXBAD
15670 No match
15671
15672 "(?1){2}(a)"B
15673 ------------------------------------------------------------------
15674         Bra
15675         Recurse
15676         Recurse
15677         CBra 1
15678         a
15679         Ket
15680         Ket
15681         End
15682 ------------------------------------------------------------------
15683
15684 "(?1){2,4}(a)"B
15685 ------------------------------------------------------------------
15686         Bra
15687         Recurse
15688         Recurse
15689         Brazero
15690         Bra
15691         Bra
15692         Recurse
15693         Ket
15694         Brazero
15695         Bra
15696         Recurse
15697         Ket
15698         Ket
15699         CBra 1
15700         a
15701         Ket
15702         Ket
15703         End
15704 ------------------------------------------------------------------
15705
15706 # This test differs from Perl for the first subject. Perl ends up with
15707 # $1 set to 'B'; PCRE2 has it unset (which I think is right).
15708
15709 /^(?:
15710 (?:A| (?:B|B(*ACCEPT)) (?<=(.)) D)
15711 (Z)
15712 )+$/x
15713     AZB
15714  0: AZB
15715  1: <unset>
15716  2: Z
15717     AZBDZ
15718  0: AZBDZ
15719  1: B
15720  2: Z
15721
15722 # The first of these, when run by Perl, gives the mark 'aa', which is wrong.
15723
15724 '(?>a(*:aa))b|ac' mark
15725     ac
15726  0: ac
15727
15728 '(?:a(*:aa))b|ac' mark
15729     ac
15730  0: ac
15731
15732 /(R?){65}/
15733     (R?){65}
15734  0: 
15735  1: 
15736
15737 /\[(a)]{60}/expand
15738     aaaa
15739 No match
15740
15741 /(?<!\1((?U)1((?U))))(*F)/never_backslash_c,alt_bsux,anchored,extended
15742
15743 /\g{3/
15744 Failed: error 157 at offset 2: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number
15745
15746 /(a(?C1)(b)(c)d)+/
15747   abcdabcd\=callout_capture
15748 Callout 1: last capture = 0
15749 --->abcdabcd
15750     ^^           (
15751 Callout 1: last capture = 1
15752  1: abcd
15753  2: b
15754  3: c
15755 --->abcdabcd
15756     ^    ^       (
15757  0: abcdabcd
15758  1: abcd
15759  2: b
15760  3: c
15761
15762 # Perl matches this one, but PCRE does not because (*ACCEPT) clears out any
15763 # pending backtracks in the recursion.
15764
15765 /^ (?(DEFINE) (..(*ACCEPT)|...) ) (?1)$/x
15766 \= Expect no match
15767     abc
15768 No match
15769
15770 # Perl gives no match for this one
15771
15772 /(a(*MARK:m)(*ACCEPT)){0}(?1)/mark
15773     abc
15774  0: a
15775 MK: m
15776
15777 /abc/endanchored
15778     xyzabc
15779  0: abc
15780 \= Expect no match
15781     xyzabcdef
15782 No match
15783 \= Expect error
15784     xyzabc\=ph
15785 Failed: error -34: bad option value
15786
15787 /abc/
15788     xyzabc\=endanchored
15789  0: abc
15790 \= Expect no match
15791     xyzabcdef\=endanchored
15792 No match
15793 \= Expect error
15794     xyzabc\=ps,endanchored
15795 Failed: error -34: bad option value
15796
15797 /abc(*ACCEPT)d/endanchored
15798     xyzabc
15799  0: abc
15800 \= Expect no match
15801     xyzabcdef
15802 No match
15803
15804 /abc|bcd/endanchored
15805     xyzabcd
15806  0: bcd
15807 \= Expect no match
15808     xyzabcdef
15809 No match
15810
15811 /a(*ACCEPT)x|aa/endanchored
15812     aaa
15813  0: a
15814
15815 # Check auto-anchoring when there is a group that is never obeyed at
15816 # the start of a branch.
15817
15818 /(?(DEFINE)(a))^bc/I
15819 Capturing subpattern count = 1
15820 Compile options: <none>
15821 Overall options: anchored
15822 First code unit = 'b'
15823 Subject length lower bound = 2
15824
15825 /(a){0}.*bc/sI
15826 Capturing subpattern count = 1
15827 Compile options: dotall
15828 Overall options: anchored dotall
15829 Last code unit = 'c'
15830 Subject length lower bound = 2
15831
15832 # This should be anchored, as the condition is always false and there is
15833 # no alternative branch.
15834
15835 /(?(VERSION>=999)yes)^bc/I
15836 Capturing subpattern count = 0
15837 Compile options: <none>
15838 Overall options: anchored
15839 Subject length lower bound = 2
15840
15841 # This should not be anchored.
15842
15843 /(?(VERSION>=999)yes|no)^bc/I
15844 Capturing subpattern count = 0
15845 Last code unit = 'c'
15846 Subject length lower bound = 4
15847
15848 /(*LIMIT_HEAP=0)xxx/I
15849 Capturing subpattern count = 0
15850 Heap limit = 0
15851 First code unit = 'x'
15852 Last code unit = 'x'
15853 Subject length lower bound = 3
15854
15855 /\d{0,3}(*:abc)(?C1)xxx/callout_info
15856 Callout 1  x
15857
15858 # ----------------------------------------------------------------------
15859
15860 # These are a whole pile of tests that touch lines of code that are not
15861 # used by any other tests (at least when these were created).
15862
15863 /^a+?x/i,no_start_optimize,no_auto_possess
15864 \= Expect no match
15865     aaa
15866 No match
15867
15868 /^[^a]{3,}?x/i,no_start_optimize,no_auto_possess
15869 \= Expect no match
15870     bbb
15871 No match
15872     cc
15873 No match
15874
15875 /^X\S/no_start_optimize,no_auto_possess
15876 \= Expect no match
15877     X
15878 No match
15879
15880 /^X\W/no_start_optimize,no_auto_possess
15881 \= Expect no match
15882     X
15883 No match
15884
15885 /^X\H/no_start_optimize,no_auto_possess
15886 \= Expect no match
15887     X
15888 No match
15889
15890 /^X\h/no_start_optimize,no_auto_possess
15891 \= Expect no match
15892     X
15893 No match
15894
15895 /^X\V/no_start_optimize,no_auto_possess
15896 \= Expect no match
15897     X
15898 No match
15899
15900 /^X\v/no_start_optimize,no_auto_possess
15901 \= Expect no match
15902     X
15903 No match
15904
15905 /^X\h/no_start_optimize,no_auto_possess
15906 \= Expect no match
15907     XY
15908 No match
15909
15910 /^X\V/no_start_optimize,no_auto_possess
15911 \= Expect no match
15912     X\n
15913 No match
15914
15915 /^X\v/no_start_optimize,no_auto_possess
15916 \= Expect no match
15917     XX
15918 No match
15919
15920 /^X.+?/s,no_start_optimize,no_auto_possess
15921 \= Expect no match
15922     X
15923 No match
15924
15925 /^X\R+?/no_start_optimize,no_auto_possess
15926 \= Expect no match
15927     XX
15928 No match
15929
15930 /^X\H+?/no_start_optimize,no_auto_possess
15931 \= Expect no match
15932     X
15933 No match
15934
15935 /^X\h+?/no_start_optimize,no_auto_possess
15936 \= Expect no match
15937     X
15938 No match
15939
15940 /^X\V+?/no_start_optimize,no_auto_possess
15941 \= Expect no match
15942     X
15943 No match
15944     X\n
15945 No match
15946
15947 /^X\D+?/no_start_optimize,no_auto_possess
15948 \= Expect no match
15949     X
15950 No match
15951     X9
15952 No match
15953
15954 /^X\S+?/no_start_optimize,no_auto_possess
15955 \= Expect no match
15956     X
15957 No match
15958     X\n
15959 No match
15960
15961 /^X\W+?/no_start_optimize,no_auto_possess
15962 \= Expect no match
15963     X
15964 No match
15965     XX
15966 No match
15967
15968 /^X.+?Z/no_start_optimize,no_auto_possess
15969 \= Expect no match
15970     XY\n
15971 No match
15972
15973 /(*CRLF)^X.+?Z/no_start_optimize,no_auto_possess
15974 \= Expect no match
15975     XY\r\=ps
15976 Partial match: XY\x0d
15977
15978 /^X\R+?Z/no_start_optimize,no_auto_possess
15979 \= Expect no match
15980     X\nX
15981 No match
15982     X\n\r\n
15983 No match
15984     X\n\rY
15985 No match
15986     X\n\nY
15987 No match
15988     X\n\x{0c}Y
15989 No match
15990
15991 /(*BSR_ANYCRLF)^X\R+?Z/no_start_optimize,no_auto_possess
15992 \= Expect no match
15993     X\nX
15994 No match
15995     X\n\r\n
15996 No match
15997     X\n\rY
15998 No match
15999     X\n\nY
16000 No match
16001     X\n\x{0c}Y
16002 No match
16003
16004 /^X\H+?Z/no_start_optimize,no_auto_possess
16005 \= Expect no match
16006     XY\t
16007 No match
16008     XYY
16009 No match
16010
16011 /^X\h+?Z/no_start_optimize,no_auto_possess
16012 \= Expect no match
16013     X\t\t
16014 No match
16015     X\tY
16016 No match
16017
16018 /^X\V+?Z/no_start_optimize,no_auto_possess
16019 \= Expect no match
16020     XY\n
16021 No match
16022     XYY
16023 No match
16024
16025 /^X\v+?Z/no_start_optimize,no_auto_possess
16026 \= Expect no match
16027     X\n\n
16028 No match
16029     X\nY
16030 No match
16031
16032 /^X\D+?Z/no_start_optimize,no_auto_possess
16033 \= Expect no match
16034     XY9
16035 No match
16036     XYY
16037 No match
16038
16039 /^X\d+?Z/no_start_optimize,no_auto_possess
16040 \= Expect no match
16041     X99
16042 No match
16043     X9Y
16044 No match
16045
16046 /^X\S+?Z/no_start_optimize,no_auto_possess
16047 \= Expect no match
16048     XY\n
16049 No match
16050     XYY
16051 No match
16052
16053 /^X\s+?Z/no_start_optimize,no_auto_possess
16054 \= Expect no match
16055     X\n\n
16056 No match
16057     X\nY
16058 No match
16059
16060 /^X\W+?Z/no_start_optimize,no_auto_possess
16061 \= Expect no match
16062     X.A
16063 No match
16064     X++
16065 No match
16066
16067 /^X\w+?Z/no_start_optimize,no_auto_possess
16068 \= Expect no match
16069     Xa.
16070 No match
16071     Xaa
16072 No match
16073
16074 /^X.{1,3}Z/s,no_start_optimize,no_auto_possess
16075 \= Expect no match
16076     Xa.bd
16077 No match
16078
16079 /^X\h+Z/no_start_optimize,no_auto_possess
16080 \= Expect no match
16081     X\t\t
16082 No match
16083     X\tY
16084 No match
16085
16086 /^X\V+Z/no_start_optimize,no_auto_possess
16087 \= Expect no match
16088     XY\n
16089 No match
16090     XYY
16091 No match
16092
16093 /^(X(*THEN)Y|AB){0}(?1)/
16094     ABX
16095  0: AB
16096 \= Expect no match
16097     XAB
16098 No match
16099
16100 /^(?!A(?C1)B)C/
16101     ABC\=callout_error=1,no_jit
16102 No match
16103
16104 /^(?!A(?C1)B)C/no_start_optimize
16105     ABC\=callout_error=1
16106 --->ABC
16107   1 ^^      B
16108 Failed: error -37: callout error code
16109
16110 /^(?(?!A(?C1)B)C)/
16111     ABC\=callout_error=1
16112 --->ABC
16113   1 ^^      B
16114 Failed: error -37: callout error code
16115
16116 # ----------------------------------------------------------------------
16117
16118 /[a b c]/BxxI
16119 ------------------------------------------------------------------
16120         Bra
16121         [a-c]
16122         Ket
16123         End
16124 ------------------------------------------------------------------
16125 Capturing subpattern count = 0
16126 Options: extended_more
16127 Starting code units: a b c 
16128 Subject length lower bound = 1
16129
16130 /[a b c]/BxxxI
16131 ------------------------------------------------------------------
16132         Bra
16133         [a-c]
16134         Ket
16135         End
16136 ------------------------------------------------------------------
16137 Capturing subpattern count = 0
16138 Options: extended extended_more
16139 Starting code units: a b c 
16140 Subject length lower bound = 1
16141
16142 /[a b c]/B,extended_more
16143 ------------------------------------------------------------------
16144         Bra
16145         [a-c]
16146         Ket
16147         End
16148 ------------------------------------------------------------------
16149
16150 /[ a b c ]/B,extended_more
16151 ------------------------------------------------------------------
16152         Bra
16153         [a-c]
16154         Ket
16155         End
16156 ------------------------------------------------------------------
16157
16158 /[a b](?xx: [ 12 ] (?-xx:[ 34 ]) )y z/B
16159 ------------------------------------------------------------------
16160         Bra
16161         [ ab]
16162         Bra
16163         [12]
16164         Bra
16165         [ 34]
16166         Ket
16167         Ket
16168         y z
16169         Ket
16170         End
16171 ------------------------------------------------------------------
16172
16173 # Unsetting /x also unsets /xx
16174
16175 /[a b](?xx: [ 12 ] (?-x:[ 34 ]) )y z/B
16176 ------------------------------------------------------------------
16177         Bra
16178         [ ab]
16179         Bra
16180         [12]
16181         Bra
16182         [ 34]
16183         Ket
16184         Ket
16185         y z
16186         Ket
16187         End
16188 ------------------------------------------------------------------
16189
16190 /(a)(?-n:(b))(c)/nB
16191 ------------------------------------------------------------------
16192         Bra
16193         Bra
16194         a
16195         Ket
16196         Bra
16197         CBra 1
16198         b
16199         Ket
16200         Ket
16201         Bra
16202         c
16203         Ket
16204         Ket
16205         End
16206 ------------------------------------------------------------------
16207
16208 # ----------------------------------------------------------------------
16209 # These test the dangerous PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL option.
16210
16211 /\j\x{z}\o{82}\L\uabcd\u\U\g{\g/B,\bad_escape_is_literal
16212 ** Unrecognized modifier '\' in '\bad_escape_is_literal'
16213
16214 /\N{\c/IB,bad_escape_is_literal
16215 ------------------------------------------------------------------
16216         Bra
16217         N{c
16218         Ket
16219         End
16220 ------------------------------------------------------------------
16221 Capturing subpattern count = 0
16222 Extra options: bad_escape_is_literal
16223 First code unit = 'N'
16224 Last code unit = 'c'
16225 Subject length lower bound = 3
16226
16227 /[\j\x{z}\o\gA-\Nb-\g]/B,bad_escape_is_literal
16228 ------------------------------------------------------------------
16229         Bra
16230         [A-Nb-gjoxz{}]
16231         Ket
16232         End
16233 ------------------------------------------------------------------
16234
16235 /[Q-\N]/B,bad_escape_is_literal
16236 Failed: error 108 at offset 4: range out of order in character class
16237
16238 # ----------------------------------------------------------------------
16239
16240 /a\b(c/literal
16241     a\\b(c
16242  0: a\b(c
16243
16244 /a\b(c/literal,caseless
16245     a\\b(c
16246  0: a\b(c
16247     a\\B(c
16248  0: a\B(c
16249
16250 /a\b(c/literal,firstline
16251     XYYa\\b(c
16252  0: a\b(c
16253 \= Expect no match
16254     X\na\\b(c
16255 No match
16256
16257 /a\b?c/literal,use_offset_limit
16258     XXXXa\\b?c\=offset_limit=4
16259  0: a\b?c
16260 \= Expect no match
16261     XXXXa\\b?c\=offset_limit=3
16262 No match
16263
16264 /a\b(c/literal,anchored,endanchored
16265     a\\b(c
16266  0: a\b(c
16267 \= Expect no match
16268     Xa\\b(c
16269 No match
16270     a\\b(cX
16271 No match
16272     Xa\\b(cX
16273 No match
16274
16275 //literal,extended
16276 Failed: error 192 at offset 0: invalid option bits with PCRE2_LITERAL
16277
16278 /a\b(c/literal,auto_callout,no_start_optimize
16279     XXXXa\\b(c
16280 --->XXXXa\b(c
16281  +0 ^             a
16282  +0  ^            a
16283  +0   ^           a
16284  +0    ^          a
16285  +0     ^         a
16286  +1     ^^        \
16287  +2     ^ ^       b
16288  +3     ^  ^      (
16289  +4     ^   ^     c
16290  +5     ^    ^    End of pattern
16291  0: a\b(c
16292
16293 /a\b(c/literal,auto_callout
16294     XXXXa\\b(c
16295 --->XXXXa\b(c
16296  +0     ^         a
16297  +1     ^^        \
16298  +2     ^ ^       b
16299  +3     ^  ^      (
16300  +4     ^   ^     c
16301  +5     ^    ^    End of pattern
16302  0: a\b(c
16303
16304 /(*CR)abc/literal
16305     (*CR)abc
16306  0: (*CR)abc
16307
16308 /cat|dog/I,match_word
16309 Capturing subpattern count = 0
16310 Max lookbehind = 1
16311 Extra options: match_word
16312 Starting code units: c d 
16313 Subject length lower bound = 3
16314     the cat sat
16315  0: cat
16316 \= Expect no match
16317     caterpillar
16318 No match
16319     snowcat
16320 No match
16321     syndicate
16322 No match
16323
16324 /(cat)|dog/I,match_line,literal
16325 Capturing subpattern count = 0
16326 Compile options: literal
16327 Overall options: anchored literal
16328 Extra options: match_line
16329 First code unit = '('
16330 Subject length lower bound = 9
16331     (cat)|dog
16332  0: (cat)|dog
16333 \= Expect no match
16334     the cat sat
16335 No match
16336     caterpillar
16337 No match
16338     snowcat
16339 No match
16340     syndicate
16341 No match
16342
16343 /a whole line/match_line,multiline
16344     Rhubarb \na whole line\n custard
16345  0: a whole line
16346 \= Expect no match
16347     Not a whole line
16348 No match
16349
16350 # Perl gets this wrong, failing to capture 'b' in group 1.
16351
16352 /^(b+|a){1,2}?bc/
16353     bbc
16354  0: bbc
16355  1: b
16356     
16357 # And again here, for the "babc" subject string. 
16358
16359 /^(b*|ba){1,2}?bc/
16360     babc
16361  0: babc
16362  1: ba
16363     bbabc
16364  0: bbabc
16365  1: ba
16366     bababc
16367  0: bababc
16368  1: ba
16369 \= Expect no match
16370     bababbc
16371 No match
16372     babababc
16373 No match
16374
16375 /[[:digit:]-a]/
16376 Failed: error 150 at offset 10: invalid range in character class
16377
16378 /[[:digit:]-[:print:]]/
16379 Failed: error 150 at offset 10: invalid range in character class
16380
16381 /[\d-a]/
16382 Failed: error 150 at offset 3: invalid range in character class
16383
16384 /[\H-z]/
16385 Failed: error 150 at offset 3: invalid range in character class
16386
16387 /[\d-[:print:]]/
16388 Failed: error 150 at offset 3: invalid range in character class
16389
16390 # Perl gets the second of these wrong, giving no match.
16391
16392 "(?<=(a))\1?b"I
16393 Capturing subpattern count = 1
16394 Max back reference = 1
16395 Max lookbehind = 1
16396 Last code unit = 'b'
16397 Subject length lower bound = 1
16398     ab
16399  0: b
16400  1: a
16401     aaab 
16402  0: ab
16403  1: a
16404
16405 "(?=(a))\1?b"I
16406 Capturing subpattern count = 1
16407 Max back reference = 1
16408 First code unit = 'a'
16409 Last code unit = 'b'
16410 Subject length lower bound = 1
16411     ab
16412  0: ab
16413  1: a
16414     aaab
16415  0: ab
16416  1: a
16417     
16418 # JIT does not support callout_extra  
16419     
16420 /(*NO_JIT)(a+)b/auto_callout,no_start_optimize,no_auto_possess
16421 \= Expect no match
16422     aac\=callout_extra 
16423 New match attempt
16424 --->aac
16425  +9 ^       (
16426 +10 ^       a+
16427 +12 ^ ^     )
16428 +13 ^ ^     b
16429 Backtrack
16430 --->aac
16431 +12 ^^      )
16432 +13 ^^      b
16433 Backtrack
16434 No other matching paths
16435 New match attempt
16436 --->aac
16437  +9  ^      (
16438 +10  ^      a+
16439 +12  ^^     )
16440 +13  ^^     b
16441 Backtrack
16442 No other matching paths
16443 New match attempt
16444 --->aac
16445  +9   ^     (
16446 +10   ^     a+
16447 Backtrack
16448 No other matching paths
16449 New match attempt
16450 --->aac
16451  +9    ^    (
16452 +10    ^    a+
16453 No match
16454     
16455 /(*NO_JIT)a+(?C'XXX')b/no_start_optimize,no_auto_possess
16456 \= Expect no match
16457     aac\=callout_extra 
16458 New match attempt
16459 Callout (15): 'XXX'
16460 --->aac
16461     ^ ^     b
16462 Backtrack
16463 Callout (15): 'XXX'
16464 --->aac
16465     ^^      b
16466 Backtrack
16467 No other matching paths
16468 New match attempt
16469 Callout (15): 'XXX'
16470 --->aac
16471      ^^     b
16472 No match
16473
16474 /\n/firstline
16475     xyz\nabc
16476  0: \x0a
16477
16478 /\nabc/firstline
16479     xyz\nabc
16480  0: \x0aabc
16481
16482 /\x{0a}abc/firstline,newline=crlf
16483 \= Expect no match
16484     xyz\r\nabc
16485 No match
16486
16487 /[abc]/firstline
16488 \= Expect no match
16489     \na
16490 No match
16491     
16492 # These tests are matched in test 1 as they are Perl compatible. Here we are
16493 # looking at what does and does not get auto-possessified. 
16494
16495 /(?(DEFINE)(?<optional_a>a?))^(?&optional_a)a$/B
16496 ------------------------------------------------------------------
16497         Bra
16498         Cond
16499         Cond false
16500         CBra 1
16501         a?
16502         Ket
16503         Ket
16504         ^
16505         Recurse
16506         a
16507         $
16508         Ket
16509         End
16510 ------------------------------------------------------------------
16511
16512 /(?(DEFINE)(?<optional_a>a?)X)^(?&optional_a)a$/B
16513 ------------------------------------------------------------------
16514         Bra
16515         Cond
16516         Cond false
16517         CBra 1
16518         a?
16519         Ket
16520         X
16521         Ket
16522         ^
16523         Recurse
16524         a
16525         $
16526         Ket
16527         End
16528 ------------------------------------------------------------------
16529     
16530 /^(a?)b(?1)a/B
16531 ------------------------------------------------------------------
16532         Bra
16533         ^
16534         CBra 1
16535         a?
16536         Ket
16537         b
16538         Recurse
16539         a
16540         Ket
16541         End
16542 ------------------------------------------------------------------
16543
16544 /^(a?)+b(?1)a/B
16545 ------------------------------------------------------------------
16546         Bra
16547         ^
16548         SCBra 1
16549         a?
16550         KetRmax
16551         b
16552         Recurse
16553         a
16554         Ket
16555         End
16556 ------------------------------------------------------------------
16557
16558 /^(a?)++b(?1)a/B
16559 ------------------------------------------------------------------
16560         Bra
16561         ^
16562         SCBraPos 1
16563         a?
16564         KetRpos
16565         b
16566         Recurse
16567         a
16568         Ket
16569         End
16570 ------------------------------------------------------------------
16571
16572 /^(a?)+b/B
16573 ------------------------------------------------------------------
16574         Bra
16575         ^
16576         SCBra 1
16577         a?
16578         KetRmax
16579         b
16580         Ket
16581         End
16582 ------------------------------------------------------------------
16583
16584 /(?=a+)a(a+)++b/B
16585 ------------------------------------------------------------------
16586         Bra
16587         Assert
16588         a++
16589         Ket
16590         a
16591         CBraPos 1
16592         a++
16593         KetRpos
16594         b
16595         Ket
16596         End
16597 ------------------------------------------------------------------
16598
16599 /(?<=(?=.){4,5}x)/B
16600 ------------------------------------------------------------------
16601         Bra
16602         AssertB
16603         Reverse
16604         Assert
16605         Any
16606         Ket
16607         x
16608         Ket
16609         Ket
16610         End
16611 ------------------------------------------------------------------
16612
16613 # Perl behaves differently with these when optimization is turned off
16614
16615 /a(*PRUNE:X)bc|qq/mark,no_start_optimize
16616 \= Expect no match
16617     axy
16618 No match, mark = X
16619
16620 /a(*THEN:X)bc|qq/mark,no_start_optimize
16621 \= Expect no match
16622     axy
16623 No match, mark = X
16624
16625 /(?^x-i)AB/ 
16626 Failed: error 194 at offset 4: invalid hyphen in option setting
16627
16628 /(?^-i)AB/ 
16629 Failed: error 194 at offset 3: invalid hyphen in option setting
16630
16631 /(?x-i-i)/
16632 Failed: error 194 at offset 5: invalid hyphen in option setting
16633
16634 /(?(?=^))b/I
16635 Capturing subpattern count = 0
16636 Last code unit = 'b'
16637 Subject length lower bound = 1
16638     abc
16639  0: b
16640
16641 /(?(?=^)|)b/I
16642 Capturing subpattern count = 0
16643 First code unit = 'b'
16644 Subject length lower bound = 1
16645     abc
16646  0: b
16647
16648 /(?(?=^)|^)b/I
16649 Capturing subpattern count = 0
16650 Compile options: <none>
16651 Overall options: anchored
16652 First code unit = 'b'
16653 Subject length lower bound = 1
16654     bbc
16655  0: b
16656 \= Expect no match
16657     abc     
16658 No match
16659
16660 /(?(1)^|^())/I
16661 Capturing subpattern count = 1
16662 Max back reference = 1
16663 May match empty string
16664 Compile options: <none>
16665 Overall options: anchored
16666 Subject length lower bound = 0
16667
16668 /(?(1)^())b/I
16669 Capturing subpattern count = 1
16670 Max back reference = 1
16671 Last code unit = 'b'
16672 Subject length lower bound = 1
16673
16674 /(?(1)^())+b/I,aftertext
16675 Capturing subpattern count = 1
16676 Max back reference = 1
16677 Last code unit = 'b'
16678 Subject length lower bound = 1
16679     abc
16680  0: b
16681  0+ c
16682
16683 /(?(1)^()|^)+b/I,aftertext
16684 Capturing subpattern count = 1
16685 Max back reference = 1
16686 Compile options: <none>
16687 Overall options: anchored
16688 First code unit = 'b'
16689 Subject length lower bound = 1
16690     bbc 
16691  0: b
16692  0+ bc
16693 \= Expect no match     
16694     abc
16695 No match
16696
16697 /(?(1)^()|^)*b/I,aftertext
16698 Capturing subpattern count = 1
16699 Max back reference = 1
16700 First code unit = 'b'
16701 Subject length lower bound = 1
16702     bbc 
16703  0: b
16704  0+ bc
16705     abc
16706  0: b
16707  0+ c
16708     xbc 
16709  0: b
16710  0+ c
16711
16712 /(?(1)^())+b/I,aftertext
16713 Capturing subpattern count = 1
16714 Max back reference = 1
16715 Last code unit = 'b'
16716 Subject length lower bound = 1
16717     abc
16718  0: b
16719  0+ c
16720
16721 /(?(1)^a()|^a)+b/I,aftertext
16722 Capturing subpattern count = 1
16723 Max back reference = 1
16724 Compile options: <none>
16725 Overall options: anchored
16726 First code unit = 'a'
16727 Last code unit = 'b'
16728 Subject length lower bound = 2
16729     abc 
16730  0: ab
16731  0+ c
16732 \= Expect no match     
16733     bbc
16734 No match
16735
16736 /(?(1)^|^(a))+b/I,aftertext
16737 Capturing subpattern count = 1
16738 Max back reference = 1
16739 Compile options: <none>
16740 Overall options: anchored
16741 Last code unit = 'b'
16742 Subject length lower bound = 1
16743     abc 
16744  0: ab
16745  0+ c
16746  1: a
16747 \= Expect no match     
16748     bbc
16749 No match
16750
16751 /(?(1)^a()|^a)*b/I,aftertext
16752 Capturing subpattern count = 1
16753 Max back reference = 1
16754 Last code unit = 'b'
16755 Subject length lower bound = 1
16756     abc 
16757  0: ab
16758  0+ c
16759     bbc
16760  0: b
16761  0+ bc
16762     xbc 
16763  0: b
16764  0+ c
16765
16766 # End of testinput2
16767 Error -70: PCRE2_ERROR_BADDATA (unknown error number)
16768 Error -62: bad serialized data
16769 Error -2: partial match
16770 Error -1: no match
16771 Error 0: PCRE2_ERROR_BADDATA (unknown error number)
16772 Error 100: no error
16773 Error 101: \ at end of pattern
16774 Error 191: PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES is not allowed in UTF-16 mode
16775 Error 200: PCRE2_ERROR_BADDATA (unknown error number)