1PCRE version 3.4 22-Aug-2000
2
3/(a)b|/
4Capturing subpattern count = 1
5No options
6No first char
7No need char
8
9/abc/
10Capturing subpattern count = 0
11No options
12First char = 'a'
13Need char = 'c'
14    abc
15 0: abc
16    defabc
17 0: abc
18    \Aabc
19 0: abc
20    *** Failers
21No match
22    \Adefabc
23No match
24    ABC
25No match
26
27/^abc/
28Capturing subpattern count = 0
29Options: anchored
30No first char
31Need char = 'c'
32    abc
33 0: abc
34    \Aabc
35 0: abc
36    *** Failers
37No match
38    defabc
39No match
40    \Adefabc
41No match
42
43/a+bc/
44Capturing subpattern count = 0
45No options
46First char = 'a'
47Need char = 'c'
48
49/a*bc/
50Capturing subpattern count = 0
51No options
52No first char
53Need char = 'c'
54
55/a{3}bc/
56Capturing subpattern count = 0
57No options
58First char = 'a'
59Need char = 'c'
60
61/(abc|a+z)/
62Capturing subpattern count = 1
63No options
64First char = 'a'
65No need char
66
67/^abc$/
68Capturing subpattern count = 0
69Options: anchored
70No first char
71Need char = 'c'
72    abc
73 0: abc
74    *** Failers
75No match
76    def\nabc
77No match
78
79/ab\gdef/X
80Failed: unrecognized character follows \ at offset 3
81
82/(?X)ab\gdef/X
83Failed: unrecognized character follows \ at offset 7
84
85/x{5,4}/
86Failed: numbers out of order in {} quantifier at offset 5
87
88/z{65536}/
89Failed: number too big in {} quantifier at offset 7
90
91/[abcd/
92Failed: missing terminating ] for character class at offset 5
93
94/[\B]/
95Failed: invalid escape sequence in character class at offset 2
96
97/[z-a]/
98Failed: range out of order in character class at offset 3
99
100/^*/
101Failed: nothing to repeat at offset 1
102
103/(abc/
104Failed: missing ) at offset 4
105
106/(?# abc/
107Failed: missing ) after comment at offset 7
108
109/(?z)abc/
110Failed: unrecognized character after (? at offset 2
111
112/.*b/
113Capturing subpattern count = 0
114No options
115First char at start or follows \n
116Need char = 'b'
117
118/.*?b/
119Capturing subpattern count = 0
120No options
121First char at start or follows \n
122Need char = 'b'
123
124/cat|dog|elephant/
125Capturing subpattern count = 0
126No options
127No first char
128No need char
129    this sentence eventually mentions a cat
130 0: cat
131    this sentences rambles on and on for a while and then reaches elephant
132 0: elephant
133
134/cat|dog|elephant/S
135Capturing subpattern count = 0
136No options
137No first char
138No need char
139Starting character set: c d e
140    this sentence eventually mentions a cat
141 0: cat
142    this sentences rambles on and on for a while and then reaches elephant
143 0: elephant
144
145/cat|dog|elephant/iS
146Capturing subpattern count = 0
147Options: caseless
148No first char
149No need char
150Starting character set: C D E c d e
151    this sentence eventually mentions a CAT cat
152 0: CAT
153    this sentences rambles on and on for a while to elephant ElePhant
154 0: elephant
155
156/a|[bcd]/S
157Capturing subpattern count = 0
158No options
159No first char
160No need char
161Starting character set: a b c d
162
163/(a|[^\dZ])/S
164Capturing subpattern count = 1
165No options
166No first char
167No need char
168Starting character set: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
169  \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
170  \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / : ; < = >
171  ? @ 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
172  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
173  \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92
174  \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1
175  \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0
176  \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf
177  \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce
178  \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd
179  \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec
180  \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb
181  \xfc \xfd \xfe \xff
182
183/(a|b)*[\s]/S
184Capturing subpattern count = 1
185No options
186No first char
187No need char
188Starting character set: \x09 \x0a \x0b \x0c \x0d \x20 a b
189
190/(ab\2)/
191Failed: back reference to non-existent subpattern at offset 6
192
193/{4,5}abc/
194Failed: nothing to repeat at offset 4
195
196/(a)(b)(c)\2/
197Capturing subpattern count = 3
198Max back reference = 2
199No options
200First char = 'a'
201Need char = 'c'
202    abcb
203 0: abcb
204 1: a
205 2: b
206 3: c
207    \O0abcb
208Matched, but too many substrings
209    \O3abcb
210Matched, but too many substrings
211 0: abcb
212    \O6abcb
213Matched, but too many substrings
214 0: abcb
215 1: a
216    \O9abcb
217Matched, but too many substrings
218 0: abcb
219 1: a
220 2: b
221    \O12abcb
222 0: abcb
223 1: a
224 2: b
225 3: c
226
227/(a)bc|(a)(b)\2/
228Capturing subpattern count = 3
229Max back reference = 2
230No options
231First char = 'a'
232No need char
233    abc
234 0: abc
235 1: a
236    \O0abc
237Matched, but too many substrings
238    \O3abc
239Matched, but too many substrings
240 0: abc
241    \O6abc
242 0: abc
243 1: a
244    aba
245 0: aba
246 1: <unset>
247 2: a
248 3: b
249    \O0aba
250Matched, but too many substrings
251    \O3aba
252Matched, but too many substrings
253 0: aba
254    \O6aba
255Matched, but too many substrings
256 0: aba
257 1: <unset>
258    \O9aba
259Matched, but too many substrings
260 0: aba
261 1: <unset>
262 2: a
263    \O12aba
264 0: aba
265 1: <unset>
266 2: a
267 3: b
268
269/abc$/E
270Capturing subpattern count = 0
271Options: dollar_endonly
272First char = 'a'
273Need char = 'c'
274    abc
275 0: abc
276    *** Failers
277No match
278    abc\n
279No match
280    abc\ndef
281No match
282
283/(a)(b)(c)(d)(e)\6/
284Failed: back reference to non-existent subpattern at offset 17
285
286/the quick brown fox/
287Capturing subpattern count = 0
288No options
289First char = 't'
290Need char = 'x'
291    the quick brown fox
292 0: the quick brown fox
293    this is a line with the quick brown fox
294 0: the quick brown fox
295
296/the quick brown fox/A
297Capturing subpattern count = 0
298Options: anchored
299No first char
300Need char = 'x'
301    the quick brown fox
302 0: the quick brown fox
303    *** Failers
304No match
305    this is a line with the quick brown fox
306No match
307
308/ab(?z)cd/
309Failed: unrecognized character after (? at offset 4
310
311/^abc|def/
312Capturing subpattern count = 0
313No options
314No first char
315No need char
316    abcdef
317 0: abc
318    abcdef\B
319 0: def
320
321/.*((abc)$|(def))/
322Capturing subpattern count = 3
323No options
324First char at start or follows \n
325No need char
326    defabc
327 0: defabc
328 1: abc
329 2: abc
330    \Zdefabc
331 0: def
332 1: def
333 2: <unset>
334 3: def
335
336/abc/P
337    abc
338 0: abc
339    *** Failers
340No match: POSIX code 17: match failed
341
342/^abc|def/P
343    abcdef
344 0: abc
345    abcdef\B
346 0: def
347
348/.*((abc)$|(def))/P
349    defabc
350 0: defabc
351 1: abc
352 2: abc
353    \Zdefabc
354 0: def
355 1: def
356 3: def
357
358/the quick brown fox/P
359    the quick brown fox
360 0: the quick brown fox
361    *** Failers
362No match: POSIX code 17: match failed
363    The Quick Brown Fox
364No match: POSIX code 17: match failed
365
366/the quick brown fox/Pi
367    the quick brown fox
368 0: the quick brown fox
369    The Quick Brown Fox
370 0: The Quick Brown Fox
371
372/abc.def/P
373    *** Failers
374No match: POSIX code 17: match failed
375    abc\ndef
376No match: POSIX code 17: match failed
377
378/abc$/P
379    abc
380 0: abc
381    abc\n
382 0: abc
383
384/(abc)\2/P
385Failed: POSIX code 15: bad back reference at offset 7
386
387/(abc\1)/P
388    abc
389No match: POSIX code 17: match failed
390
391/)/
392Failed: unmatched parentheses at offset 0
393
394/a[]b/
395Failed: missing terminating ] for character class at offset 4
396
397/[^aeiou ]{3,}/
398Capturing subpattern count = 0
399No options
400No first char
401No need char
402    co-processors, and for
403 0: -pr
404
405/<.*>/
406Capturing subpattern count = 0
407No options
408First char = '<'
409Need char = '>'
410    abc<def>ghi<klm>nop
411 0: <def>ghi<klm>
412
413/<.*?>/
414Capturing subpattern count = 0
415No options
416First char = '<'
417Need char = '>'
418    abc<def>ghi<klm>nop
419 0: <def>
420
421/<.*>/U
422Capturing subpattern count = 0
423Options: ungreedy
424First char = '<'
425Need char = '>'
426    abc<def>ghi<klm>nop
427 0: <def>
428
429/<.*>(?U)/
430Capturing subpattern count = 0
431Options: ungreedy
432First char = '<'
433Need char = '>'
434    abc<def>ghi<klm>nop
435 0: <def>
436
437/<.*?>/U
438Capturing subpattern count = 0
439Options: ungreedy
440First char = '<'
441Need char = '>'
442    abc<def>ghi<klm>nop
443 0: <def>ghi<klm>
444
445/={3,}/U
446Capturing subpattern count = 0
447Options: ungreedy
448First char = '='
449Need char = '='
450    abc========def
451 0: ===
452
453/(?U)={3,}?/
454Capturing subpattern count = 0
455Options: ungreedy
456First char = '='
457Need char = '='
458    abc========def
459 0: ========
460
461/(?<!bar|cattle)foo/
462Capturing subpattern count = 0
463No options
464First char = 'f'
465Need char = 'o'
466    foo
467 0: foo
468    catfoo
469 0: foo
470    *** Failers
471No match
472    the barfoo
473No match
474    and cattlefoo
475No match
476
477/(?<=a+)b/
478Failed: lookbehind assertion is not fixed length at offset 6
479
480/(?<=aaa|b{0,3})b/
481Failed: lookbehind assertion is not fixed length at offset 14
482
483/(?<!(foo)a\1)bar/
484Failed: lookbehind assertion is not fixed length at offset 12
485
486/(?i)abc/
487Capturing subpattern count = 0
488Options: caseless
489First char = 'a'
490Need char = 'c'
491
492/(a|(?m)a)/
493Capturing subpattern count = 1
494No options
495First char = 'a'
496No need char
497
498/(?i)^1234/
499Capturing subpattern count = 0
500Options: anchored caseless
501No first char
502Need char = '4'
503
504/(^b|(?i)^d)/
505Capturing subpattern count = 1
506Options: anchored
507Case state changes
508No first char
509No need char
510
511/(?s).*/
512Capturing subpattern count = 0
513Options: anchored dotall
514No first char
515No need char
516
517/[abcd]/S
518Capturing subpattern count = 0
519No options
520No first char
521No need char
522Starting character set: a b c d
523
524/(?i)[abcd]/S
525Capturing subpattern count = 0
526Options: caseless
527No first char
528No need char
529Starting character set: A B C D a b c d
530
531/(?m)[xy]|(b|c)/S
532Capturing subpattern count = 1
533Options: multiline
534No first char
535No need char
536Starting character set: b c x y
537
538/(^a|^b)/m
539Capturing subpattern count = 1
540Options: multiline
541First char at start or follows \n
542No need char
543
544/(?i)(^a|^b)/m
545Capturing subpattern count = 1
546Options: caseless multiline
547First char at start or follows \n
548No need char
549
550/(a)(?(1)a|b|c)/
551Failed: conditional group contains more than two branches at offset 13
552
553/(?(?=a)a|b|c)/
554Failed: conditional group contains more than two branches at offset 12
555
556/(?(1a)/
557Failed: malformed number after (?( at offset 4
558
559/(?(?i))/
560Failed: assertion expected after (?( at offset 3
561
562/(?(abc))/
563Failed: assertion expected after (?( at offset 3
564
565/(?(?<ab))/
566Failed: unrecognized character after (?< at offset 2
567
568/((?s)blah)\s+\1/
569Capturing subpattern count = 1
570Max back reference = 1
571No options
572First char = 'b'
573Need char = 'h'
574
575/((?i)blah)\s+\1/
576Capturing subpattern count = 1
577Max back reference = 1
578No options
579Case state changes
580No first char
581Need char = 'h'
582
583/((?i)b)/DS
584------------------------------------------------------------------
585  0  16 Bra 0
586  3   8 Bra 1
587  6  01 Opt
588  8   1 b
589 11   8 Ket
590 14  00 Opt
591 16  16 Ket
592 19     End
593------------------------------------------------------------------
594Capturing subpattern count = 1
595No options
596Case state changes
597No first char
598Need char = 'b'
599Starting character set: B b
600
601/(a*b|(?i:c*(?-i)d))/S
602Capturing subpattern count = 1
603No options
604Case state changes
605No first char
606No need char
607Starting character set: C a b c d
608
609/a$/
610Capturing subpattern count = 0
611No options
612First char = 'a'
613No need char
614    a
615 0: a
616    a\n
617 0: a
618    *** Failers
619No match
620    \Za
621No match
622    \Za\n
623No match
624
625/a$/m
626Capturing subpattern count = 0
627Options: multiline
628First char = 'a'
629No need char
630    a
631 0: a
632    a\n
633 0: a
634    \Za\n
635 0: a
636    *** Failers
637No match
638    \Za
639No match
640
641/\Aabc/m
642Capturing subpattern count = 0
643Options: anchored multiline
644No first char
645Need char = 'c'
646
647/^abc/m
648Capturing subpattern count = 0
649Options: multiline
650First char at start or follows \n
651Need char = 'c'
652
653/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/
654Capturing subpattern count = 5
655Options: anchored
656No first char
657Need char = 'a'
658  aaaaabbbbbcccccdef
659 0: aaaaabbbbbcccccdef
660 1: aaaaabbbbbcccccdef
661 2: aaaaa
662 3: b
663 4: bbbbccccc
664 5: def
665
666/(?<=foo)[ab]/S
667Capturing subpattern count = 0
668No options
669No first char
670No need char
671Starting character set: a b
672
673/(?<!foo)(alpha|omega)/S
674Capturing subpattern count = 1
675No options
676No first char
677Need char = 'a'
678Starting character set: a o
679
680/(?!alphabet)[ab]/S
681Capturing subpattern count = 0
682No options
683No first char
684No need char
685Starting character set: a b
686
687/(?<=foo\n)^bar/m
688Capturing subpattern count = 0
689Options: multiline
690First char at start or follows \n
691Need char = 'r'
692
693/(?>^abc)/m
694Capturing subpattern count = 0
695Options: multiline
696First char at start or follows \n
697Need char = 'c'
698    abc
699 0: abc
700    def\nabc
701 0: abc
702    *** Failers
703No match
704    defabc
705No match
706
707/(?<=ab(c+)d)ef/
708Failed: lookbehind assertion is not fixed length at offset 11
709
710/(?<=ab(?<=c+)d)ef/
711Failed: lookbehind assertion is not fixed length at offset 12
712
713/(?<=ab(c|de)f)g/
714Failed: lookbehind assertion is not fixed length at offset 13
715
716/The next three are in testinput2 because they have variable length branches/
717Capturing subpattern count = 0
718No options
719First char = 'T'
720Need char = 's'
721
722/(?<=bullock|donkey)-cart/
723Capturing subpattern count = 0
724No options
725First char = '-'
726Need char = 't'
727    the bullock-cart
728 0: -cart
729    a donkey-cart race
730 0: -cart
731    *** Failers
732No match
733    cart
734No match
735    horse-and-cart
736No match
737
738/(?<=ab(?i)x|y|z)/
739Capturing subpattern count = 0
740No options
741Case state changes
742No first char
743No need char
744
745/(?>.*)(?<=(abcd)|(xyz))/
746Capturing subpattern count = 2
747No options
748First char at start or follows \n
749No need char
750    alphabetabcd
751 0: alphabetabcd
752 1: abcd
753    endingxyz
754 0: endingxyz
755 1: <unset>
756 2: xyz
757
758/(?<=ab(?i)x(?-i)y|(?i)z|b)ZZ/
759Capturing subpattern count = 0
760No options
761Case state changes
762First char = 'Z'
763Need char = 'Z'
764    abxyZZ
765 0: ZZ
766    abXyZZ
767 0: ZZ
768    ZZZ
769 0: ZZ
770    zZZ
771 0: ZZ
772    bZZ
773 0: ZZ
774    BZZ
775 0: ZZ
776    *** Failers
777No match
778    ZZ
779No match
780    abXYZZ
781No match
782    zzz
783No match
784    bzz
785No match
786
787/(?<!(foo)a)bar/
788Capturing subpattern count = 1
789No options
790First char = 'b'
791Need char = 'r'
792    bar
793 0: bar
794    foobbar
795 0: bar
796    *** Failers
797No match
798    fooabar
799No match
800
801/This one is here because Perl 5.005_02 doesn't fail it/
802Capturing subpattern count = 0
803No options
804First char = 'T'
805Need char = 't'
806
807/^(a)?(?(1)a|b)+$/
808Capturing subpattern count = 1
809Options: anchored
810No first char
811No need char
812    *** Failers
813No match
814    a
815No match
816
817/This one is here because I think Perl 5.005_02 gets the setting of $1 wrong/
818Capturing subpattern count = 0
819No options
820First char = 'T'
821Need char = 'g'
822
823/^(a\1?){4}$/
824Capturing subpattern count = 1
825Max back reference = 1
826Options: anchored
827No first char
828Need char = 'a'
829    aaaaaa
830 0: aaaaaa
831 1: aa
832
833/These are syntax tests from Perl 5.005/
834Capturing subpattern count = 0
835No options
836First char = 'T'
837Need char = '5'
838
839/a[b-a]/
840Failed: range out of order in character class at offset 4
841
842/a[]b/
843Failed: missing terminating ] for character class at offset 4
844
845/a[/
846Failed: missing terminating ] for character class at offset 2
847
848/*a/
849Failed: nothing to repeat at offset 0
850
851/(*)b/
852Failed: nothing to repeat at offset 1
853
854/abc)/
855Failed: unmatched parentheses at offset 3
856
857/(abc/
858Failed: missing ) at offset 4
859
860/a**/
861Failed: nothing to repeat at offset 2
862
863/)(/
864Failed: unmatched parentheses at offset 0
865
866/\1/
867Failed: back reference to non-existent subpattern at offset 2
868
869/\2/
870Failed: back reference to non-existent subpattern at offset 2
871
872/(a)|\2/
873Failed: back reference to non-existent subpattern at offset 6
874
875/a[b-a]/i
876Failed: range out of order in character class at offset 4
877
878/a[]b/i
879Failed: missing terminating ] for character class at offset 4
880
881/a[/i
882Failed: missing terminating ] for character class at offset 2
883
884/*a/i
885Failed: nothing to repeat at offset 0
886
887/(*)b/i
888Failed: nothing to repeat at offset 1
889
890/abc)/i
891Failed: unmatched parentheses at offset 3
892
893/(abc/i
894Failed: missing ) at offset 4
895
896/a**/i
897Failed: nothing to repeat at offset 2
898
899/)(/i
900Failed: unmatched parentheses at offset 0
901
902/:(?:/
903Failed: missing ) at offset 4
904
905/(?<%)b/
906Failed: unrecognized character after (?< at offset 0
907
908/a(?{)b/
909Failed: unrecognized character after (? at offset 3
910
911/a(?{{})b/
912Failed: unrecognized character after (? at offset 3
913
914/a(?{}})b/
915Failed: unrecognized character after (? at offset 3
916
917/a(?{"{"})b/
918Failed: unrecognized character after (? at offset 3
919
920/a(?{"{"}})b/
921Failed: unrecognized character after (? at offset 3
922
923/(?(1?)a|b)/
924Failed: malformed number after (?( at offset 4
925
926/(?(1)a|b|c)/
927Failed: conditional group contains more than two branches at offset 10
928
929/[a[:xyz:/
930Failed: missing terminating ] for character class at offset 8
931
932/(?<=x+)y/
933Failed: lookbehind assertion is not fixed length at offset 6
934
935/a{37,17}/
936Failed: numbers out of order in {} quantifier at offset 7
937
938/abc/\
939Failed: \ at end of pattern at offset 4
940
941/abc/\P
942Failed: POSIX code 9: bad escape sequence at offset 4
943
944/abc/\i
945Failed: \ at end of pattern at offset 4
946
947/(a)bc(d)/
948Capturing subpattern count = 2
949No options
950First char = 'a'
951Need char = 'd'
952    abcd
953 0: abcd
954 1: a
955 2: d
956    abcd\C2
957 0: abcd
958 1: a
959 2: d
960 2C d (1)
961    abcd\C5
962 0: abcd
963 1: a
964 2: d
965copy substring 5 failed -7
966
967/(.{20})/
968Capturing subpattern count = 1
969No options
970No first char
971No need char
972    abcdefghijklmnopqrstuvwxyz
973 0: abcdefghijklmnopqrst
974 1: abcdefghijklmnopqrst
975    abcdefghijklmnopqrstuvwxyz\C1
976 0: abcdefghijklmnopqrst
977 1: abcdefghijklmnopqrst
978copy substring 1 failed -6
979    abcdefghijklmnopqrstuvwxyz\G1
980 0: abcdefghijklmnopqrst
981 1: abcdefghijklmnopqrst
982 1G abcdefghijklmnopqrst (20)
983
984/(.{15})/
985Capturing subpattern count = 1
986No options
987No first char
988No need char
989    abcdefghijklmnopqrstuvwxyz
990 0: abcdefghijklmno
991 1: abcdefghijklmno
992    abcdefghijklmnopqrstuvwxyz\C1\G1
993 0: abcdefghijklmno
994 1: abcdefghijklmno
995 1C abcdefghijklmno (15)
996 1G abcdefghijklmno (15)
997
998/(.{16})/
999Capturing subpattern count = 1
1000No options
1001No first char
1002No need char
1003    abcdefghijklmnopqrstuvwxyz
1004 0: abcdefghijklmnop
1005 1: abcdefghijklmnop
1006    abcdefghijklmnopqrstuvwxyz\C1\G1\L
1007 0: abcdefghijklmnop
1008 1: abcdefghijklmnop
1009copy substring 1 failed -6
1010 1G abcdefghijklmnop (16)
1011 0L abcdefghijklmnop
1012 1L abcdefghijklmnop
1013
1014/^(a|(bc))de(f)/
1015Capturing subpattern count = 3
1016Options: anchored
1017No first char
1018Need char = 'f'
1019    adef\G1\G2\G3\G4\L
1020 0: adef
1021 1: a
1022 2: <unset>
1023 3: f
1024 1G a (1)
1025 2G  (0)
1026 3G f (1)
1027get substring 4 failed -7
1028 0L adef
1029 1L a
1030 2L
1031 3L f
1032    bcdef\G1\G2\G3\G4\L
1033 0: bcdef
1034 1: bc
1035 2: bc
1036 3: f
1037 1G bc (2)
1038 2G bc (2)
1039 3G f (1)
1040get substring 4 failed -7
1041 0L bcdef
1042 1L bc
1043 2L bc
1044 3L f
1045    adefghijk\C0
1046 0: adef
1047 1: a
1048 2: <unset>
1049 3: f
1050 0C adef (4)
1051
1052/^abc\00def/
1053Capturing subpattern count = 0
1054Options: anchored
1055No first char
1056Need char = 'f'
1057    abc\00def\L\C0
1058 0: abc\x00def
1059 0C abc (7)
1060 0L abc
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/M
1065Memory allocation (code space): 428
1066Capturing subpattern count = 8
1067No options
1068First char = 'w'
1069Need char = 'd'
1070
1071/.*X/D
1072------------------------------------------------------------------
1073  0   8 Bra 0
1074  3     Any*
1075  5   1 X
1076  8   8 Ket
1077 11     End
1078------------------------------------------------------------------
1079Capturing subpattern count = 0
1080No options
1081First char at start or follows \n
1082Need char = 'X'
1083
1084/.*X/Ds
1085------------------------------------------------------------------
1086  0   8 Bra 0
1087  3     Any*
1088  5   1 X
1089  8   8 Ket
1090 11     End
1091------------------------------------------------------------------
1092Capturing subpattern count = 0
1093Options: anchored dotall
1094No first char
1095Need char = 'X'
1096
1097/(.*X|^B)/D
1098------------------------------------------------------------------
1099  0  21 Bra 0
1100  3   8 Bra 1
1101  6     Any*
1102  8   1 X
1103 11   7 Alt
1104 14     ^
1105 15   1 B
1106 18  15 Ket
1107 21  21 Ket
1108 24     End
1109------------------------------------------------------------------
1110Capturing subpattern count = 1
1111No options
1112First char at start or follows \n
1113No need char
1114
1115/(.*X|^B)/Ds
1116------------------------------------------------------------------
1117  0  21 Bra 0
1118  3   8 Bra 1
1119  6     Any*
1120  8   1 X
1121 11   7 Alt
1122 14     ^
1123 15   1 B
1124 18  15 Ket
1125 21  21 Ket
1126 24     End
1127------------------------------------------------------------------
1128Capturing subpattern count = 1
1129Options: anchored dotall
1130No first char
1131No need char
1132
1133/(?s)(.*X|^B)/D
1134------------------------------------------------------------------
1135  0  21 Bra 0
1136  3   8 Bra 1
1137  6     Any*
1138  8   1 X
1139 11   7 Alt
1140 14     ^
1141 15   1 B
1142 18  15 Ket
1143 21  21 Ket
1144 24     End
1145------------------------------------------------------------------
1146Capturing subpattern count = 1
1147Options: anchored dotall
1148No first char
1149No need char
1150
1151/(?s:.*X|^B)/D
1152------------------------------------------------------------------
1153  0  27 Bra 0
1154  3  10 Bra 0
1155  6  04 Opt
1156  8     Any*
1157 10   1 X
1158 13   9 Alt
1159 16  04 Opt
1160 18     ^
1161 19   1 B
1162 22  19 Ket
1163 25  00 Opt
1164 27  27 Ket
1165 30     End
1166------------------------------------------------------------------
1167Capturing subpattern count = 0
1168No options
1169First char at start or follows \n
1170No need char
1171
1172/\Biss\B/+
1173Capturing subpattern count = 0
1174No options
1175First char = 'i'
1176Need char = 's'
1177    Mississippi
1178 0: iss
1179 0+ issippi
1180
1181/\Biss\B/+P
1182    Mississippi
1183 0: iss
1184 0+ issippi
1185
1186/iss/G+
1187Capturing subpattern count = 0
1188No options
1189First char = 'i'
1190Need char = 's'
1191    Mississippi
1192 0: iss
1193 0+ issippi
1194 0: iss
1195 0+ ippi
1196
1197/\Biss\B/G+
1198Capturing subpattern count = 0
1199No options
1200First char = 'i'
1201Need char = 's'
1202    Mississippi
1203 0: iss
1204 0+ issippi
1205
1206/\Biss\B/g+
1207Capturing subpattern count = 0
1208No options
1209First char = 'i'
1210Need char = 's'
1211    Mississippi
1212 0: iss
1213 0+ issippi
1214 0: iss
1215 0+ ippi
1216    *** Failers
1217No match
1218    Mississippi\A
1219No match
1220
1221/(?<=[Ms])iss/g+
1222Capturing subpattern count = 0
1223No options
1224First char = 'i'
1225Need char = 's'
1226    Mississippi
1227 0: iss
1228 0+ issippi
1229 0: iss
1230 0+ ippi
1231
1232/(?<=[Ms])iss/G+
1233Capturing subpattern count = 0
1234No options
1235First char = 'i'
1236Need char = 's'
1237    Mississippi
1238 0: iss
1239 0+ issippi
1240
1241/^iss/g+
1242Capturing subpattern count = 0
1243Options: anchored
1244No first char
1245Need char = 's'
1246    ississippi
1247 0: iss
1248 0+ issippi
1249
1250/.*iss/g+
1251Capturing subpattern count = 0
1252No options
1253First char at start or follows \n
1254Need char = 's'
1255    abciss\nxyzisspqr
1256 0: abciss
1257 0+ \x0axyzisspqr
1258 0: xyziss
1259 0+ pqr
1260
1261/.i./+g
1262Capturing subpattern count = 0
1263No options
1264No first char
1265Need char = 'i'
1266    Mississippi
1267 0: Mis
1268 0+ sissippi
1269 0: sis
1270 0+ sippi
1271 0: sip
1272 0+ pi
1273    Mississippi\A
1274 0: Mis
1275 0+ sissippi
1276 0: sis
1277 0+ sippi
1278 0: sip
1279 0+ pi
1280    Missouri river
1281 0: Mis
1282 0+ souri river
1283 0: ri
1284 0+ river
1285 0: riv
1286 0+ er
1287    Missouri river\A
1288 0: Mis
1289 0+ souri river
1290
1291/^.is/+g
1292Capturing subpattern count = 0
1293Options: anchored
1294No first char
1295Need char = 's'
1296    Mississippi
1297 0: Mis
1298 0+ sissippi
1299
1300/^ab\n/g+
1301Capturing subpattern count = 0
1302Options: anchored
1303No first char
1304Need char = 10
1305    ab\nab\ncd
1306 0: ab\x0a
1307 0+ ab\x0acd
1308
1309/^ab\n/mg+
1310Capturing subpattern count = 0
1311Options: multiline
1312First char at start or follows \n
1313Need char = 10
1314    ab\nab\ncd
1315 0: ab\x0a
1316 0+ ab\x0acd
1317 0: ab\x0a
1318 0+ cd
1319
1320/abc/
1321Capturing subpattern count = 0
1322No options
1323First char = 'a'
1324Need char = 'c'
1325
1326/abc|bac/
1327Capturing subpattern count = 0
1328No options
1329No first char
1330Need char = 'c'
1331
1332/(abc|bac)/
1333Capturing subpattern count = 1
1334No options
1335No first char
1336Need char = 'c'
1337
1338/(abc|(c|dc))/
1339Capturing subpattern count = 2
1340No options
1341No first char
1342Need char = 'c'
1343
1344/(abc|(d|de)c)/
1345Capturing subpattern count = 2
1346No options
1347No first char
1348Need char = 'c'
1349
1350/a*/
1351Capturing subpattern count = 0
1352No options
1353No first char
1354No need char
1355
1356/a+/
1357Capturing subpattern count = 0
1358No options
1359First char = 'a'
1360No need char
1361
1362/(baa|a+)/
1363Capturing subpattern count = 1
1364No options
1365No first char
1366Need char = 'a'
1367
1368/a{0,3}/
1369Capturing subpattern count = 0
1370No options
1371No first char
1372No need char
1373
1374/baa{3,}/
1375Capturing subpattern count = 0
1376No options
1377First char = 'b'
1378Need char = 'a'
1379
1380/"([^\\"]+|\\.)*"/
1381Capturing subpattern count = 1
1382No options
1383First char = '"'
1384Need char = '"'
1385
1386/(abc|ab[cd])/
1387Capturing subpattern count = 1
1388No options
1389First char = 'a'
1390No need char
1391
1392/(a|.)/
1393Capturing subpattern count = 1
1394No options
1395No first char
1396No need char
1397
1398/a|ba|\w/
1399Capturing subpattern count = 0
1400No options
1401No first char
1402No need char
1403
1404/abc(?=pqr)/
1405Capturing subpattern count = 0
1406No options
1407First char = 'a'
1408Need char = 'r'
1409
1410/...(?<=abc)/
1411Capturing subpattern count = 0
1412No options
1413No first char
1414No need char
1415
1416/abc(?!pqr)/
1417Capturing subpattern count = 0
1418No options
1419First char = 'a'
1420Need char = 'c'
1421
1422/ab./
1423Capturing subpattern count = 0
1424No options
1425First char = 'a'
1426Need char = 'b'
1427
1428/ab[xyz]/
1429Capturing subpattern count = 0
1430No options
1431First char = 'a'
1432Need char = 'b'
1433
1434/abc*/
1435Capturing subpattern count = 0
1436No options
1437First char = 'a'
1438Need char = 'b'
1439
1440/ab.c*/
1441Capturing subpattern count = 0
1442No options
1443First char = 'a'
1444Need char = 'b'
1445
1446/a.c*/
1447Capturing subpattern count = 0
1448No options
1449First char = 'a'
1450No need char
1451
1452/.c*/
1453Capturing subpattern count = 0
1454No options
1455No first char
1456No need char
1457
1458/ac*/
1459Capturing subpattern count = 0
1460No options
1461First char = 'a'
1462No need char
1463
1464/(a.c*|b.c*)/
1465Capturing subpattern count = 1
1466No options
1467No first char
1468No need char
1469
1470/a.c*|aba/
1471Capturing subpattern count = 0
1472No options
1473First char = 'a'
1474No need char
1475
1476/.+a/
1477Capturing subpattern count = 0
1478No options
1479No first char
1480Need char = 'a'
1481
1482/(?=abcda)a.*/
1483Capturing subpattern count = 0
1484No options
1485First char = 'a'
1486No need char
1487
1488/(?=a)a.*/
1489Capturing subpattern count = 0
1490No options
1491First char = 'a'
1492No need char
1493
1494/a(b)*/
1495Capturing subpattern count = 1
1496No options
1497First char = 'a'
1498No need char
1499
1500/a\d*/
1501Capturing subpattern count = 0
1502No options
1503First char = 'a'
1504No need char
1505
1506/ab\d*/
1507Capturing subpattern count = 0
1508No options
1509First char = 'a'
1510Need char = 'b'
1511
1512/a(\d)*/
1513Capturing subpattern count = 1
1514No options
1515First char = 'a'
1516No need char
1517
1518/abcde{0,0}/
1519Capturing subpattern count = 0
1520No options
1521First char = 'a'
1522Need char = 'd'
1523
1524/ab\d+/
1525Capturing subpattern count = 0
1526No options
1527First char = 'a'
1528Need char = 'b'
1529
1530/a(?(1)b)/
1531Capturing subpattern count = 0
1532No options
1533First char = 'a'
1534No need char
1535
1536/a(?(1)bag|big)/
1537Capturing subpattern count = 0
1538No options
1539First char = 'a'
1540Need char = 'g'
1541
1542/a(?(1)bag|big)*/
1543Capturing subpattern count = 0
1544No options
1545First char = 'a'
1546No need char
1547
1548/a(?(1)bag|big)+/
1549Capturing subpattern count = 0
1550No options
1551First char = 'a'
1552Need char = 'g'
1553
1554/a(?(1)b..|b..)/
1555Capturing subpattern count = 0
1556No options
1557First char = 'a'
1558Need char = 'b'
1559
1560/ab\d{0}e/
1561Capturing subpattern count = 0
1562No options
1563First char = 'a'
1564Need char = 'e'
1565
1566/a?b?/
1567Capturing subpattern count = 0
1568No options
1569No first char
1570No need char
1571    a
1572 0: a
1573    b
1574 0: b
1575    ab
1576 0: ab
1577    \
1578 0:
1579    *** Failers
1580 0:
1581    \N
1582No match
1583
1584/|-/
1585Capturing subpattern count = 0
1586No options
1587No first char
1588No need char
1589    abcd
1590 0:
1591    -abc
1592 0:
1593    \Nab-c
1594 0: -
1595    *** Failers
1596 0:
1597    \Nabc
1598No match
1599
1600/a*(b+)(z)(z)/P
1601    aaaabbbbzzzz
1602 0: aaaabbbbzz
1603 1: bbbb
1604 2: z
1605 3: z
1606    aaaabbbbzzzz\O0
1607    aaaabbbbzzzz\O1
1608 0: aaaabbbbzz
1609    aaaabbbbzzzz\O2
1610 0: aaaabbbbzz
1611 1: bbbb
1612    aaaabbbbzzzz\O3
1613 0: aaaabbbbzz
1614 1: bbbb
1615 2: z
1616    aaaabbbbzzzz\O4
1617 0: aaaabbbbzz
1618 1: bbbb
1619 2: z
1620 3: z
1621    aaaabbbbzzzz\O5
1622 0: aaaabbbbzz
1623 1: bbbb
1624 2: z
1625 3: z
1626
1627/^.?abcd/S
1628Capturing subpattern count = 0
1629Options: anchored
1630No first char
1631Need char = 'd'
1632Study returned NULL
1633
1634/\(             # ( at start
1635  (?:           # Non-capturing bracket
1636  (?>[^()]+)    # Either a sequence of non-brackets (no backtracking)
1637  |             # Or
1638  (?R)          # Recurse - i.e. nested bracketed string
1639  )*            # Zero or more contents
1640  \)            # Closing )
1641  /x
1642Capturing subpattern count = 0
1643Options: extended
1644First char = '('
1645Need char = ')'
1646    (abcd)
1647 0: (abcd)
1648    (abcd)xyz
1649 0: (abcd)
1650    xyz(abcd)
1651 0: (abcd)
1652    (ab(xy)cd)pqr
1653 0: (ab(xy)cd)
1654    (ab(xycd)pqr
1655 0: (xycd)
1656    () abc ()
1657 0: ()
1658    12(abcde(fsh)xyz(foo(bar))lmno)89
1659 0: (abcde(fsh)xyz(foo(bar))lmno)
1660    *** Failers
1661No match
1662    abcd
1663No match
1664    abcd)
1665No match
1666    (abcd
1667No match
1668
1669/\(  ( (?>[^()]+) | (?R) )* \) /xg
1670Capturing subpattern count = 1
1671Options: extended
1672First char = '('
1673Need char = ')'
1674    (ab(xy)cd)pqr
1675 0: (ab(xy)cd)
1676 1: cd
1677    1(abcd)(x(y)z)pqr
1678 0: (abcd)
1679 1: abcd
1680 0: (x(y)z)
1681 1: z
1682
1683/\(  (?: (?>[^()]+) | (?R) ) \) /x
1684Capturing subpattern count = 0
1685Options: extended
1686First char = '('
1687Need char = ')'
1688    (abcd)
1689 0: (abcd)
1690    (ab(xy)cd)
1691 0: (xy)
1692    (a(b(c)d)e)
1693 0: (c)
1694    ((ab))
1695 0: ((ab))
1696    *** Failers
1697No match
1698    ()
1699No match
1700
1701/\(  (?: (?>[^()]+) | (?R) )? \) /x
1702Capturing subpattern count = 0
1703Options: extended
1704First char = '('
1705Need char = ')'
1706    ()
1707 0: ()
1708    12(abcde(fsh)xyz(foo(bar))lmno)89
1709 0: (fsh)
1710
1711/\(  ( (?>[^()]+) | (?R) )* \) /x
1712Capturing subpattern count = 1
1713Options: extended
1714First char = '('
1715Need char = ')'
1716    (ab(xy)cd)
1717 0: (ab(xy)cd)
1718 1: cd
1719
1720/\( ( ( (?>[^()]+) | (?R) )* ) \) /x
1721Capturing subpattern count = 2
1722Options: extended
1723First char = '('
1724Need char = ')'
1725    (ab(xy)cd)
1726 0: (ab(xy)cd)
1727 1: ab(xy)cd
1728 2: cd
1729
1730/\( (123)? ( ( (?>[^()]+) | (?R) )* ) \) /x
1731Capturing subpattern count = 3
1732Options: extended
1733First char = '('
1734Need char = ')'
1735    (ab(xy)cd)
1736 0: (ab(xy)cd)
1737 1: <unset>
1738 2: ab(xy)cd
1739 3: cd
1740    (123ab(xy)cd)
1741 0: (123ab(xy)cd)
1742 1: 123
1743 2: ab(xy)cd
1744 3: cd
1745
1746/\( ( (123)? ( (?>[^()]+) | (?R) )* ) \) /x
1747Capturing subpattern count = 3
1748Options: extended
1749First char = '('
1750Need char = ')'
1751    (ab(xy)cd)
1752 0: (ab(xy)cd)
1753 1: ab(xy)cd
1754 2: <unset>
1755 3: cd
1756    (123ab(xy)cd)
1757 0: (123ab(xy)cd)
1758 1: 123ab(xy)cd
1759 2: 123
1760 3: cd
1761
1762/\( (((((((((( ( (?>[^()]+) | (?R) )* )))))))))) \) /x
1763Capturing subpattern count = 11
1764Options: extended
1765First char = '('
1766Need char = ')'
1767    (ab(xy)cd)
1768 0: (ab(xy)cd)
1769 1: ab(xy)cd
1770 2: ab(xy)cd
1771 3: ab(xy)cd
1772 4: ab(xy)cd
1773 5: ab(xy)cd
1774 6: ab(xy)cd
1775 7: ab(xy)cd
1776 8: ab(xy)cd
1777 9: ab(xy)cd
177810: ab(xy)cd
177911: cd
1780
1781/\( ( ( (?>[^()<>]+) | ((?>[^()]+)) | (?R) )* ) \) /x
1782Capturing subpattern count = 3
1783Options: extended
1784First char = '('
1785Need char = ')'
1786    (abcd(xyz<p>qrs)123)
1787 0: (abcd(xyz<p>qrs)123)
1788 1: abcd(xyz<p>qrs)123
1789 2: 123
1790 3: <p>qrs
1791
1792/\( ( ( (?>[^()]+) | ((?R)) )* ) \) /x
1793Capturing subpattern count = 3
1794Options: extended
1795First char = '('
1796Need char = ')'
1797    (ab(cd)ef)
1798 0: (ab(cd)ef)
1799 1: ab(cd)ef
1800 2: ef
1801 3: (cd)
1802    (ab(cd(ef)gh)ij)
1803 0: (ab(cd(ef)gh)ij)
1804 1: ab(cd(ef)gh)ij
1805 2: ij
1806 3: (cd(ef)gh)
1807
1808/^[[:alnum:]]/D
1809------------------------------------------------------------------
1810  0  37 Bra 0
1811  3     ^
1812  4     [0-9A-Za-z]
1813 37  37 Ket
1814 40     End
1815------------------------------------------------------------------
1816Capturing subpattern count = 0
1817Options: anchored
1818No first char
1819No need char
1820
1821/^[[:alpha:]]/D
1822------------------------------------------------------------------
1823  0  37 Bra 0
1824  3     ^
1825  4     [A-Za-z]
1826 37  37 Ket
1827 40     End
1828------------------------------------------------------------------
1829Capturing subpattern count = 0
1830Options: anchored
1831No first char
1832No need char
1833
1834/^[[:ascii:]]/D
1835------------------------------------------------------------------
1836  0  37 Bra 0
1837  3     ^
1838  4     [\x00-\x7f]
1839 37  37 Ket
1840 40     End
1841------------------------------------------------------------------
1842Capturing subpattern count = 0
1843Options: anchored
1844No first char
1845No need char
1846
1847/^[[:cntrl:]]/D
1848------------------------------------------------------------------
1849  0  37 Bra 0
1850  3     ^
1851  4     [\x00-\x1f\x7f]
1852 37  37 Ket
1853 40     End
1854------------------------------------------------------------------
1855Capturing subpattern count = 0
1856Options: anchored
1857No first char
1858No need char
1859
1860/^[[:digit:]]/D
1861------------------------------------------------------------------
1862  0  37 Bra 0
1863  3     ^
1864  4     [0-9]
1865 37  37 Ket
1866 40     End
1867------------------------------------------------------------------
1868Capturing subpattern count = 0
1869Options: anchored
1870No first char
1871No need char
1872
1873/^[[:graph:]]/D
1874------------------------------------------------------------------
1875  0  37 Bra 0
1876  3     ^
1877  4     [!-~]
1878 37  37 Ket
1879 40     End
1880------------------------------------------------------------------
1881Capturing subpattern count = 0
1882Options: anchored
1883No first char
1884No need char
1885
1886/^[[:lower:]]/D
1887------------------------------------------------------------------
1888  0  37 Bra 0
1889  3     ^
1890  4     [a-z]
1891 37  37 Ket
1892 40     End
1893------------------------------------------------------------------
1894Capturing subpattern count = 0
1895Options: anchored
1896No first char
1897No need char
1898
1899/^[[:print:]]/D
1900------------------------------------------------------------------
1901  0  37 Bra 0
1902  3     ^
1903  4     [ -~]
1904 37  37 Ket
1905 40     End
1906------------------------------------------------------------------
1907Capturing subpattern count = 0
1908Options: anchored
1909No first char
1910No need char
1911
1912/^[[:punct:]]/D
1913------------------------------------------------------------------
1914  0  37 Bra 0
1915  3     ^
1916  4     [!-/:-@[-`{-~]
1917 37  37 Ket
1918 40     End
1919------------------------------------------------------------------
1920Capturing subpattern count = 0
1921Options: anchored
1922No first char
1923No need char
1924
1925/^[[:space:]]/D
1926------------------------------------------------------------------
1927  0  37 Bra 0
1928  3     ^
1929  4     [\x09-\x0d ]
1930 37  37 Ket
1931 40     End
1932------------------------------------------------------------------
1933Capturing subpattern count = 0
1934Options: anchored
1935No first char
1936No need char
1937
1938/^[[:upper:]]/D
1939------------------------------------------------------------------
1940  0  37 Bra 0
1941  3     ^
1942  4     [A-Z]
1943 37  37 Ket
1944 40     End
1945------------------------------------------------------------------
1946Capturing subpattern count = 0
1947Options: anchored
1948No first char
1949No need char
1950
1951/^[[:xdigit:]]/D
1952------------------------------------------------------------------
1953  0  37 Bra 0
1954  3     ^
1955  4     [0-9A-Fa-f]
1956 37  37 Ket
1957 40     End
1958------------------------------------------------------------------
1959Capturing subpattern count = 0
1960Options: anchored
1961No first char
1962No need char
1963
1964/^[[:word:]]/D
1965------------------------------------------------------------------
1966  0  37 Bra 0
1967  3     ^
1968  4     [0-9A-Z_a-z]
1969 37  37 Ket
1970 40     End
1971------------------------------------------------------------------
1972Capturing subpattern count = 0
1973Options: anchored
1974No first char
1975No need char
1976
1977/^[[:^cntrl:]]/D
1978------------------------------------------------------------------
1979  0  37 Bra 0
1980  3     ^
1981  4     [ -~\x80-\xff]
1982 37  37 Ket
1983 40     End
1984------------------------------------------------------------------
1985Capturing subpattern count = 0
1986Options: anchored
1987No first char
1988No need char
1989
1990/^[12[:^digit:]]/D
1991------------------------------------------------------------------
1992  0  37 Bra 0
1993  3     ^
1994  4     [\x00-/1-2:-\xff]
1995 37  37 Ket
1996 40     End
1997------------------------------------------------------------------
1998Capturing subpattern count = 0
1999Options: anchored
2000No first char
2001No need char
2002
2003/[01[:alpha:]%]/D
2004------------------------------------------------------------------
2005  0  36 Bra 0
2006  3     [%0-1A-Za-z]
2007 36  36 Ket
2008 39     End
2009------------------------------------------------------------------
2010Capturing subpattern count = 0
2011No options
2012No first char
2013No need char
2014
2015/[[.ch.]]/
2016Failed: POSIX collating elements are not supported at offset 1
2017
2018/[[=ch=]]/
2019Failed: POSIX collating elements are not supported at offset 1
2020
2021/[[:rhubarb:]]/
2022Failed: unknown POSIX class name at offset 3
2023
2024/[[:upper:]]/i
2025Capturing subpattern count = 0
2026Options: caseless
2027No first char
2028No need char
2029    A
2030 0: A
2031    a
2032 0: a
2033
2034/[[:lower:]]/i
2035Capturing subpattern count = 0
2036Options: caseless
2037No first char
2038No need char
2039    A
2040 0: A
2041    a
2042 0: a
2043
2044/((?-i)[[:lower:]])[[:lower:]]/i
2045Capturing subpattern count = 1
2046Options: caseless
2047Case state changes
2048No first char
2049No need char
2050    ab
2051 0: ab
2052 1: a
2053    aB
2054 0: aB
2055 1: a
2056    *** Failers
2057 0: ai
2058 1: a
2059    Ab
2060No match
2061    AB
2062No match
2063
2064/[\200-\410]/
2065Failed: range out of order in character class at offset 9
2066
2067/^(?(0)f|b)oo/
2068Failed: invalid condition (?(0) at offset 5
2069
2070/ End of testinput2 /
2071Capturing subpattern count = 0
2072No options
2073First char = ' '
2074Need char = ' '
2075
2076