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

Contents of /code/trunk/testdata/testoutput2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 713 - (hide annotations) (download)
Tue Sep 27 11:03:15 2011 UTC (3 years, 1 month ago) by ph10
File size: 246126 byte(s)
Fix bug with (*THEN) in a subroutine/recursion.

1 ph10 450 /-- This set of tests is not Perl-compatible. It checks on special features
2     of PCRE's API, error diagnostics, and the compiled code of some patterns.
3     It also checks the non-Perl syntax the PCRE supports (Python, .NET,
4     Oniguruma). Finally, there are some tests where PCRE and Perl differ,
5 ph10 513 either because PCRE can't be compatible, or there is a possible Perl
6 ph10 450 bug. --/
7    
8 ph10 559 /-- Originally, the Perl >= 5.10 things were in here too, but now I have
9 ph10 513 separated many (most?) of them out into test 11. However, there may still
10     be some that were overlooked. --/
11 ph10 450
12 nigel 93 /(a)b|/I
13 nigel 43 Capturing subpattern count = 1
14 nigel 41 No options
15     No first char
16 nigel 43 No need char
17 nigel 41
18 nigel 93 /abc/I
19 nigel 43 Capturing subpattern count = 0
20 nigel 41 No options
21     First char = 'a'
22 nigel 43 Need char = 'c'
23 nigel 41 abc
24     0: abc
25     defabc
26     0: abc
27     \Aabc
28     0: abc
29     *** Failers
30     No match
31     \Adefabc
32     No match
33     ABC
34     No match
35    
36 nigel 93 /^abc/I
37 nigel 43 Capturing subpattern count = 0
38 nigel 41 Options: anchored
39     No first char
40 nigel 65 No need char
41 nigel 41 abc
42     0: abc
43     \Aabc
44     0: abc
45     *** Failers
46     No match
47     defabc
48     No match
49     \Adefabc
50     No match
51    
52 nigel 93 /a+bc/I
53 nigel 43 Capturing subpattern count = 0
54 nigel 41 No options
55     First char = 'a'
56 nigel 43 Need char = 'c'
57 nigel 41
58 nigel 93 /a*bc/I
59 nigel 43 Capturing subpattern count = 0
60 nigel 41 No options
61     No first char
62 nigel 43 Need char = 'c'
63 nigel 41
64 nigel 93 /a{3}bc/I
65 nigel 43 Capturing subpattern count = 0
66 nigel 41 No options
67     First char = 'a'
68 nigel 43 Need char = 'c'
69 nigel 41
70 nigel 93 /(abc|a+z)/I
71 nigel 43 Capturing subpattern count = 1
72 nigel 41 No options
73     First char = 'a'
74 nigel 43 No need char
75 nigel 41
76 nigel 93 /^abc$/I
77 nigel 43 Capturing subpattern count = 0
78 nigel 41 Options: anchored
79     No first char
80 nigel 65 No need char
81 nigel 41 abc
82     0: abc
83     *** Failers
84     No match
85     def\nabc
86     No match
87    
88 ph10 178 /ab\idef/X
89 nigel 41 Failed: unrecognized character follows \ at offset 3
90    
91 ph10 178 /(?X)ab\idef/X
92 nigel 41 Failed: unrecognized character follows \ at offset 7
93    
94     /x{5,4}/
95     Failed: numbers out of order in {} quantifier at offset 5
96    
97     /z{65536}/
98     Failed: number too big in {} quantifier at offset 7
99    
100     /[abcd/
101     Failed: missing terminating ] for character class at offset 5
102    
103 nigel 63 /(?X)[\B]/
104     Failed: invalid escape sequence in character class at offset 6
105 nigel 41
106 ph10 513 /(?X)[\R]/
107     Failed: invalid escape sequence in character class at offset 6
108    
109     /(?X)[\X]/
110     Failed: invalid escape sequence in character class at offset 6
111    
112     /[\B]/BZ
113     ------------------------------------------------------------------
114     Bra
115     B
116     Ket
117     End
118     ------------------------------------------------------------------
119    
120     /[\R]/BZ
121     ------------------------------------------------------------------
122     Bra
123     R
124     Ket
125     End
126     ------------------------------------------------------------------
127    
128     /[\X]/BZ
129     ------------------------------------------------------------------
130     Bra
131     X
132     Ket
133     End
134     ------------------------------------------------------------------
135    
136 nigel 41 /[z-a]/
137     Failed: range out of order in character class at offset 3
138    
139     /^*/
140     Failed: nothing to repeat at offset 1
141    
142     /(abc/
143     Failed: missing ) at offset 4
144    
145     /(?# abc/
146     Failed: missing ) after comment at offset 7
147    
148     /(?z)abc/
149 ph10 269 Failed: unrecognized character after (? or (?- at offset 2
150 nigel 41
151 nigel 93 /.*b/I
152 nigel 43 Capturing subpattern count = 0
153 nigel 41 No options
154 nigel 91 First char at start or follows newline
155 nigel 43 Need char = 'b'
156 nigel 41
157 nigel 93 /.*?b/I
158 nigel 43 Capturing subpattern count = 0
159 nigel 41 No options
160 nigel 91 First char at start or follows newline
161 nigel 43 Need char = 'b'
162 nigel 41
163 nigel 93 /cat|dog|elephant/I
164 nigel 43 Capturing subpattern count = 0
165 nigel 41 No options
166     No first char
167 nigel 43 No need char
168 nigel 41 this sentence eventually mentions a cat
169     0: cat
170     this sentences rambles on and on for a while and then reaches elephant
171     0: elephant
172    
173 nigel 93 /cat|dog|elephant/IS
174 nigel 43 Capturing subpattern count = 0
175 nigel 41 No options
176     No first char
177 nigel 43 No need char
178 ph10 455 Subject length lower bound = 3
179 nigel 75 Starting byte set: c d e
180 nigel 41 this sentence eventually mentions a cat
181     0: cat
182     this sentences rambles on and on for a while and then reaches elephant
183     0: elephant
184    
185 nigel 93 /cat|dog|elephant/IiS
186 nigel 43 Capturing subpattern count = 0
187 nigel 41 Options: caseless
188     No first char
189 nigel 43 No need char
190 ph10 455 Subject length lower bound = 3
191 nigel 75 Starting byte set: C D E c d e
192 nigel 41 this sentence eventually mentions a CAT cat
193     0: CAT
194     this sentences rambles on and on for a while to elephant ElePhant
195     0: elephant
196    
197 nigel 93 /a|[bcd]/IS
198 nigel 43 Capturing subpattern count = 0
199 nigel 41 No options
200     No first char
201 nigel 43 No need char
202 ph10 455 Subject length lower bound = 1
203 nigel 75 Starting byte set: a b c d
204 nigel 41
205 nigel 93 /(a|[^\dZ])/IS
206 nigel 43 Capturing subpattern count = 1
207 nigel 41 No options
208     No first char
209 nigel 43 No need char
210 ph10 455 Subject length lower bound = 1
211 nigel 75 Starting byte set: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
212 nigel 41 \x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
213     \x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / : ; < = >
214     ? @ 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
215     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
216     \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92
217     \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1
218     \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0
219     \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf
220     \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce
221     \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd
222     \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec
223     \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb
224     \xfc \xfd \xfe \xff
225    
226 nigel 93 /(a|b)*[\s]/IS
227 nigel 43 Capturing subpattern count = 1
228 nigel 41 No options
229     No first char
230 nigel 43 No need char
231 ph10 455 Subject length lower bound = 1
232 nigel 75 Starting byte set: \x09 \x0a \x0c \x0d \x20 a b
233 nigel 41
234     /(ab\2)/
235 nigel 63 Failed: reference to non-existent subpattern at offset 6
236 nigel 41
237     /{4,5}abc/
238     Failed: nothing to repeat at offset 4
239    
240 nigel 93 /(a)(b)(c)\2/I
241 nigel 43 Capturing subpattern count = 3
242     Max back reference = 2
243 nigel 41 No options
244     First char = 'a'
245 nigel 43 Need char = 'c'
246 nigel 41 abcb
247     0: abcb
248     1: a
249     2: b
250     3: c
251     \O0abcb
252     Matched, but too many substrings
253     \O3abcb
254     Matched, but too many substrings
255     0: abcb
256     \O6abcb
257     Matched, but too many substrings
258     0: abcb
259     1: a
260     \O9abcb
261     Matched, but too many substrings
262     0: abcb
263     1: a
264     2: b
265 ph10 102 \O12abcb
266 nigel 41 0: abcb
267     1: a
268     2: b
269     3: c
270    
271 nigel 93 /(a)bc|(a)(b)\2/I
272 nigel 43 Capturing subpattern count = 3
273     Max back reference = 2
274 nigel 41 No options
275     First char = 'a'
276 nigel 43 No need char
277 nigel 41 abc
278     0: abc
279     1: a
280     \O0abc
281     Matched, but too many substrings
282     \O3abc
283     Matched, but too many substrings
284     0: abc
285     \O6abc
286     0: abc
287     1: a
288     aba
289     0: aba
290     1: <unset>
291     2: a
292     3: b
293     \O0aba
294     Matched, but too many substrings
295     \O3aba
296     Matched, but too many substrings
297     0: aba
298     \O6aba
299     Matched, but too many substrings
300     0: aba
301     1: <unset>
302     \O9aba
303     Matched, but too many substrings
304     0: aba
305     1: <unset>
306     2: a
307     \O12aba
308     0: aba
309     1: <unset>
310     2: a
311     3: b
312    
313 nigel 93 /abc$/IE
314 nigel 43 Capturing subpattern count = 0
315 nigel 41 Options: dollar_endonly
316     First char = 'a'
317 nigel 43 Need char = 'c'
318 nigel 41 abc
319     0: abc
320     *** Failers
321     No match
322     abc\n
323     No match
324     abc\ndef
325     No match
326    
327     /(a)(b)(c)(d)(e)\6/
328 nigel 63 Failed: reference to non-existent subpattern at offset 17
329 nigel 41
330 nigel 93 /the quick brown fox/I
331 nigel 43 Capturing subpattern count = 0
332 nigel 41 No options
333     First char = 't'
334 nigel 43 Need char = 'x'
335 nigel 41 the quick brown fox
336     0: the quick brown fox
337     this is a line with the quick brown fox
338     0: the quick brown fox
339    
340 nigel 93 /the quick brown fox/IA
341 nigel 43 Capturing subpattern count = 0
342 nigel 41 Options: anchored
343     No first char
344 nigel 65 No need char
345 nigel 41 the quick brown fox
346     0: the quick brown fox
347     *** Failers
348     No match
349     this is a line with the quick brown fox
350     No match
351    
352     /ab(?z)cd/
353 ph10 269 Failed: unrecognized character after (? or (?- at offset 4
354 nigel 41
355 nigel 93 /^abc|def/I
356 nigel 43 Capturing subpattern count = 0
357 nigel 41 No options
358     No first char
359 nigel 43 No need char
360 nigel 41 abcdef
361     0: abc
362     abcdef\B
363     0: def
364    
365 nigel 93 /.*((abc)$|(def))/I
366 nigel 43 Capturing subpattern count = 3
367 nigel 41 No options
368 nigel 91 First char at start or follows newline
369 nigel 43 No need char
370 nigel 41 defabc
371     0: defabc
372     1: abc
373     2: abc
374     \Zdefabc
375     0: def
376     1: def
377     2: <unset>
378     3: def
379    
380 ph10 432 /abc/P
381 nigel 41 abc
382     0: abc
383     *** Failers
384     No match: POSIX code 17: match failed
385 ph10 102
386 ph10 432 /^abc|def/P
387 nigel 41 abcdef
388     0: abc
389     abcdef\B
390     0: def
391    
392 ph10 432 /.*((abc)$|(def))/P
393 nigel 41 defabc
394     0: defabc
395     1: abc
396     2: abc
397     \Zdefabc
398     0: def
399     1: def
400     3: def
401 ph10 102
402 ph10 432 /the quick brown fox/P
403 nigel 41 the quick brown fox
404     0: the quick brown fox
405 ph10 102 *** Failers
406 nigel 41 No match: POSIX code 17: match failed
407 ph10 102 The Quick Brown Fox
408 nigel 41 No match: POSIX code 17: match failed
409    
410 ph10 432 /the quick brown fox/Pi
411 nigel 41 the quick brown fox
412     0: the quick brown fox
413 ph10 102 The Quick Brown Fox
414 nigel 41 0: The Quick Brown Fox
415    
416 ph10 432 /abc.def/P
417 nigel 41 *** Failers
418     No match: POSIX code 17: match failed
419     abc\ndef
420     No match: POSIX code 17: match failed
421 ph10 102
422 ph10 432 /abc$/P
423 nigel 41 abc
424     0: abc
425 ph10 102 abc\n
426 nigel 41 0: abc
427    
428 ph10 432 /(abc)\2/P
429 nigel 41 Failed: POSIX code 15: bad back reference at offset 7
430    
431 ph10 432 /(abc\1)/P
432 nigel 41 abc
433     No match: POSIX code 17: match failed
434    
435     /)/
436     Failed: unmatched parentheses at offset 0
437    
438     /a[]b/
439     Failed: missing terminating ] for character class at offset 4
440    
441 nigel 93 /[^aeiou ]{3,}/I
442 nigel 43 Capturing subpattern count = 0
443 nigel 41 No options
444     No first char
445 nigel 43 No need char
446 ph10 102 co-processors, and for
447 nigel 41 0: -pr
448 ph10 102
449 nigel 93 /<.*>/I
450 nigel 43 Capturing subpattern count = 0
451 nigel 41 No options
452     First char = '<'
453 nigel 43 Need char = '>'
454 nigel 41 abc<def>ghi<klm>nop
455     0: <def>ghi<klm>
456    
457 nigel 93 /<.*?>/I
458 nigel 43 Capturing subpattern count = 0
459 nigel 41 No options
460     First char = '<'
461 nigel 43 Need char = '>'
462 nigel 41 abc<def>ghi<klm>nop
463     0: <def>
464    
465 nigel 93 /<.*>/IU
466 nigel 43 Capturing subpattern count = 0
467 nigel 41 Options: ungreedy
468     First char = '<'
469 nigel 43 Need char = '>'
470 nigel 41 abc<def>ghi<klm>nop
471     0: <def>
472 ph10 102
473 nigel 93 /(?U)<.*>/I
474 nigel 43 Capturing subpattern count = 0
475 nigel 41 Options: ungreedy
476     First char = '<'
477 nigel 43 Need char = '>'
478 nigel 41 abc<def>ghi<klm>nop
479     0: <def>
480    
481 nigel 93 /<.*?>/IU
482 nigel 43 Capturing subpattern count = 0
483 nigel 41 Options: ungreedy
484     First char = '<'
485 nigel 43 Need char = '>'
486 nigel 41 abc<def>ghi<klm>nop
487     0: <def>ghi<klm>
488 ph10 102
489 nigel 93 /={3,}/IU
490 nigel 43 Capturing subpattern count = 0
491 nigel 41 Options: ungreedy
492     First char = '='
493 nigel 43 Need char = '='
494 nigel 41 abc========def
495     0: ===
496 ph10 102
497 nigel 93 /(?U)={3,}?/I
498 nigel 43 Capturing subpattern count = 0
499 nigel 41 Options: ungreedy
500     First char = '='
501 nigel 43 Need char = '='
502 nigel 41 abc========def
503     0: ========
504 ph10 102
505 nigel 93 /(?<!bar|cattle)foo/I
506 nigel 43 Capturing subpattern count = 0
507 nigel 41 No options
508     First char = 'f'
509 nigel 43 Need char = 'o'
510 nigel 41 foo
511     0: foo
512 ph10 102 catfoo
513 nigel 41 0: foo
514     *** Failers
515     No match
516     the barfoo
517     No match
518 ph10 102 and cattlefoo
519 nigel 41 No match
520    
521     /(?<=a+)b/
522     Failed: lookbehind assertion is not fixed length at offset 6
523    
524     /(?<=aaa|b{0,3})b/
525     Failed: lookbehind assertion is not fixed length at offset 14
526    
527     /(?<!(foo)a\1)bar/
528     Failed: lookbehind assertion is not fixed length at offset 12
529    
530 nigel 93 /(?i)abc/I
531 nigel 43 Capturing subpattern count = 0
532 nigel 41 Options: caseless
533 nigel 63 First char = 'a' (caseless)
534     Need char = 'c' (caseless)
535 nigel 41
536 nigel 93 /(a|(?m)a)/I
537 nigel 43 Capturing subpattern count = 1
538 nigel 41 No options
539     First char = 'a'
540 nigel 43 No need char
541 nigel 41
542 nigel 93 /(?i)^1234/I
543 nigel 43 Capturing subpattern count = 0
544 nigel 41 Options: anchored caseless
545     No first char
546 nigel 65 No need char
547 nigel 41
548 nigel 93 /(^b|(?i)^d)/I
549 nigel 43 Capturing subpattern count = 1
550 nigel 41 Options: anchored
551     No first char
552 nigel 43 No need char
553 nigel 41
554 nigel 93 /(?s).*/I
555 nigel 43 Capturing subpattern count = 0
556 nigel 41 Options: anchored dotall
557     No first char
558 nigel 43 No need char
559 nigel 41
560 nigel 93 /[abcd]/IS
561 nigel 43 Capturing subpattern count = 0
562 nigel 41 No options
563     No first char
564 nigel 43 No need char
565 ph10 455 Subject length lower bound = 1
566 nigel 75 Starting byte set: a b c d
567 nigel 41
568 nigel 93 /(?i)[abcd]/IS
569 nigel 43 Capturing subpattern count = 0
570 nigel 41 Options: caseless
571     No first char
572 nigel 43 No need char
573 ph10 455 Subject length lower bound = 1
574 nigel 75 Starting byte set: A B C D a b c d
575 nigel 41
576 nigel 93 /(?m)[xy]|(b|c)/IS
577 nigel 43 Capturing subpattern count = 1
578 nigel 41 Options: multiline
579     No first char
580 nigel 43 No need char
581 ph10 455 Subject length lower bound = 1
582 nigel 75 Starting byte set: b c x y
583 nigel 41
584 nigel 93 /(^a|^b)/Im
585 nigel 43 Capturing subpattern count = 1
586 nigel 41 Options: multiline
587 nigel 91 First char at start or follows newline
588 nigel 43 No need char
589 nigel 41
590 nigel 93 /(?i)(^a|^b)/Im
591 nigel 43 Capturing subpattern count = 1
592 nigel 41 Options: caseless multiline
593 nigel 91 First char at start or follows newline
594 nigel 43 No need char
595 nigel 41
596     /(a)(?(1)a|b|c)/
597     Failed: conditional group contains more than two branches at offset 13
598    
599     /(?(?=a)a|b|c)/
600     Failed: conditional group contains more than two branches at offset 12
601    
602     /(?(1a)/
603 nigel 93 Failed: missing ) at offset 6
604    
605     /(?(1a))/
606 nigel 91 Failed: reference to non-existent subpattern at offset 6
607 nigel 41
608     /(?(?i))/
609     Failed: assertion expected after (?( at offset 3
610    
611     /(?(abc))/
612 nigel 91 Failed: reference to non-existent subpattern at offset 7
613 nigel 41
614     /(?(?<ab))/
615 nigel 93 Failed: syntax error in subpattern name (missing terminator) at offset 7
616 nigel 41
617 nigel 93 /((?s)blah)\s+\1/I
618 nigel 43 Capturing subpattern count = 1
619     Max back reference = 1
620 nigel 41 No options
621     First char = 'b'
622 nigel 43 Need char = 'h'
623 nigel 41
624 nigel 93 /((?i)blah)\s+\1/I
625 nigel 43 Capturing subpattern count = 1
626     Max back reference = 1
627 nigel 41 No options
628 nigel 63 First char = 'b' (caseless)
629     Need char = 'h' (caseless)
630 nigel 41
631 ph10 161 /((?i)b)/IDZS
632 nigel 41 ------------------------------------------------------------------
633 ph10 192 Bra
634     CBra 1
635 ph10 602 /i b
636 ph10 161 Ket
637     Ket
638     End
639 nigel 41 ------------------------------------------------------------------
640 nigel 43 Capturing subpattern count = 1
641 nigel 41 No options
642 nigel 63 First char = 'b' (caseless)
643     No need char
644 ph10 455 Subject length lower bound = 1
645     No set of starting bytes
646 nigel 41
647 nigel 93 /(a*b|(?i:c*(?-i)d))/IS
648 nigel 43 Capturing subpattern count = 1
649 nigel 41 No options
650     No first char
651 nigel 43 No need char
652 ph10 455 Subject length lower bound = 1
653 nigel 75 Starting byte set: C a b c d
654 nigel 41
655 nigel 93 /a$/I
656 nigel 43 Capturing subpattern count = 0
657 nigel 41 No options
658     First char = 'a'
659 nigel 43 No need char
660 nigel 41 a
661     0: a
662     a\n
663     0: a
664 ph10 102 *** Failers
665 nigel 41 No match
666     \Za
667     No match
668 ph10 102 \Za\n
669 nigel 41 No match
670    
671 nigel 93 /a$/Im
672 nigel 43 Capturing subpattern count = 0
673 nigel 41 Options: multiline
674     First char = 'a'
675 nigel 43 No need char
676 nigel 41 a
677     0: a
678     a\n
679     0: a
680 ph10 102 \Za\n
681 nigel 41 0: a
682 ph10 102 *** Failers
683 nigel 41 No match
684     \Za
685     No match
686 ph10 102
687 nigel 93 /\Aabc/Im
688 nigel 43 Capturing subpattern count = 0
689 nigel 41 Options: anchored multiline
690     No first char
691 nigel 65 No need char
692 nigel 41
693 ph10 102 /^abc/Im
694 nigel 43 Capturing subpattern count = 0
695 nigel 41 Options: multiline
696 nigel 91 First char at start or follows newline
697 nigel 43 Need char = 'c'
698 nigel 41
699 nigel 93 /^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/I
700 nigel 43 Capturing subpattern count = 5
701 nigel 41 Options: anchored
702     No first char
703 nigel 65 No need char
704 nigel 41 aaaaabbbbbcccccdef
705     0: aaaaabbbbbcccccdef
706     1: aaaaabbbbbcccccdef
707     2: aaaaa
708     3: b
709     4: bbbbccccc
710     5: def
711    
712 nigel 93 /(?<=foo)[ab]/IS
713 nigel 43 Capturing subpattern count = 0
714 nigel 41 No options
715     No first char
716 nigel 43 No need char
717 ph10 455 Subject length lower bound = 1
718 nigel 75 Starting byte set: a b
719 nigel 41
720 nigel 93 /(?<!foo)(alpha|omega)/IS
721 nigel 43 Capturing subpattern count = 1
722 nigel 41 No options
723     No first char
724 nigel 43 Need char = 'a'
725 ph10 455 Subject length lower bound = 5
726 nigel 75 Starting byte set: a o
727 nigel 41
728 nigel 93 /(?!alphabet)[ab]/IS
729 nigel 43 Capturing subpattern count = 0
730 nigel 41 No options
731     No first char
732 nigel 43 No need char
733 ph10 455 Subject length lower bound = 1
734 nigel 75 Starting byte set: a b
735 nigel 41
736 nigel 93 /(?<=foo\n)^bar/Im
737 nigel 43 Capturing subpattern count = 0
738 ph10 226 Contains explicit CR or LF match
739 nigel 41 Options: multiline
740 nigel 75 No first char
741     Need char = 'r'
742 ph10 102 foo\nbarbar
743 nigel 75 0: bar
744     ***Failers
745     No match
746 ph10 102 rhubarb
747 nigel 75 No match
748     barbell
749     No match
750 ph10 102 abc\nbarton
751 nigel 75 No match
752    
753 nigel 93 /^(?<=foo\n)bar/Im
754 nigel 75 Capturing subpattern count = 0
755 ph10 226 Contains explicit CR or LF match
756 nigel 75 Options: multiline
757 nigel 91 First char at start or follows newline
758 nigel 43 Need char = 'r'
759 ph10 102 foo\nbarbar
760 nigel 75 0: bar
761     ***Failers
762     No match
763 ph10 102 rhubarb
764 nigel 75 No match
765     barbell
766     No match
767 ph10 102 abc\nbarton
768 nigel 75 No match
769 nigel 41
770 nigel 93 /(?>^abc)/Im
771 nigel 43 Capturing subpattern count = 0
772 nigel 41 Options: multiline
773 nigel 91 First char at start or follows newline
774 nigel 43 Need char = 'c'
775 nigel 41 abc
776     0: abc
777     def\nabc
778     0: abc
779     *** Failers
780     No match
781 ph10 102 defabc
782 nigel 41 No match
783    
784     /(?<=ab(c+)d)ef/
785     Failed: lookbehind assertion is not fixed length at offset 11
786    
787     /(?<=ab(?<=c+)d)ef/
788     Failed: lookbehind assertion is not fixed length at offset 12
789    
790     /(?<=ab(c|de)f)g/
791     Failed: lookbehind assertion is not fixed length at offset 13
792    
793     /The next three are in testinput2 because they have variable length branches/
794    
795 nigel 93 /(?<=bullock|donkey)-cart/I
796 nigel 43 Capturing subpattern count = 0
797 nigel 41 No options
798     First char = '-'
799 nigel 43 Need char = 't'
800 nigel 41 the bullock-cart
801     0: -cart
802     a donkey-cart race
803     0: -cart
804     *** Failers
805     No match
806     cart
807     No match
808 ph10 102 horse-and-cart
809 nigel 41 No match
810 ph10 102
811 nigel 93 /(?<=ab(?i)x|y|z)/I
812 nigel 43 Capturing subpattern count = 0
813 nigel 41 No options
814     No first char
815 nigel 43 No need char
816 nigel 41
817 nigel 93 /(?>.*)(?<=(abcd)|(xyz))/I
818 nigel 43 Capturing subpattern count = 2
819 nigel 41 No options
820 nigel 91 First char at start or follows newline
821 nigel 43 No need char
822 nigel 41 alphabetabcd
823     0: alphabetabcd
824     1: abcd
825     endingxyz
826     0: endingxyz
827     1: <unset>
828     2: xyz
829    
830 nigel 93 /(?<=ab(?i)x(?-i)y|(?i)z|b)ZZ/I
831 nigel 43 Capturing subpattern count = 0
832 nigel 41 No options
833     First char = 'Z'
834 nigel 43 Need char = 'Z'
835 nigel 41 abxyZZ
836     0: ZZ
837     abXyZZ
838     0: ZZ
839     ZZZ
840     0: ZZ
841     zZZ
842     0: ZZ
843     bZZ
844     0: ZZ
845 ph10 102 BZZ
846 nigel 41 0: ZZ
847     *** Failers
848     No match
849 ph10 102 ZZ
850 nigel 41 No match
851 ph10 102 abXYZZ
852 nigel 41 No match
853     zzz
854     No match
855 ph10 102 bzz
856 nigel 41 No match
857    
858 nigel 93 /(?<!(foo)a)bar/I
859 nigel 43 Capturing subpattern count = 1
860 nigel 41 No options
861     First char = 'b'
862 nigel 43 Need char = 'r'
863 nigel 41 bar
864     0: bar
865 ph10 102 foobbar
866 nigel 41 0: bar
867     *** Failers
868     No match
869 ph10 102 fooabar
870 nigel 41 No match
871    
872 nigel 93 /This one is here because Perl 5.005_02 doesn't fail it/I
873 nigel 43 Capturing subpattern count = 0
874 nigel 41 No options
875     First char = 'T'
876 nigel 43 Need char = 't'
877 nigel 41
878 nigel 93 /^(a)?(?(1)a|b)+$/I
879 nigel 43 Capturing subpattern count = 1
880 nigel 41 Options: anchored
881     No first char
882 nigel 43 No need char
883 nigel 41 *** Failers
884     No match
885 ph10 102 a
886 nigel 41 No match
887    
888 ph10 488 /This one is here because Perl behaves differently; see also the following/I
889 nigel 43 Capturing subpattern count = 0
890 nigel 41 No options
891     First char = 'T'
892 nigel 43 Need char = 'g'
893 nigel 41
894 nigel 93 /^(a\1?){4}$/I
895 nigel 43 Capturing subpattern count = 1
896     Max back reference = 1
897 nigel 41 Options: anchored
898     No first char
899 nigel 65 No need char
900 ph10 488 aaaa
901     No match
902 nigel 41 aaaaaa
903 ph10 488 No match
904    
905     /Perl does not fail these two for the final subjects. Neither did PCRE until/
906     /release 8.01. The problem is in backtracking into a subpattern that contains/
907     No match
908     /a recursive reference to itself. PCRE has now made these into atomic patterns./
909     No match
910 ph10 102
911 ph10 488 /^(xa|=?\1a){2}$/
912     xa=xaa
913     0: xa=xaa
914     1: =xaa
915     ** Failers
916     No match
917     xa=xaaa
918     No match
919    
920     /^(xa|=?\1a)+$/
921     xa=xaa
922     0: xa=xaa
923     1: =xaa
924     ** Failers
925     No match
926     xa=xaaa
927     No match
928    
929 nigel 93 /These are syntax tests from Perl 5.005/I
930 nigel 43 Capturing subpattern count = 0
931 nigel 41 No options
932     First char = 'T'
933 nigel 43 Need char = '5'
934 nigel 41
935     /a[b-a]/
936     Failed: range out of order in character class at offset 4
937    
938     /a[]b/
939     Failed: missing terminating ] for character class at offset 4
940    
941     /a[/
942     Failed: missing terminating ] for character class at offset 2
943    
944     /*a/
945     Failed: nothing to repeat at offset 0
946    
947     /(*)b/
948     Failed: nothing to repeat at offset 1
949    
950     /abc)/
951     Failed: unmatched parentheses at offset 3
952    
953     /(abc/
954     Failed: missing ) at offset 4
955    
956     /a**/
957     Failed: nothing to repeat at offset 2
958    
959     /)(/
960     Failed: unmatched parentheses at offset 0
961    
962     /\1/
963 nigel 63 Failed: reference to non-existent subpattern at offset 2
964 nigel 41
965     /\2/
966 nigel 63 Failed: reference to non-existent subpattern at offset 2
967 nigel 41
968     /(a)|\2/
969 nigel 63 Failed: reference to non-existent subpattern at offset 6
970 nigel 41
971 nigel 93 /a[b-a]/Ii
972 nigel 41 Failed: range out of order in character class at offset 4
973    
974 nigel 93 /a[]b/Ii
975 nigel 41 Failed: missing terminating ] for character class at offset 4
976    
977 nigel 93 /a[/Ii
978 nigel 41 Failed: missing terminating ] for character class at offset 2
979    
980 nigel 93 /*a/Ii
981 nigel 41 Failed: nothing to repeat at offset 0
982    
983 nigel 93 /(*)b/Ii
984 nigel 41 Failed: nothing to repeat at offset 1
985    
986 nigel 93 /abc)/Ii
987 nigel 41 Failed: unmatched parentheses at offset 3
988    
989 nigel 93 /(abc/Ii
990 nigel 41 Failed: missing ) at offset 4
991    
992 nigel 93 /a**/Ii
993 nigel 41 Failed: nothing to repeat at offset 2
994    
995 nigel 93 /)(/Ii
996 nigel 41 Failed: unmatched parentheses at offset 0
997    
998     /:(?:/
999     Failed: missing ) at offset 4
1000    
1001     /(?<%)b/
1002 nigel 63 Failed: unrecognized character after (?< at offset 3
1003 nigel 41
1004     /a(?{)b/
1005 ph10 269 Failed: unrecognized character after (? or (?- at offset 3
1006 nigel 41
1007     /a(?{{})b/
1008 ph10 269 Failed: unrecognized character after (? or (?- at offset 3
1009 nigel 41
1010     /a(?{}})b/
1011 ph10 269 Failed: unrecognized character after (? or (?- at offset 3
1012 nigel 41
1013     /a(?{"{"})b/
1014 ph10 269 Failed: unrecognized character after (? or (?- at offset 3
1015 nigel 41
1016     /a(?{"{"}})b/
1017 ph10 269 Failed: unrecognized character after (? or (?- at offset 3
1018 nigel 41
1019     /(?(1?)a|b)/
1020 nigel 91 Failed: malformed number or name after (?( at offset 4
1021 nigel 41
1022     /[a[:xyz:/
1023     Failed: missing terminating ] for character class at offset 8
1024    
1025     /(?<=x+)y/
1026     Failed: lookbehind assertion is not fixed length at offset 6
1027    
1028     /a{37,17}/
1029     Failed: numbers out of order in {} quantifier at offset 7
1030    
1031     /abc/\
1032     Failed: \ at end of pattern at offset 4
1033    
1034     /abc/\P
1035     Failed: POSIX code 9: bad escape sequence at offset 4
1036    
1037     /abc/\i
1038     Failed: \ at end of pattern at offset 4
1039    
1040 nigel 93 /(a)bc(d)/I
1041 nigel 43 Capturing subpattern count = 2
1042 nigel 41 No options
1043     First char = 'a'
1044 nigel 43 Need char = 'd'
1045 nigel 41 abcd
1046     0: abcd
1047     1: a
1048     2: d
1049     abcd\C2
1050     0: abcd
1051     1: a
1052     2: d
1053     2C d (1)
1054     abcd\C5
1055     0: abcd
1056     1: a
1057     2: d
1058     copy substring 5 failed -7
1059 ph10 102
1060 nigel 93 /(.{20})/I
1061 nigel 43 Capturing subpattern count = 1
1062 nigel 41 No options
1063     No first char
1064 nigel 43 No need char
1065 nigel 41 abcdefghijklmnopqrstuvwxyz
1066     0: abcdefghijklmnopqrst
1067     1: abcdefghijklmnopqrst
1068     abcdefghijklmnopqrstuvwxyz\C1
1069     0: abcdefghijklmnopqrst
1070     1: abcdefghijklmnopqrst
1071 nigel 91 1C abcdefghijklmnopqrst (20)
1072 nigel 41 abcdefghijklmnopqrstuvwxyz\G1
1073     0: abcdefghijklmnopqrst
1074     1: abcdefghijklmnopqrst
1075     1G abcdefghijklmnopqrst (20)
1076 ph10 102
1077 nigel 93 /(.{15})/I
1078 nigel 43 Capturing subpattern count = 1
1079 nigel 41 No options
1080     No first char
1081 nigel 43 No need char
1082 nigel 41 abcdefghijklmnopqrstuvwxyz
1083     0: abcdefghijklmno
1084     1: abcdefghijklmno
1085     abcdefghijklmnopqrstuvwxyz\C1\G1
1086     0: abcdefghijklmno
1087     1: abcdefghijklmno
1088     1C abcdefghijklmno (15)
1089     1G abcdefghijklmno (15)
1090    
1091 nigel 93 /(.{16})/I
1092 nigel 43 Capturing subpattern count = 1
1093 nigel 41 No options
1094     No first char
1095 nigel 43 No need char
1096 nigel 41 abcdefghijklmnopqrstuvwxyz
1097     0: abcdefghijklmnop
1098     1: abcdefghijklmnop
1099     abcdefghijklmnopqrstuvwxyz\C1\G1\L
1100     0: abcdefghijklmnop
1101     1: abcdefghijklmnop
1102 nigel 91 1C abcdefghijklmnop (16)
1103 nigel 41 1G abcdefghijklmnop (16)
1104     0L abcdefghijklmnop
1105     1L abcdefghijklmnop
1106 ph10 102
1107 nigel 93 /^(a|(bc))de(f)/I
1108 nigel 43 Capturing subpattern count = 3
1109 nigel 41 Options: anchored
1110     No first char
1111 nigel 65 No need char
1112 ph10 102 adef\G1\G2\G3\G4\L
1113 nigel 41 0: adef
1114     1: a
1115     2: <unset>
1116     3: f
1117     1G a (1)
1118     2G (0)
1119     3G f (1)
1120     get substring 4 failed -7
1121     0L adef
1122     1L a
1123     2L
1124     3L f
1125 ph10 102 bcdef\G1\G2\G3\G4\L
1126 nigel 41 0: bcdef
1127     1: bc
1128     2: bc
1129     3: f
1130     1G bc (2)
1131     2G bc (2)
1132     3G f (1)
1133     get substring 4 failed -7
1134     0L bcdef
1135     1L bc
1136     2L bc
1137     3L f
1138 ph10 102 adefghijk\C0
1139 nigel 41 0: adef
1140     1: a
1141     2: <unset>
1142     3: f
1143     0C adef (4)
1144 ph10 102
1145 nigel 93 /^abc\00def/I
1146 nigel 43 Capturing subpattern count = 0
1147 nigel 41 Options: anchored
1148     No first char
1149 nigel 65 No need char
1150 ph10 102 abc\00def\L\C0
1151 nigel 41 0: abc\x00def
1152     0C abc (7)
1153     0L abc
1154 ph10 102
1155     /word ((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+
1156     )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+
1157 ph10 162 )?)?)?)?)?)?)?)?)?otherword/I
1158 nigel 43 Capturing subpattern count = 8
1159 ph10 226 Contains explicit CR or LF match
1160 nigel 41 No options
1161     First char = 'w'
1162 nigel 43 Need char = 'd'
1163 nigel 41
1164 ph10 161 /.*X/IDZ
1165 nigel 41 ------------------------------------------------------------------
1166 ph10 192 Bra
1167 ph10 161 Any*
1168     X
1169     Ket
1170     End
1171 nigel 41 ------------------------------------------------------------------
1172 nigel 43 Capturing subpattern count = 0
1173 nigel 41 No options
1174 nigel 91 First char at start or follows newline
1175 nigel 43 Need char = 'X'
1176 nigel 41
1177 ph10 161 /.*X/IDZs
1178 nigel 41 ------------------------------------------------------------------
1179 ph10 192 Bra
1180 ph10 342 AllAny*
1181 ph10 161 X
1182     Ket
1183     End
1184 nigel 41 ------------------------------------------------------------------
1185 nigel 43 Capturing subpattern count = 0
1186 nigel 41 Options: anchored dotall
1187     No first char
1188 nigel 43 Need char = 'X'
1189 nigel 41
1190 ph10 161 /(.*X|^B)/IDZ
1191 nigel 41 ------------------------------------------------------------------
1192 ph10 192 Bra
1193     CBra 1
1194 ph10 161 Any*
1195     X
1196     Alt
1197     ^
1198     B
1199     Ket
1200     Ket
1201     End
1202 nigel 41 ------------------------------------------------------------------
1203 nigel 43 Capturing subpattern count = 1
1204 nigel 41 No options
1205 nigel 91 First char at start or follows newline
1206 nigel 43 No need char
1207 nigel 41
1208 ph10 161 /(.*X|^B)/IDZs
1209 nigel 41 ------------------------------------------------------------------
1210 ph10 192 Bra
1211     CBra 1
1212 ph10 342 AllAny*
1213 ph10 161 X
1214     Alt
1215     ^
1216     B
1217     Ket
1218     Ket
1219     End
1220 nigel 41 ------------------------------------------------------------------
1221 nigel 43 Capturing subpattern count = 1
1222 nigel 41 Options: anchored dotall
1223     No first char
1224 nigel 43 No need char
1225 ph10 102
1226 ph10 161 /(?s)(.*X|^B)/IDZ
1227 nigel 41 ------------------------------------------------------------------
1228 ph10 192 Bra
1229     CBra 1
1230 ph10 342 AllAny*
1231 ph10 161 X
1232     Alt
1233     ^
1234     B
1235     Ket
1236     Ket
1237     End
1238 nigel 41 ------------------------------------------------------------------
1239 nigel 43 Capturing subpattern count = 1
1240 nigel 41 Options: anchored dotall
1241     No first char
1242 nigel 43 No need char
1243 nigel 41
1244 ph10 161 /(?s:.*X|^B)/IDZ
1245 nigel 41 ------------------------------------------------------------------
1246 ph10 192 Bra
1247     Bra
1248 ph10 342 AllAny*
1249 ph10 161 X
1250     Alt
1251     ^
1252     B
1253     Ket
1254     Ket
1255     End
1256 nigel 41 ------------------------------------------------------------------
1257 nigel 43 Capturing subpattern count = 0
1258 ph10 342 Options: anchored
1259     No first char
1260 nigel 43 No need char
1261 nigel 41
1262 nigel 93 /\Biss\B/I+
1263 nigel 43 Capturing subpattern count = 0
1264 nigel 41 No options
1265     First char = 'i'
1266 nigel 43 Need char = 's'
1267 nigel 41 Mississippi
1268     0: iss
1269     0+ issippi
1270    
1271 nigel 93 /\Biss\B/I+P
1272 nigel 41 Mississippi
1273     0: iss
1274     0+ issippi
1275    
1276 nigel 93 /iss/IG+
1277 nigel 43 Capturing subpattern count = 0
1278 nigel 41 No options
1279     First char = 'i'
1280 nigel 43 Need char = 's'
1281 nigel 41 Mississippi
1282     0: iss
1283     0+ issippi
1284     0: iss
1285     0+ ippi
1286    
1287 nigel 93 /\Biss\B/IG+
1288 nigel 43 Capturing subpattern count = 0
1289 nigel 41 No options
1290     First char = 'i'
1291 nigel 43 Need char = 's'
1292 nigel 41 Mississippi
1293     0: iss
1294     0+ issippi
1295    
1296 nigel 93 /\Biss\B/Ig+
1297 nigel 43 Capturing subpattern count = 0
1298 nigel 41 No options
1299     First char = 'i'
1300 nigel 43 Need char = 's'
1301 nigel 41 Mississippi
1302     0: iss
1303     0+ issippi
1304     0: iss
1305     0+ ippi
1306     *** Failers
1307     No match
1308     Mississippi\A
1309     No match
1310    
1311 nigel 93 /(?<=[Ms])iss/Ig+
1312 nigel 43 Capturing subpattern count = 0
1313 nigel 41 No options
1314     First char = 'i'
1315 nigel 43 Need char = 's'
1316 nigel 41 Mississippi
1317     0: iss
1318     0+ issippi
1319     0: iss
1320     0+ ippi
1321    
1322 nigel 93 /(?<=[Ms])iss/IG+
1323 nigel 43 Capturing subpattern count = 0
1324 nigel 41 No options
1325     First char = 'i'
1326 nigel 43 Need char = 's'
1327 nigel 41 Mississippi
1328     0: iss
1329     0+ issippi
1330    
1331 nigel 93 /^iss/Ig+
1332 nigel 43 Capturing subpattern count = 0
1333 nigel 41 Options: anchored
1334     No first char
1335 nigel 65 No need char
1336 nigel 41 ississippi
1337     0: iss
1338     0+ issippi
1339 ph10 102
1340 nigel 93 /.*iss/Ig+
1341 nigel 43 Capturing subpattern count = 0
1342 nigel 41 No options
1343 nigel 91 First char at start or follows newline
1344 nigel 43 Need char = 's'
1345 ph10 102 abciss\nxyzisspqr
1346 nigel 41 0: abciss
1347     0+ \x0axyzisspqr
1348     0: xyziss
1349     0+ pqr
1350    
1351 nigel 93 /.i./I+g
1352 nigel 43 Capturing subpattern count = 0
1353 nigel 41 No options
1354     No first char
1355 nigel 43 Need char = 'i'
1356 nigel 41 Mississippi
1357     0: Mis
1358     0+ sissippi
1359     0: sis
1360     0+ sippi
1361     0: sip
1362     0+ pi
1363     Mississippi\A
1364     0: Mis
1365     0+ sissippi
1366     0: sis
1367     0+ sippi
1368     0: sip
1369     0+ pi
1370     Missouri river
1371     0: Mis
1372     0+ souri river
1373     0: ri
1374     0+ river
1375     0: riv
1376     0+ er
1377 ph10 102 Missouri river\A
1378 nigel 41 0: Mis
1379     0+ souri river
1380    
1381 nigel 93 /^.is/I+g
1382 nigel 43 Capturing subpattern count = 0
1383 nigel 41 Options: anchored
1384     No first char
1385 nigel 65 No need char
1386 nigel 41 Mississippi
1387     0: Mis
1388     0+ sissippi
1389    
1390 nigel 93 /^ab\n/Ig+
1391 nigel 43 Capturing subpattern count = 0
1392 ph10 226 Contains explicit CR or LF match
1393 nigel 41 Options: anchored
1394     No first char
1395 nigel 65 No need char
1396 nigel 41 ab\nab\ncd
1397     0: ab\x0a
1398     0+ ab\x0acd
1399    
1400 nigel 93 /^ab\n/Img+
1401 nigel 43 Capturing subpattern count = 0
1402 ph10 226 Contains explicit CR or LF match
1403 nigel 41 Options: multiline
1404 nigel 91 First char at start or follows newline
1405 nigel 43 Need char = 10
1406 nigel 41 ab\nab\ncd
1407     0: ab\x0a
1408     0+ ab\x0acd
1409     0: ab\x0a
1410     0+ cd
1411    
1412 nigel 93 /abc/I
1413 nigel 43 Capturing subpattern count = 0
1414 nigel 41 No options
1415     First char = 'a'
1416 nigel 43 Need char = 'c'
1417 nigel 41
1418 nigel 93 /abc|bac/I
1419 nigel 43 Capturing subpattern count = 0
1420 nigel 41 No options
1421     No first char
1422 nigel 43 Need char = 'c'
1423 nigel 41
1424 nigel 93 /(abc|bac)/I
1425 nigel 43 Capturing subpattern count = 1
1426 nigel 41 No options
1427     No first char
1428 nigel 43 Need char = 'c'
1429 nigel 41
1430 nigel 93 /(abc|(c|dc))/I
1431 nigel 43 Capturing subpattern count = 2
1432 nigel 41 No options
1433     No first char
1434 nigel 43 Need char = 'c'
1435 nigel 41
1436 nigel 93 /(abc|(d|de)c)/I
1437 nigel 43 Capturing subpattern count = 2
1438 nigel 41 No options
1439     No first char
1440 nigel 43 Need char = 'c'
1441 nigel 41
1442 nigel 93 /a*/I
1443 nigel 43 Capturing subpattern count = 0
1444 nigel 41 No options
1445     No first char
1446 nigel 43 No need char
1447 nigel 41
1448 nigel 93 /a+/I
1449 nigel 43 Capturing subpattern count = 0
1450 nigel 41 No options
1451     First char = 'a'
1452 nigel 43 No need char
1453 nigel 41
1454 nigel 93 /(baa|a+)/I
1455 nigel 43 Capturing subpattern count = 1
1456 nigel 41 No options
1457     No first char
1458 nigel 43 Need char = 'a'
1459 nigel 41
1460 nigel 93 /a{0,3}/I
1461 nigel 43 Capturing subpattern count = 0
1462 nigel 41 No options
1463     No first char
1464 nigel 43 No need char
1465 nigel 41
1466 nigel 93 /baa{3,}/I
1467 nigel 43 Capturing subpattern count = 0
1468 nigel 41 No options
1469     First char = 'b'
1470 nigel 43 Need char = 'a'
1471 nigel 41
1472 nigel 93 /"([^\\"]+|\\.)*"/I
1473 nigel 43 Capturing subpattern count = 1
1474 nigel 41 No options
1475     First char = '"'
1476 nigel 43 Need char = '"'
1477 nigel 41
1478 nigel 93 /(abc|ab[cd])/I
1479 nigel 43 Capturing subpattern count = 1
1480 nigel 41 No options
1481     First char = 'a'
1482 nigel 43 No need char
1483 nigel 41
1484 nigel 93 /(a|.)/I
1485 nigel 43 Capturing subpattern count = 1
1486 nigel 41 No options
1487     No first char
1488 nigel 43 No need char
1489 nigel 41
1490 nigel 93 /a|ba|\w/I
1491 nigel 43 Capturing subpattern count = 0
1492 nigel 41 No options
1493     No first char
1494 nigel 43 No need char
1495 nigel 41
1496 nigel 93 /abc(?=pqr)/I
1497 nigel 43 Capturing subpattern count = 0
1498 nigel 41 No options
1499     First char = 'a'
1500 nigel 43 Need char = 'r'
1501 nigel 41
1502 nigel 93 /...(?<=abc)/I
1503 nigel 43 Capturing subpattern count = 0
1504 nigel 41 No options
1505     No first char
1506 nigel 43 No need char
1507 nigel 41
1508 nigel 93 /abc(?!pqr)/I
1509 nigel 43 Capturing subpattern count = 0
1510 nigel 41 No options
1511     First char = 'a'
1512 nigel 43 Need char = 'c'
1513 nigel 41
1514 nigel 93 /ab./I
1515 nigel 43 Capturing subpattern count = 0
1516 nigel 41 No options
1517     First char = 'a'
1518 nigel 43 Need char = 'b'
1519 nigel 41
1520 nigel 93 /ab[xyz]/I
1521 nigel 43 Capturing subpattern count = 0
1522 nigel 41 No options
1523     First char = 'a'
1524 nigel 43 Need char = 'b'
1525 nigel 41
1526 nigel 93 /abc*/I
1527 nigel 43 Capturing subpattern count = 0
1528 nigel 41 No options
1529     First char = 'a'
1530 nigel 43 Need char = 'b'
1531 nigel 41
1532 nigel 93 /ab.c*/I
1533 nigel 43 Capturing subpattern count = 0
1534 nigel 41 No options
1535     First char = 'a'
1536 nigel 43 Need char = 'b'
1537 nigel 41
1538 nigel 93 /a.c*/I
1539 nigel 43 Capturing subpattern count = 0
1540 nigel 41 No options
1541     First char = 'a'
1542 nigel 43 No need char
1543 nigel 41
1544 nigel 93 /.c*/I
1545 nigel 43 Capturing subpattern count = 0
1546 nigel 41 No options
1547     No first char
1548 nigel 43 No need char
1549 nigel 41
1550 nigel 93 /ac*/I
1551 nigel 43 Capturing subpattern count = 0
1552 nigel 41 No options
1553     First char = 'a'
1554 nigel 43 No need char
1555 nigel 41
1556 nigel 93 /(a.c*|b.c*)/I
1557 nigel 43 Capturing subpattern count = 1
1558 nigel 41 No options
1559     No first char
1560 nigel 43 No need char
1561 nigel 41
1562 nigel 93 /a.c*|aba/I
1563 nigel 43 Capturing subpattern count = 0
1564 nigel 41 No options
1565     First char = 'a'
1566 nigel 43 No need char
1567 nigel 41
1568 nigel 93 /.+a/I
1569 nigel 43 Capturing subpattern count = 0
1570 nigel 41 No options
1571     No first char
1572 nigel 43 Need char = 'a'
1573 nigel 41
1574 nigel 93 /(?=abcda)a.*/I
1575 nigel 43 Capturing subpattern count = 0
1576 nigel 41 No options
1577     First char = 'a'
1578 nigel 63 Need char = 'a'
1579 nigel 41
1580 nigel 93 /(?=a)a.*/I
1581 nigel 43 Capturing subpattern count = 0
1582 nigel 41 No options
1583     First char = 'a'
1584 nigel 43 No need char
1585 nigel 41
1586 nigel 93 /a(b)*/I
1587 nigel 43 Capturing subpattern count = 1
1588 nigel 41 No options
1589     First char = 'a'
1590 nigel 43 No need char
1591 nigel 41
1592 nigel 93 /a\d*/I
1593 nigel 43 Capturing subpattern count = 0
1594 nigel 41 No options
1595     First char = 'a'
1596 nigel 43 No need char
1597 nigel 41
1598 nigel 93 /ab\d*/I
1599 nigel 43 Capturing subpattern count = 0
1600 nigel 41 No options
1601     First char = 'a'
1602 nigel 43 Need char = 'b'
1603 nigel 41
1604 nigel 93 /a(\d)*/I
1605 nigel 43 Capturing subpattern count = 1
1606 nigel 41 No options
1607     First char = 'a'
1608 nigel 43 No need char
1609 nigel 41
1610 nigel 93 /abcde{0,0}/I
1611 nigel 43 Capturing subpattern count = 0
1612 nigel 41 No options
1613     First char = 'a'
1614 nigel 43 Need char = 'd'
1615 nigel 41
1616 nigel 93 /ab\d+/I
1617 nigel 43 Capturing subpattern count = 0
1618 nigel 41 No options
1619     First char = 'a'
1620 nigel 43 Need char = 'b'
1621 nigel 41
1622 ph10 270 /a(?(1)b)(.)/I
1623     Capturing subpattern count = 1
1624 nigel 41 No options
1625     First char = 'a'
1626 nigel 43 No need char
1627 nigel 41
1628 ph10 270 /a(?(1)bag|big)(.)/I
1629     Capturing subpattern count = 1
1630 nigel 41 No options
1631     First char = 'a'
1632 nigel 43 Need char = 'g'
1633 nigel 41
1634 ph10 270 /a(?(1)bag|big)*(.)/I
1635     Capturing subpattern count = 1
1636 nigel 41 No options
1637     First char = 'a'
1638 nigel 43 No need char
1639 nigel 41
1640 ph10 270 /a(?(1)bag|big)+(.)/I
1641     Capturing subpattern count = 1
1642 nigel 41 No options
1643     First char = 'a'
1644 nigel 43 Need char = 'g'
1645 nigel 41
1646 ph10 270 /a(?(1)b..|b..)(.)/I
1647     Capturing subpattern count = 1
1648 nigel 41 No options
1649     First char = 'a'
1650 nigel 43 Need char = 'b'
1651 nigel 41
1652 nigel 93 /ab\d{0}e/I
1653 nigel 43 Capturing subpattern count = 0
1654 nigel 41 No options
1655     First char = 'a'
1656 nigel 43 Need char = 'e'
1657 nigel 41
1658 nigel 93 /a?b?/I
1659 nigel 43 Capturing subpattern count = 0
1660 nigel 41 No options
1661     No first char
1662 nigel 43 No need char
1663 nigel 41 a
1664     0: a
1665     b
1666     0: b
1667     ab
1668     0: ab
1669     \
1670     0:
1671     *** Failers
1672     0:
1673 ph10 102 \N
1674 nigel 41 No match
1675 ph10 102
1676 nigel 93 /|-/I
1677 nigel 43 Capturing subpattern count = 0
1678 nigel 41 No options
1679     No first char
1680 nigel 43 No need char
1681 nigel 41 abcd
1682     0:
1683     -abc
1684     0:
1685     \Nab-c
1686     0: -
1687     *** Failers
1688     0:
1689 ph10 102 \Nabc
1690 nigel 41 No match
1691    
1692 ph10 432 /a*(b+)(z)(z)/P
1693 nigel 41 aaaabbbbzzzz
1694     0: aaaabbbbzz
1695     1: bbbb
1696     2: z
1697     3: z
1698     aaaabbbbzzzz\O0
1699     aaaabbbbzzzz\O1
1700     0: aaaabbbbzz
1701     aaaabbbbzzzz\O2
1702     0: aaaabbbbzz
1703     1: bbbb
1704     aaaabbbbzzzz\O3
1705     0: aaaabbbbzz
1706     1: bbbb
1707     2: z
1708     aaaabbbbzzzz\O4
1709     0: aaaabbbbzz
1710     1: bbbb
1711     2: z
1712     3: z
1713     aaaabbbbzzzz\O5
1714     0: aaaabbbbzz
1715     1: bbbb
1716     2: z
1717     3: z
1718 ph10 102
1719     /^.?abcd/IS
1720 nigel 43 Capturing subpattern count = 0
1721     Options: anchored
1722     No first char
1723     Need char = 'd'
1724 ph10 455 Subject length lower bound = 4
1725     No set of starting bytes
1726 nigel 41
1727 nigel 43 /\( # ( at start
1728     (?: # Non-capturing bracket
1729     (?>[^()]+) # Either a sequence of non-brackets (no backtracking)
1730     | # Or
1731     (?R) # Recurse - i.e. nested bracketed string
1732     )* # Zero or more contents
1733     \) # Closing )
1734 nigel 93 /Ix
1735 nigel 43 Capturing subpattern count = 0
1736     Options: extended
1737     First char = '('
1738     Need char = ')'
1739     (abcd)
1740     0: (abcd)
1741     (abcd)xyz
1742     0: (abcd)
1743     xyz(abcd)
1744     0: (abcd)
1745 ph10 102 (ab(xy)cd)pqr
1746 nigel 43 0: (ab(xy)cd)
1747 ph10 102 (ab(xycd)pqr
1748 nigel 43 0: (xycd)
1749 ph10 102 () abc ()
1750 nigel 43 0: ()
1751     12(abcde(fsh)xyz(foo(bar))lmno)89
1752     0: (abcde(fsh)xyz(foo(bar))lmno)
1753     *** Failers
1754     No match
1755 ph10 102 abcd
1756 nigel 43 No match
1757     abcd)
1758     No match
1759 ph10 102 (abcd
1760 nigel 43 No match
1761    
1762 nigel 93 /\( ( (?>[^()]+) | (?R) )* \) /Ixg
1763 nigel 43 Capturing subpattern count = 1
1764     Options: extended
1765     First char = '('
1766     Need char = ')'
1767 ph10 102 (ab(xy)cd)pqr
1768 nigel 43 0: (ab(xy)cd)
1769     1: cd
1770     1(abcd)(x(y)z)pqr
1771     0: (abcd)
1772     1: abcd
1773     0: (x(y)z)
1774     1: z
1775    
1776 nigel 93 /\( (?: (?>[^()]+) | (?R) ) \) /Ix
1777 nigel 43 Capturing subpattern count = 0
1778     Options: extended
1779     First char = '('
1780     Need char = ')'
1781     (abcd)
1782     0: (abcd)
1783     (ab(xy)cd)
1784     0: (xy)
1785 ph10 102 (a(b(c)d)e)
1786 nigel 43 0: (c)
1787 ph10 102 ((ab))
1788 nigel 43 0: ((ab))
1789     *** Failers
1790     No match
1791 ph10 102 ()
1792 nigel 43 No match
1793    
1794 nigel 93 /\( (?: (?>[^()]+) | (?R) )? \) /Ix
1795 nigel 43 Capturing subpattern count = 0
1796     Options: extended
1797     First char = '('
1798     Need char = ')'
1799     ()
1800     0: ()
1801     12(abcde(fsh)xyz(foo(bar))lmno)89
1802     0: (fsh)
1803    
1804 nigel 93 /\( ( (?>[^()]+) | (?R) )* \) /Ix
1805 nigel 43 Capturing subpattern count = 1
1806     Options: extended
1807     First char = '('
1808     Need char = ')'
1809     (ab(xy)cd)
1810     0: (ab(xy)cd)
1811     1: cd
1812    
1813 nigel 93 /\( ( ( (?>[^()]+) | (?R) )* ) \) /Ix
1814 nigel 43 Capturing subpattern count = 2
1815     Options: extended
1816     First char = '('
1817     Need char = ')'
1818     (ab(xy)cd)
1819     0: (ab(xy)cd)
1820     1: ab(xy)cd
1821     2: cd
1822    
1823 nigel 93 /\( (123)? ( ( (?>[^()]+) | (?R) )* ) \) /Ix
1824 nigel 43 Capturing subpattern count = 3
1825     Options: extended
1826     First char = '('
1827     Need char = ')'
1828     (ab(xy)cd)
1829     0: (ab(xy)cd)
1830     1: <unset>
1831     2: ab(xy)cd
1832     3: cd
1833     (123ab(xy)cd)
1834     0: (123ab(xy)cd)
1835     1: 123
1836     2: ab(xy)cd
1837     3: cd
1838    
1839 nigel 93 /\( ( (123)? ( (?>[^()]+) | (?R) )* ) \) /Ix
1840 nigel 43 Capturing subpattern count = 3
1841     Options: extended
1842     First char = '('
1843     Need char = ')'
1844     (ab(xy)cd)
1845     0: (ab(xy)cd)
1846     1: ab(xy)cd
1847     2: <unset>
1848     3: cd
1849     (123ab(xy)cd)
1850     0: (123ab(xy)cd)
1851     1: 123ab(xy)cd
1852     2: 123
1853     3: cd
1854    
1855 nigel 93 /\( (((((((((( ( (?>[^()]+) | (?R) )* )))))))))) \) /Ix
1856 nigel 43 Capturing subpattern count = 11
1857     Options: extended
1858     First char = '('
1859     Need char = ')'
1860     (ab(xy)cd)
1861     0: (ab(xy)cd)
1862     1: ab(xy)cd
1863     2: ab(xy)cd
1864     3: ab(xy)cd
1865     4: ab(xy)cd
1866     5: ab(xy)cd
1867     6: ab(xy)cd
1868     7: ab(xy)cd
1869     8: ab(xy)cd
1870     9: ab(xy)cd
1871     10: ab(xy)cd
1872     11: cd
1873    
1874 nigel 93 /\( ( ( (?>[^()<>]+) | ((?>[^()]+)) | (?R) )* ) \) /Ix
1875 nigel 43 Capturing subpattern count = 3
1876     Options: extended
1877     First char = '('
1878     Need char = ')'
1879     (abcd(xyz<p>qrs)123)
1880     0: (abcd(xyz<p>qrs)123)
1881     1: abcd(xyz<p>qrs)123
1882     2: 123
1883    
1884 nigel 93 /\( ( ( (?>[^()]+) | ((?R)) )* ) \) /Ix
1885 nigel 43 Capturing subpattern count = 3
1886     Options: extended
1887     First char = '('
1888     Need char = ')'
1889     (ab(cd)ef)
1890     0: (ab(cd)ef)
1891     1: ab(cd)ef
1892     2: ef
1893     3: (cd)
1894     (ab(cd(ef)gh)ij)
1895     0: (ab(cd(ef)gh)ij)
1896     1: ab(cd(ef)gh)ij
1897     2: ij
1898     3: (cd(ef)gh)
1899    
1900 ph10 161 /^[[:alnum:]]/DZ
1901 nigel 43 ------------------------------------------------------------------
1902 ph10 192 Bra
1903 ph10 161 ^
1904     [0-9A-Za-z]
1905     Ket
1906     End
1907 nigel 43 ------------------------------------------------------------------
1908     Capturing subpattern count = 0
1909     Options: anchored
1910     No first char
1911     No need char
1912    
1913 ph10 161 /^[[:^alnum:]]/DZ
1914 nigel 75 ------------------------------------------------------------------
1915 ph10 192 Bra
1916 ph10 161 ^
1917 ph10 265 [\x00-/:-@[-`{-\xff] (neg)
1918 ph10 161 Ket
1919     End
1920 nigel 75 ------------------------------------------------------------------
1921     Capturing subpattern count = 0
1922     Options: anchored
1923     No first char
1924     No need char
1925    
1926 ph10 161 /^[[:alpha:]]/DZ
1927 nigel 43 ------------------------------------------------------------------
1928 ph10 192 Bra
1929 ph10 161 ^
1930     [A-Za-z]
1931     Ket
1932     End
1933 nigel 43 ------------------------------------------------------------------
1934     Capturing subpattern count = 0
1935     Options: anchored
1936     No first char
1937     No need char
1938 nigel 75
1939 ph10 161 /^[[:^alpha:]]/DZ
1940 nigel 75 ------------------------------------------------------------------
1941 ph10 192 Bra
1942 ph10 161 ^
1943 ph10 265 [\x00-@[-`{-\xff] (neg)
1944 ph10 161 Ket
1945     End
1946 nigel 75 ------------------------------------------------------------------
1947     Capturing subpattern count = 0
1948     Options: anchored
1949     No first char
1950     No need char
1951 ph10 102
1952 nigel 87 /[_[:alpha:]]/IS
1953     Capturing subpattern count = 0
1954     No options
1955     No first char
1956     No need char
1957 ph10 455 Subject length lower bound = 1
1958 nigel 87 Starting byte set: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
1959     _ a b c d e f g h i j k l m n o p q r s t u v w x y z
1960    
1961 ph10 161 /^[[:ascii:]]/DZ
1962 nigel 43 ------------------------------------------------------------------
1963 ph10 192 Bra
1964 ph10 161 ^
1965     [\x00-\x7f]
1966     Ket
1967     End
1968 nigel 43 ------------------------------------------------------------------
1969     Capturing subpattern count = 0
1970     Options: anchored
1971     No first char
1972     No need char
1973    
1974 ph10 161 /^[[:^ascii:]]/DZ
1975 nigel 75 ------------------------------------------------------------------
1976 ph10 192 Bra
1977 ph10 161 ^
1978 ph10 265 [\x80-\xff] (neg)
1979 ph10 161 Ket
1980     End
1981 nigel 75 ------------------------------------------------------------------
1982     Capturing subpattern count = 0
1983     Options: anchored
1984     No first char
1985     No need char
1986    
1987 ph10 161 /^[[:blank:]]/DZ
1988 nigel 63 ------------------------------------------------------------------
1989 ph10 192 Bra
1990 ph10 161 ^
1991     [\x09 ]
1992     Ket
1993     End
1994 nigel 63 ------------------------------------------------------------------
1995     Capturing subpattern count = 0
1996     Options: anchored
1997     No first char
1998     No need char
1999    
2000 ph10 161 /^[[:^blank:]]/DZ
2001 nigel 87 ------------------------------------------------------------------
2002 ph10 192 Bra
2003 ph10 161 ^
2004 ph10 265 [\x00-\x08\x0a-\x1f!-\xff] (neg)
2005 ph10 161 Ket
2006     End
2007 nigel 87 ------------------------------------------------------------------
2008     Capturing subpattern count = 0
2009     Options: anchored
2010     No first char
2011     No need char
2012    
2013     /[\n\x0b\x0c\x0d[:blank:]]/IS
2014     Capturing subpattern count = 0
2015 ph10 226 Contains explicit CR or LF match
2016 nigel 87 No options
2017     No first char
2018     No need char
2019 ph10 455 Subject length lower bound = 1
2020 nigel 87 Starting byte set: \x09 \x0a \x0b \x0c \x0d \x20
2021    
2022 ph10 161 /^[[:cntrl:]]/DZ
2023 nigel 43 ------------------------------------------------------------------
2024 ph10 192 Bra
2025 ph10 161 ^
2026     [\x00-\x1f\x7f]
2027     Ket
2028     End
2029 nigel 43 ------------------------------------------------------------------
2030     Capturing subpattern count = 0
2031     Options: anchored
2032     No first char
2033     No need char
2034    
2035 ph10 161 /^[[:digit:]]/DZ
2036 nigel 43 ------------------------------------------------------------------
2037 ph10 192 Bra
2038 ph10 161 ^
2039     [0-9]
2040     Ket
2041     End
2042 nigel 43 ------------------------------------------------------------------
2043     Capturing subpattern count = 0
2044     Options: anchored
2045     No first char
2046     No need char
2047    
2048 ph10 161 /^[[:graph:]]/DZ
2049 nigel 43 ------------------------------------------------------------------
2050 ph10 192 Bra
2051 ph10 161 ^
2052     [!-~]
2053     Ket
2054     End
2055 nigel 43 ------------------------------------------------------------------
2056     Capturing subpattern count = 0
2057     Options: anchored
2058     No first char
2059     No need char
2060    
2061 ph10 161 /^[[:lower:]]/DZ
2062 nigel 43 ------------------------------------------------------------------
2063 ph10 192 Bra
2064 ph10 161 ^
2065     [a-z]
2066     Ket
2067     End
2068 nigel 43 ------------------------------------------------------------------
2069     Capturing subpattern count = 0
2070     Options: anchored
2071     No first char
2072     No need char
2073    
2074 ph10 161 /^[[:print:]]/DZ
2075 nigel 43 ------------------------------------------------------------------
2076 ph10 192 Bra
2077 ph10 161 ^
2078     [ -~]
2079     Ket
2080     End
2081 nigel 43 ------------------------------------------------------------------
2082     Capturing subpattern count = 0
2083     Options: anchored
2084     No first char
2085     No need char
2086    
2087 ph10 161 /^[[:punct:]]/DZ
2088 nigel 43 ------------------------------------------------------------------
2089 ph10 192 Bra
2090 ph10 161 ^
2091     [!-/:-@[-`{-~]
2092     Ket
2093     End
2094 nigel 43 ------------------------------------------------------------------
2095     Capturing subpattern count = 0
2096     Options: anchored
2097     No first char
2098     No need char
2099    
2100 ph10 161 /^[[:space:]]/DZ
2101 nigel 43 ------------------------------------------------------------------
2102 ph10 192 Bra
2103 ph10 161 ^
2104     [\x09-\x0d ]
2105     Ket
2106     End
2107 nigel 43 ------------------------------------------------------------------
2108     Capturing subpattern count = 0
2109     Options: anchored
2110     No first char
2111     No need char
2112    
2113 ph10 161 /^[[:upper:]]/DZ
2114 nigel 43 ------------------------------------------------------------------
2115 ph10 192 Bra
2116 ph10 161 ^
2117     [A-Z]
2118     Ket
2119     End
2120 nigel 43 ------------------------------------------------------------------
2121     Capturing subpattern count = 0
2122     Options: anchored
2123     No first char
2124     No need char
2125    
2126 ph10 161 /^[[:xdigit:]]/DZ
2127 nigel 43 ------------------------------------------------------------------
2128 ph10 192 Bra
2129 ph10 161 ^
2130     [0-9A-Fa-f]
2131     Ket
2132     End
2133 nigel 43 ------------------------------------------------------------------
2134     Capturing subpattern count = 0
2135     Options: anchored
2136     No first char
2137     No need char
2138    
2139 ph10 161 /^[[:word:]]/DZ
2140 nigel 43 ------------------------------------------------------------------
2141 ph10 192 Bra
2142 ph10 161 ^
2143     [0-9A-Z_a-z]
2144     Ket
2145     End
2146 nigel 43 ------------------------------------------------------------------
2147     Capturing subpattern count = 0
2148     Options: anchored
2149     No first char
2150     No need char
2151    
2152 ph10 161 /^[[:^cntrl:]]/DZ
2153 nigel 43 ------------------------------------------------------------------
2154 ph10 192 Bra
2155 ph10 161 ^
2156 ph10 265 [ -~\x80-\xff] (neg)
2157 ph10 161 Ket
2158     End
2159 nigel 43 ------------------------------------------------------------------
2160     Capturing subpattern count = 0
2161     Options: anchored
2162     No first char
2163     No need char
2164    
2165 ph10 161 /^[12[:^digit:]]/DZ
2166 nigel 43 ------------------------------------------------------------------
2167 ph10 192 Bra
2168 ph10 161 ^
2169 ph10 265 [\x00-/12:-\xff] (neg)
2170 ph10 161 Ket
2171     End
2172 nigel 43 ------------------------------------------------------------------
2173     Capturing subpattern count = 0
2174     Options: anchored
2175     No first char
2176     No need char
2177    
2178 ph10 161 /^[[:^blank:]]/DZ
2179 nigel 63 ------------------------------------------------------------------
2180 ph10 192 Bra
2181 ph10 161 ^
2182 ph10 265 [\x00-\x08\x0a-\x1f!-\xff] (neg)
2183 ph10 161 Ket
2184     End
2185 nigel 63 ------------------------------------------------------------------
2186     Capturing subpattern count = 0
2187     Options: anchored
2188     No first char
2189     No need char
2190    
2191 ph10 161 /[01[:alpha:]%]/DZ
2192 nigel 43 ------------------------------------------------------------------
2193 ph10 192 Bra
2194 ph10 161 [%01A-Za-z]
2195     Ket
2196     End
2197 nigel 43 ------------------------------------------------------------------
2198     Capturing subpattern count = 0
2199     No options
2200     No first char
2201     No need char
2202    
2203 nigel 93 /[[.ch.]]/I
2204 nigel 43 Failed: POSIX collating elements are not supported at offset 1
2205    
2206 nigel 93 /[[=ch=]]/I
2207 nigel 43 Failed: POSIX collating elements are not supported at offset 1
2208    
2209 nigel 93 /[[:rhubarb:]]/I
2210 nigel 43 Failed: unknown POSIX class name at offset 3
2211    
2212 nigel 93 /[[:upper:]]/Ii
2213 nigel 43 Capturing subpattern count = 0
2214     Options: caseless
2215     No first char
2216     No need char
2217     A
2218     0: A
2219 ph10 102 a
2220 nigel 43 0: a
2221 ph10 102
2222 nigel 93 /[[:lower:]]/Ii
2223 nigel 43 Capturing subpattern count = 0
2224     Options: caseless
2225     No first char
2226     No need char
2227     A
2228     0: A
2229 ph10 102 a
2230 nigel 43 0: a
2231    
2232 nigel 93 /((?-i)[[:lower:]])[[:lower:]]/Ii
2233 nigel 43 Capturing subpattern count = 1
2234     Options: caseless
2235     No first char
2236     No need char
2237     ab
2238     0: ab
2239     1: a
2240     aB
2241     0: aB
2242     1: a
2243     *** Failers
2244     0: ai
2245     1: a
2246     Ab
2247     No match
2248 ph10 102 AB
2249 nigel 43 No match
2250    
2251 nigel 93 /[\200-\110]/I
2252 nigel 49 Failed: range out of order in character class at offset 9
2253    
2254 nigel 93 /^(?(0)f|b)oo/I
2255 nigel 91 Failed: invalid condition (?(0) at offset 6
2256 nigel 51
2257 nigel 93 /This one's here because of the large output vector needed/I
2258 nigel 53 Capturing subpattern count = 0
2259     No options
2260     First char = 'T'
2261     Need char = 'd'
2262    
2263 nigel 93 /(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\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
2264 nigel 53 Capturing subpattern count = 271
2265     Max back reference = 270
2266     No options
2267     No first char
2268     No need char
2269     \O900 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
2270     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
2271     1: 1
2272     2: 2
2273     3: 3
2274     4: 4
2275     5: 5
2276     6: 6
2277     7: 7
2278     8: 8
2279     9: 9
2280     10: 10
2281     11: 11
2282     12: 12
2283     13: 13
2284     14: 14
2285     15: 15
2286     16: 16
2287     17: 17
2288     18: 18
2289     19: 19
2290     20: 20
2291     21: 21
2292     22: 22
2293     23: 23
2294     24: 24
2295     25: 25
2296     26: 26
2297     27: 27
2298     28: 28
2299     29: 29
2300     30: 30
2301     31: 31
2302     32: 32
2303     33: 33
2304     34: 34
2305     35: 35
2306     36: 36
2307     37: 37
2308     38: 38
2309     39: 39
2310     40: 40
2311     41: 41
2312     42: 42
2313     43: 43
2314     44: 44
2315     45: 45
2316     46: 46
2317     47: 47
2318     48: 48
2319     49: 49
2320     50: 50
2321     51: 51
2322     52: 52
2323     53: 53
2324     54: 54
2325     55: 55
2326     56: 56
2327     57: 57
2328     58: 58
2329     59: 59
2330     60: 60
2331     61: 61
2332     62: 62
2333     63: 63
2334     64: 64
2335     65: 65
2336     66: 66
2337     67: 67
2338     68: 68
2339     69: 69
2340     70: 70
2341     71: 71
2342     72: 72
2343     73: 73
2344     74: 74
2345     75: 75
2346     76: 76
2347     77: 77
2348     78: 78
2349     79: 79
2350     80: 80
2351     81: 81
2352     82: 82
2353     83: 83
2354     84: 84
2355     85: 85
2356     86: 86
2357     87: 87
2358     88: 88
2359     89: 89
2360     90: 90
2361     91: 91
2362     92: 92
2363     93: 93
2364     94: 94
2365     95: 95
2366     96: 96
2367     97: 97
2368     98: 98
2369     99: 99
2370     100: 100
2371     101: 101
2372     102: 102
2373     103: 103
2374     104: 104
2375     105: 105
2376     106: 106
2377     107: 107
2378     108: 108
2379     109: 109
2380     110: 110
2381     111: 111
2382     112: 112
2383     113: 113
2384     114: 114
2385     115: 115
2386     116: 116
2387     117: 117
2388     118: 118
2389     119: 119
2390     120: 120
2391     121: 121
2392     122: 122
2393     123: 123
2394     124: 124
2395     125: 125
2396     126: 126
2397     127: 127
2398     128: 128
2399     129: 129
2400     130: 130
2401     131: 131
2402     132: 132
2403     133: 133
2404     134: 134
2405     135: 135
2406     136: 136
2407     137: 137
2408     138: 138
2409     139: 139
2410     140: 140
2411     141: 141
2412     142: 142
2413     143: 143
2414     144: 144
2415     145: 145
2416     146: 146
2417     147: 147
2418     148: 148
2419     149: 149
2420     150: 150
2421     151: 151
2422     152: 152
2423     153: 153
2424     154: 154
2425     155: 155
2426     156: 156
2427     157: 157
2428     158: 158
2429     159: 159
2430     160: 160
2431     161: 161
2432     162: 162
2433     163: 163
2434     164: 164
2435     165: 165
2436     166: 166
2437     167: 167
2438     168: 168
2439     169: 169
2440     170: 170
2441     171: 171
2442     172: 172
2443     173: 173
2444     174: 174
2445     175: 175
2446     176: 176
2447     177: 177
2448     178: 178
2449     179: 179
2450     180: 180
2451     181: 181
2452     182: 182
2453     183: 183
2454     184: 184
2455     185: 185
2456     186: 186
2457     187: 187
2458     188: 188
2459     189: 189
2460     190: 190
2461     191: 191
2462     192: 192
2463     193: 193
2464     194: 194
2465     195: 195
2466     196: 196
2467     197: 197
2468     198: 198
2469     199: 199
2470     200: 200
2471     201: 201
2472     202: 202
2473     203: 203
2474     204: 204
2475     205: 205
2476     206: 206
2477     207: 207
2478     208: 208
2479     209: 209
2480     210: 210
2481     211: 211
2482     212: 212
2483     213: 213
2484     214: 214
2485     215: 215
2486     216: 216
2487     217: 217
2488     218: 218
2489     219: 219
2490     220: 220
2491     221: 221
2492     222: 222
2493     223: 223
2494     224: 224
2495     225: 225
2496     226: 226
2497     227: 227
2498     228: 228
2499     229: 229
2500     230: 230
2501     231: 231
2502     232: 232
2503     233: 233
2504     234: 234
2505     235: 235
2506     236: 236
2507     237: 237
2508     238: 238
2509     239: 239
2510     240: 240
2511     241: 241
2512     242: 242
2513     243: 243
2514     244: 244
2515     245: 245
2516     246: 246
2517     247: 247
2518     248: 248
2519     249: 249
2520     250: 250
2521     251: 251
2522     252: 252
2523     253: 253
2524     254: 254
2525     255: 255
2526     256: 256
2527     257: 257
2528     258: 258
2529     259: 259
2530     260: 260
2531     261: 261
2532     262: 262
2533     263: 263
2534     264: 264
2535     265: 265
2536     266: 266
2537     267: 267
2538     268: 268
2539     269: 269
2540     270: ABC
2541     271: ABC
2542    
2543 nigel 93 /This one's here because Perl does this differently and PCRE can't at present/I
2544 nigel 53 Capturing subpattern count = 0
2545     No options
2546     First char = 'T'
2547     Need char = 't'
2548    
2549 nigel 93 /(main(O)?)+/I
2550 nigel 53 Capturing subpattern count = 2
2551     No options
2552     First char = 'm'
2553     Need char = 'n'
2554     mainmain
2555     0: mainmain
2556     1: main
2557     mainOmain
2558     0: mainOmain
2559     1: main
2560     2: O
2561 ph10 102
2562 nigel 93 /These are all cases where Perl does it differently (nested captures)/I
2563 nigel 63 Capturing subpattern count = 1
2564     No options
2565     First char = 'T'
2566     Need char = 's'
2567    
2568 nigel 93 /^(a(b)?)+$/I
2569 nigel 63 Capturing subpattern count = 2
2570     Options: anchored
2571     No first char
2572 nigel 65 No need char
2573 nigel 63 aba
2574     0: aba
2575     1: a
2576     2: b
2577 ph10 102
2578 nigel 93 /^(aa(bb)?)+$/I
2579 nigel 63 Capturing subpattern count = 2
2580     Options: anchored
2581     No first char
2582 nigel 65 No need char
2583 ph10 102 aabbaa
2584 nigel 63 0: aabbaa
2585     1: aa
2586     2: bb
2587 ph10 102
2588 nigel 93 /^(aa|aa(bb))+$/I
2589 nigel 63 Capturing subpattern count = 2
2590     Options: anchored
2591     No first char
2592 nigel 65 No need char
2593 ph10 102 aabbaa
2594 nigel 63 0: aabbaa
2595     1: aa
2596     2: bb
2597 ph10 102
2598 nigel 93 /^(aa(bb)??)+$/I
2599 nigel 63 Capturing subpattern count = 2
2600     Options: anchored
2601     No first char
2602 nigel 65 No need char
2603 ph10 102 aabbaa
2604 nigel 63 0: aabbaa
2605     1: aa
2606     2: bb
2607 ph10 102
2608 nigel 93 /^(?:aa(bb)?)+$/I
2609 nigel 63 Capturing subpattern count = 1
2610     Options: anchored
2611     No first char
2612 nigel 65 No need char
2613 ph10 102 aabbaa
2614 nigel 63 0: aabbaa
2615     1: bb
2616 ph10 102
2617 nigel 93 /^(aa(b(b))?)+$/I
2618 nigel 63 Capturing subpattern count = 3
2619     Options: anchored
2620     No first char
2621 nigel 65 No need char
2622 ph10 102 aabbaa
2623 nigel 63 0: aabbaa
2624     1: aa
2625     2: bb
2626     3: b
2627    
2628 nigel 93 /^(?:aa(b(b))?)+$/I
2629 nigel 63 Capturing subpattern count = 2
2630     Options: anchored
2631     No first char
2632 nigel 65 No need char
2633 ph10 102 aabbaa
2634 nigel 63 0: aabbaa
2635     1: bb
2636     2: b
2637    
2638 nigel 93 /^(?:aa(b(?:b))?)+$/I
2639 nigel 63 Capturing subpattern count = 1
2640     Options: anchored
2641     No first char
2642 nigel 65 No need char
2643 ph10 102 aabbaa
2644 nigel 63 0: aabbaa
2645     1: bb
2646    
2647 nigel 93 /^(?:aa(bb(?:b))?)+$/I
2648 nigel 63 Capturing subpattern count = 1
2649     Options: anchored
2650     No first char
2651 nigel 65 No need char
2652 ph10 102 aabbbaa
2653 nigel 63 0: aabbbaa
2654     1: bbb
2655 ph10 102
2656 nigel 93 /^(?:aa(b(?:bb))?)+$/I
2657 nigel 63 Capturing subpattern count = 1
2658     Options: anchored
2659     No first char
2660 nigel 65 No need char
2661 ph10 102 aabbbaa
2662 nigel 63 0: aabbbaa
2663     1: bbb
2664    
2665 nigel 93 /^(?:aa(?:b(b))?)+$/I
2666 nigel 63 Capturing subpattern count = 1
2667     Options: anchored
2668     No first char
2669 nigel 65 No need char
2670 ph10 102 aabbaa
2671 nigel 63 0: aabbaa
2672     1: b
2673    
2674 nigel 93 /^(?:aa(?:b(bb))?)+$/I
2675 nigel 63 Capturing subpattern count = 1
2676     Options: anchored
2677     No first char
2678 nigel 65 No need char
2679 ph10 102 aabbbaa
2680 nigel 63 0: aabbbaa
2681     1: bb
2682    
2683 nigel 93 /^(aa(b(bb))?)+$/I
2684 nigel 63 Capturing subpattern count = 3
2685     Options: anchored
2686     No first char
2687 nigel 65 No need char
2688 ph10 102 aabbbaa
2689 nigel 63 0: aabbbaa
2690     1: aa
2691     2: bbb
2692     3: bb
2693    
2694 nigel 93 /^(aa(bb(bb))?)+$/I
2695 nigel 63 Capturing subpattern count = 3
2696     Options: anchored
2697     No first char
2698 nigel 65 No need char
2699 ph10 102 aabbbbaa
2700 nigel 63 0: aabbbbaa
2701     1: aa
2702     2: bbbb
2703     3: bb
2704    
2705 ph10 102 /--------------------------------------------------------------------/I
2706 nigel 63 Capturing subpattern count = 0
2707     No options
2708     First char = '-'
2709     Need char = '-'
2710 ph10 102
2711 ph10 162 /#/IxDZ
2712 nigel 63 ------------------------------------------------------------------
2713 ph10 192 Bra
2714 ph10 161 Ket
2715     End
2716 nigel 63 ------------------------------------------------------------------
2717     Capturing subpattern count = 0
2718     Options: extended
2719     No first char
2720     No need char
2721    
2722 ph10 162 /a#/IxDZ
2723 nigel 63 ------------------------------------------------------------------
2724 ph10 192 Bra
2725 ph10 161 a
2726     Ket
2727     End
2728 nigel 63 ------------------------------------------------------------------
2729     Capturing subpattern count = 0
2730     Options: extended
2731     First char = 'a'
2732     No need char
2733    
2734 ph10 161 /[\s]/DZ
2735 nigel 63 ------------------------------------------------------------------
2736 ph10 192 Bra
2737 ph10 161 [\x09\x0a\x0c\x0d ]
2738     Ket
2739     End
2740 nigel 63 ------------------------------------------------------------------
2741     Capturing subpattern count = 0
2742     No options
2743     No first char
2744     No need char
2745    
2746 ph10 161 /[\S]/DZ
2747 nigel 63 ------------------------------------------------------------------
2748 ph10 192 Bra
2749 ph10 264 [\x00-\x08\x0b\x0e-\x1f!-\xff] (neg)
2750 ph10 161 Ket
2751     End
2752 nigel 63 ------------------------------------------------------------------
2753     Capturing subpattern count = 0
2754     No options
2755     No first char
2756     No need char
2757    
2758 ph10 161 /a(?i)b/DZ
2759 nigel 63 ------------------------------------------------------------------
2760 ph10 192 Bra
2761 ph10 161 a
2762 ph10 602 /i b
2763 ph10 161 Ket
2764     End
2765 nigel 63 ------------------------------------------------------------------
2766     Capturing subpattern count = 0
2767     No options
2768     First char = 'a'
2769     Need char = 'b' (caseless)
2770     ab
2771     0: ab
2772     aB
2773     0: aB
2774 ph10 102 *** Failers
2775 nigel 63 No match
2776 ph10 102 AB
2777 nigel 63 No match
2778    
2779 ph10 161 /(a(?i)b)/DZ
2780 nigel 63 ------------------------------------------------------------------
2781 ph10 192 Bra
2782     CBra 1
2783 ph10 161 a
2784 ph10 602 /i b
2785 ph10 161 Ket
2786     Ket
2787     End
2788 nigel 63 ------------------------------------------------------------------
2789     Capturing subpattern count = 1
2790     No options
2791     First char = 'a'
2792     Need char = 'b' (caseless)
2793     ab
2794     0: ab
2795     1: ab
2796     aB
2797     0: aB
2798     1: aB
2799 ph10 102 *** Failers
2800 nigel 63 No match
2801 ph10 102 AB
2802 nigel 63 No match
2803 ph10 102
2804 ph10 161 / (?i)abc/IxDZ
2805 nigel 63 ------------------------------------------------------------------
2806 ph10 192 Bra
2807 ph10 602 /i abc
2808 ph10 161 Ket
2809     End
2810 nigel 63 ------------------------------------------------------------------
2811     Capturing subpattern count = 0
2812     Options: caseless extended
2813     First char = 'a' (caseless)
2814     Need char = 'c' (caseless)
2815    
2816     /#this is a comment
2817 ph10 161 (?i)abc/IxDZ
2818 nigel 63 ------------------------------------------------------------------
2819 ph10 192 Bra
2820 ph10 602 /i abc
2821 ph10 161 Ket
2822     End
2823 nigel 63 ------------------------------------------------------------------
2824     Capturing subpattern count = 0
2825     Options: caseless extended
2826     First char = 'a' (caseless)
2827     Need char = 'c' (caseless)
2828    
2829 ph10 161 /123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/DZ
2830 nigel 63 ------------------------------------------------------------------
2831 ph10 192 Bra
2832 ph10 161 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
2833     Ket
2834     End
2835 nigel 63 ------------------------------------------------------------------
2836     Capturing subpattern count = 0
2837     No options
2838     First char = '1'
2839     Need char = '0'
2840    
2841 ph10 161 /\Q123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/DZ
2842 nigel 63 ------------------------------------------------------------------
2843 ph10 192 Bra
2844 ph10 161 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
2845     Ket
2846     End
2847 nigel 63 ------------------------------------------------------------------
2848     Capturing subpattern count = 0
2849     No options
2850     First char = '1'
2851     Need char = '0'
2852    
2853 ph10 161 /\Q\E/DZ
2854 nigel 63 ------------------------------------------------------------------
2855 ph10 192 Bra
2856 ph10 161 Ket
2857     End
2858 nigel 63 ------------------------------------------------------------------
2859     Capturing subpattern count = 0
2860     No options
2861     No first char
2862     No need char
2863     \
2864     0:
2865    
2866 ph10 161 /\Q\Ex/DZ
2867 nigel 63 ------------------------------------------------------------------
2868 ph10 192 Bra
2869 ph10 161 x
2870     Ket
2871     End
2872 nigel 63 ------------------------------------------------------------------
2873     Capturing subpattern count = 0
2874     No options
2875     First char = 'x'
2876     No need char
2877    
2878 ph10 161 / \Q\E/DZ
2879 nigel 63 ------------------------------------------------------------------
2880 ph10 192 Bra
2881 ph10 161
2882     Ket
2883     End
2884 nigel 63 ------------------------------------------------------------------
2885     Capturing subpattern count = 0
2886     No options
2887     First char = ' '
2888     No need char
2889    
2890 ph10 161 /a\Q\E/DZ
2891 nigel 63 ------------------------------------------------------------------
2892 ph10 192 Bra
2893 ph10 161 a
2894     Ket
2895     End
2896 nigel 63 ------------------------------------------------------------------
2897     Capturing subpattern count = 0
2898     No options
2899     First char = 'a'
2900     No need char
2901     abc
2902     0: a
2903     bca
2904     0: a
2905 ph10 102 bac
2906 nigel 63 0: a
2907    
2908 ph10 161 /a\Q\Eb/DZ
2909 nigel 63 ------------------------------------------------------------------
2910 ph10 192 Bra
2911 ph10 161 ab
2912     Ket
2913     End
2914 nigel 63 ------------------------------------------------------------------
2915     Capturing subpattern count = 0
2916     No options
2917     First char = 'a'
2918     Need char = 'b'
2919     abc
2920     0: ab
2921    
2922 ph10 161 /\Q\Eabc/DZ
2923 nigel 63 ------------------------------------------------------------------
2924 ph10 192 Bra
2925 ph10 161 abc
2926     Ket
2927     End
2928 nigel 63 ------------------------------------------------------------------
2929     Capturing subpattern count = 0
2930     No options
2931     First char = 'a'
2932     Need char = 'c'
2933    
2934 ph10 161 /x*+\w/DZ
2935 nigel 63 ------------------------------------------------------------------
2936 ph10 192 Bra
2937 ph10 161 x*+
2938     \w
2939     Ket
2940     End
2941 nigel 63 ------------------------------------------------------------------
2942     Capturing subpattern count = 0
2943     No options
2944     No first char
2945     No need char
2946     *** Failers
2947     0: F
2948     xxxxx
2949     No match
2950 ph10 102
2951 ph10 161 /x?+/DZ
2952 nigel 63 ------------------------------------------------------------------
2953 ph10 192 Bra
2954 ph10 161 x?+
2955     Ket
2956     End
2957 nigel 63 ------------------------------------------------------------------
2958     Capturing subpattern count = 0
2959     No options
2960     No first char
2961     No need char
2962    
2963 ph10 161 /x++/DZ
2964 nigel 63 ------------------------------------------------------------------
2965 ph10 192 Bra
2966 ph10 161 x++
2967     Ket
2968     End
2969 nigel 63 ------------------------------------------------------------------
2970     Capturing subpattern count = 0
2971     No options
2972     First char = 'x'
2973     No need char
2974    
2975 ph10 161 /x{1,3}+/DZ
2976 nigel 63 ------------------------------------------------------------------
2977 ph10 192 Bra
2978 ph10 161 Once
2979     x
2980     x{0,2}
2981     Ket
2982     Ket
2983     End
2984 nigel 63 ------------------------------------------------------------------
2985     Capturing subpattern count = 0
2986     No options
2987     First char = 'x'
2988     No need char
2989    
2990 ph10 161 /(x)*+/DZ
2991 nigel 63 ------------------------------------------------------------------
2992 ph10 192 Bra
2993 ph10 604 Braposzero
2994     CBraPos 1
2995 ph10 161 x
2996 ph10 604 KetRpos
2997 ph10 161 Ket
2998     End
2999 nigel 63 ------------------------------------------------------------------
3000     Capturing subpattern count = 1
3001     No options
3002     No first char
3003     No need char
3004    
3005 nigel 93 /^(\w++|\s++)*$/I
3006 nigel 63 Capturing subpattern count = 1
3007     Options: anchored
3008     No first char
3009     No need char
3010     now is the time for all good men to come to the aid of the party
3011     0: now is the time for all good men to come to the aid of the party
3012     1: party
3013     *** Failers
3014     No match
3015     this is not a line with only words and spaces!
3016     No match
3017 ph10 102
3018 nigel 93 /(\d++)(\w)/I
3019 nigel 63 Capturing subpattern count = 2
3020     No options
3021     No first char
3022     No need char
3023     12345a
3024     0: 12345a
3025     1: 12345
3026     2: a
3027     *** Failers
3028     No match
3029 ph10 102 12345+
3030 nigel 63 No match
3031    
3032 nigel 93 /a++b/I
3033 nigel 63 Capturing subpattern count = 0
3034     No options
3035     First char = 'a'
3036     Need char = 'b'
3037     aaab
3038     0: aaab
3039    
3040 nigel 93 /(a++b)/I
3041 nigel 63 Capturing subpattern count = 1
3042     No options
3043     First char = 'a'
3044     Need char = 'b'
3045     aaab
3046     0: aaab
3047     1: aaab
3048    
3049 nigel 93 /(a++)b/I
3050 nigel 63 Capturing subpattern count = 1
3051     No options
3052     First char = 'a'
3053     Need char = 'b'
3054     aaab
3055     0: aaab
3056     1: aaa
3057    
3058 nigel 93 /([^()]++|\([^()]*\))+/I
3059 nigel 63 Capturing subpattern count = 1
3060     No options
3061     No first char
3062     No need char
3063     ((abc(ade)ufh()()x
3064     0: abc(ade)ufh()()x
3065     1: x
3066 ph10 102
3067     /\(([^()]++|\([^()]+\))+\)/I
3068 nigel 63 Capturing subpattern count = 1
3069     No options
3070     First char = '('
3071     Need char = ')'
3072     (abc)
3073     0: (abc)
3074     1: abc
3075     (abc(def)xyz)
3076     0: (abc(def)xyz)
3077     1: xyz
3078     *** Failers
3079     No match
3080 ph10 102 ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
3081 nigel 63 No match
3082    
3083 ph10 161 /(abc){1,3}+/DZ
3084 nigel 63 ------------------------------------------------------------------
3085 ph10 192 Bra
3086 ph10 161 Once
3087 ph10 192 CBra 1
3088 ph10 161 abc
3089     Ket
3090     Brazero
3091 ph10 192 Bra
3092     CBra 1
3093 ph10 161 abc
3094     Ket
3095     Brazero
3096 ph10 192 CBra 1
3097 ph10 161 abc
3098     Ket
3099     Ket
3100     Ket
3101     Ket
3102     End
3103 nigel 63 ------------------------------------------------------------------
3104     Capturing subpattern count = 1
3105     No options
3106     First char = 'a'
3107     Need char = 'c'
3108    
3109 nigel 93 /a+?+/I
3110 nigel 63 Failed: nothing to repeat at offset 3
3111    
3112 nigel 93 /a{2,3}?+b/I
3113 nigel 63 Failed: nothing to repeat at offset 7
3114    
3115 nigel 93 /(?U)a+?+/I
3116 nigel 63 Failed: nothing to repeat at offset 7
3117    
3118 nigel 93 /a{2,3}?+b/IU
3119 nigel 63 Failed: nothing to repeat at offset 7
3120    
3121 ph10 161 /x(?U)a++b/DZ
3122 nigel 63 ------------------------------------------------------------------
3123 ph10 192 Bra
3124 ph10 161 x
3125     a++
3126     b
3127     Ket
3128     End
3129 nigel 63 ------------------------------------------------------------------
3130     Capturing subpattern count = 0
3131     No options
3132     First char = 'x'
3133     Need char = 'b'
3134     xaaaab
3135     0: xaaaab
3136    
3137 ph10 161 /(?U)xa++b/DZ
3138 nigel 63 ------------------------------------------------------------------
3139 ph10 192 Bra
3140 ph10 161 x
3141     a++
3142     b
3143     Ket
3144     End
3145 nigel 63 ------------------------------------------------------------------
3146     Capturing subpattern count = 0
3147     Options: ungreedy
3148     First char = 'x'
3149     Need char = 'b'
3150     xaaaab
3151     0: xaaaab
3152    
3153 ph10 161 /^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/DZ
3154 nigel 63 ------------------------------------------------------------------
3155 ph10 192 Bra
3156 ph10 161 ^
3157 ph10 192 CBra 1
3158     CBra 2
3159 ph10 161 a+
3160     Ket
3161 ph10 192 CBra 3
3162 ph10 161 [ab]+?
3163     Ket
3164 ph10 192 CBra 4
3165 ph10 161 [bc]+
3166     Ket
3167 ph10 192 CBra 5
3168 ph10 161 \w*
3169     Ket
3170     Ket
3171     Ket
3172     End
3173 nigel 63 ------------------------------------------------------------------
3174     Capturing subpattern count = 5
3175     Options: anchored
3176     No first char
3177 nigel 65 No need char
3178 nigel 63
3179 ph10 161 /^x(?U)a+b/DZ
3180 nigel 63 ------------------------------------------------------------------
3181 ph10 192 Bra
3182 ph10 161 ^
3183     x
3184     a++
3185     b
3186     Ket
3187     End
3188 nigel 63 ------------------------------------------------------------------
3189     Capturing subpattern count = 0
3190     Options: anchored
3191     No first char
3192     Need char = 'b'
3193    
3194 ph10 161 /^x(?U)(a+)b/DZ
3195 nigel 63 ------------------------------------------------------------------
3196 ph10 192 Bra
3197 ph10 161 ^
3198     x
3199 ph10 192 CBra 1
3200 ph10 161 a+?
3201     Ket
3202     b
3203     Ket
3204     End
3205 nigel 63 ------------------------------------------------------------------
3206     Capturing subpattern count = 1
3207     Options: anchored
3208     No first char
3209     Need char = 'b'
3210    
3211 nigel 93 /[.x.]/I
3212 nigel 63 Failed: POSIX collating elements are not supported at offset 0
3213    
3214 nigel 93 /[=x=]/I
3215 nigel 63 Failed: POSIX collating elements are not supported at offset 0
3216    
3217 nigel 93 /[:x:]/I
3218 nigel 63 Failed: POSIX named classes are supported only within a class at offset 0
3219    
3220 nigel 93 /\l/I
3221 ph10 514 Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
3222 nigel 63
3223 nigel 93 /\L/I
3224 ph10 514 Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
3225 nigel 63
3226 nigel 93 /\N{name}/I
3227 ph10 514 Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
3228 nigel 63
3229 nigel 93 /\u/I
3230 ph10 514 Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
3231 nigel 63
3232 nigel 93 /\U/I
3233 ph10 514 Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
3234 nigel 63
3235 nigel 93 /[/I
3236 nigel 63 Failed: missing terminating ] for character class at offset 1
3237    
3238 nigel 93 /[a-/I
3239 nigel 63 Failed: missing terminating ] for character class at offset 3
3240    
3241 nigel 93 /[[:space:]/I
3242 nigel 63 Failed: missing terminating ] for character class at offset 10
3243    
3244 ph10 162 /[\s]/IDZ
3245 nigel 63 ------------------------------------------------------------------
3246 ph10 192 Bra
3247 ph10 161 [\x09\x0a\x0c\x0d ]
3248     Ket
3249     End
3250 nigel 63 ------------------------------------------------------------------
3251     Capturing subpattern count = 0
3252     No options
3253     No first char
3254     No need char
3255    
3256 ph10 162 /[[:space:]]/IDZ
3257 nigel 63 ------------------------------------------------------------------
3258 ph10 192 Bra
3259 ph10 161 [\x09-\x0d ]
3260     Ket
3261     End
3262 nigel 63 ------------------------------------------------------------------
3263     Capturing subpattern count = 0
3264     No options
3265     No first char
3266     No need char
3267    
3268 ph10 162 /[[:space:]abcde]/IDZ
3269 nigel 63 ------------------------------------------------------------------
3270 ph10 192 Bra
3271 ph10 161 [\x09-\x0d a-e]
3272     Ket
3273     End
3274 nigel 63 ------------------------------------------------------------------
3275     Capturing subpattern count = 0
3276     No options
3277     No first char
3278     No need char
3279    
3280 nigel 93 /< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/Ix
3281 nigel 63 Capturing subpattern count = 0
3282     Options: extended
3283     First char = '<'
3284     Need char = '>'
3285     <>
3286     0: <>
3287     <abcd>
3288     0: <abcd>
3289     <abc <123> hij>
3290     0: <abc <123> hij>
3291     <abc <def> hij>
3292     0: <def>
3293 ph10 102 <abc<>def>
3294 nigel 63 0: <abc<>def>
3295 ph10 102 <abc<>
3296 nigel 63 0: <>
3297     *** Failers
3298     No match
3299     <abc
3300     No match
3301    
3302 ph10 162 |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|IDZ
3303 nigel 63 ------------------------------------------------------------------
3304 ph10 192 Bra
3305 ph10 161 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
3306     \b
3307     Ket
3308     End
3309 nigel 63 ------------------------------------------------------------------
3310     Capturing subpattern count = 0
3311     No options
3312     First char = '8'
3313     Need char = 'X'
3314    
3315 ph10 162 |\$\<\.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|IDZ
3316 nigel 63 ------------------------------------------------------------------
3317 ph10 192 Bra
3318 ph10 161 $<.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
3319     \b
3320     Ket
3321     End
3322 nigel 63 ------------------------------------------------------------------
3323     Capturing subpattern count = 0
3324     No options
3325     First char = '$'
3326     Need char = 'X'
3327    
3328     /(.*)\d+\1/I
3329     Capturing subpattern count = 1
3330     Max back reference = 1
3331     No options
3332     No first char
3333     No need char
3334    
3335     /(.*)\d+/I
3336     Capturing subpattern count = 1
3337     No options
3338 nigel 91 First char at start or follows newline
3339 nigel 63 No need char
3340 ph10 102
3341 nigel 63 /(.*)\d+\1/Is
3342     Capturing subpattern count = 1
3343     Max back reference = 1
3344     Options: dotall
3345     No first char
3346     No need char
3347    
3348     /(.*)\d+/Is
3349     Capturing subpattern count = 1
3350     Options: anchored dotall
3351     No first char
3352     No need char
3353    
3354     /(.*(xyz))\d+\2/I
3355     Capturing subpattern count = 2
3356     Max back reference = 2
3357     No options
3358 nigel 91 First char at start or follows newline
3359 nigel 63 Need char = 'z'
3360    
3361     /((.*))\d+\1/I
3362     Capturing subpattern count = 2
3363     Max back reference = 1
3364     No options
3365     No first char
3366     No need char
3367     abc123bc
3368     0: bc123bc
3369     1: bc
3370     2: bc
3371 ph10 102
3372 nigel 63 /a[b]/I
3373     Capturing subpattern count = 0
3374     No options
3375     First char = 'a'
3376     Need char = 'b'
3377    
3378     /(?=a).*/I
3379     Capturing subpattern count = 0
3380     No options
3381     First char = 'a'
3382     No need char
3383    
3384 nigel 93 /(?=abc).xyz/IiI
3385 nigel 63 Capturing subpattern count = 0
3386     Options: caseless
3387     First char = 'a' (caseless)
3388     Need char = 'z' (caseless)
3389    
3390     /(?=abc)(?i).xyz/I
3391     Capturing subpattern count = 0
3392     No options
3393     First char = 'a'
3394     Need char = 'z' (caseless)
3395    
3396     /(?=a)(?=b)/I
3397     Capturing subpattern count = 0
3398     No options
3399     First char = 'a'
3400     No need char
3401    
3402     /(?=.)a/I
3403     Capturing subpattern count = 0
3404     No options
3405     First char = 'a'
3406     No need char
3407    
3408     /((?=abcda)a)/I
3409     Capturing subpattern count = 1
3410     No options
3411     First char = 'a'
3412     Need char = 'a'
3413    
3414     /((?=abcda)ab)/I
3415     Capturing subpattern count = 1
3416     No options
3417     First char = 'a'
3418     Need char = 'b'
3419    
3420     /()a/I
3421     Capturing subpattern count = 1
3422     No options
3423     No first char
3424     Need char = 'a'
3425    
3426 ph10 270 /(?(1)ab|ac)(.)/I
3427     Capturing subpattern count = 1
3428 nigel 63 No options
3429     First char = 'a'
3430     No need char
3431    
3432 ph10 270 /(?(1)abz|acz)(.)/I
3433     Capturing subpattern count = 1
3434 nigel 63 No options
3435     First char = 'a'
3436     Need char = 'z'
3437    
3438 ph10 270 /(?(1)abz)(.)/I
3439     Capturing subpattern count = 1
3440 nigel 63 No options
3441     No first char
3442     No need char
3443    
3444 ph10 270 /(?(1)abz)(1)23/I
3445     Capturing subpattern count = 1
3446 nigel 63 No options
3447     No first char
3448     Need char = '3'
3449    
3450     /(a)+/I
3451     Capturing subpattern count = 1
3452     No options
3453     First char = 'a'
3454     No need char
3455    
3456     /(a){2,3}/I
3457     Capturing subpattern count = 1
3458     No options
3459     First char = 'a'
3460     Need char = 'a'
3461    
3462     /(a)*/I
3463     Capturing subpattern count = 1
3464     No options
3465     No first char
3466     No need char
3467    
3468     /[a]/I
3469     Capturing subpattern count = 0
3470     No options
3471     First char = 'a'
3472     No need char
3473    
3474     /[ab]/I
3475     Capturing subpattern count = 0
3476     No options
3477     No first char
3478     No need char
3479    
3480     /[ab]/IS
3481     Capturing subpattern count = 0
3482     No options
3483     No first char
3484     No need char
3485 ph10 455 Subject length lower bound = 1
3486 nigel 75 Starting byte set: a b
3487 nigel 63
3488     /[^a]/I
3489     Capturing subpattern count = 0
3490     No options
3491     No first char
3492     No need char
3493    
3494     /\d456/I
3495     Capturing subpattern count = 0
3496     No options
3497     No first char
3498     Need char = '6'
3499    
3500     /\d456/IS
3501     Capturing subpattern count = 0
3502     No options
3503     No first char
3504     Need char = '6'
3505 ph10 455 Subject length lower bound = 4
3506 nigel 75 Starting byte set: 0 1 2 3 4 5 6 7 8 9
3507 nigel 63
3508     /a^b/I
3509     Capturing subpattern count = 0
3510     No options
3511     First char = 'a'
3512     Need char = 'b'
3513    
3514 nigel 93 /^a/Im
3515 nigel 63 Capturing subpattern count = 0
3516     Options: multiline
3517 nigel 91 First char at start or follows newline
3518 nigel 63 Need char = 'a'
3519     abcde
3520     0: a
3521 ph10 102 xy\nabc
3522 nigel 63 0: a
3523 ph10 102 *** Failers
3524 nigel 63 No match
3525 ph10 102 xyabc
3526 nigel 63 No match
3527    
3528     /c|abc/I
3529     Capturing subpattern count = 0
3530     No options
3531     No first char
3532     Need char = 'c'
3533    
3534     /(?i)[ab]/IS
3535     Capturing subpattern count = 0
3536     Options: caseless
3537     No first char
3538     No need char
3539 ph10 455 Subject length lower bound = 1
3540 nigel 75 Starting byte set: A B a b
3541 nigel 63
3542     /[ab](?i)cd/IS
3543     Capturing subpattern count = 0
3544     No options
3545     No first char
3546     Need char = 'd' (caseless)
3547 ph10 455 Subject length lower bound = 3
3548 nigel 75 Starting byte set: a b
3549 nigel 63
3550 nigel 93 /abc(?C)def/I
3551 nigel 63 Capturing subpattern count = 0
3552     No options
3553     First char = 'a'
3554     Need char = 'f'
3555     abcdef
3556     --->abcdef
3557 nigel 75 0 ^ ^ d
3558 nigel 63 0: abcdef
3559 ph10 102 1234abcdef
3560 nigel 63 --->1234abcdef
3561 nigel 75 0 ^ ^ d
3562 nigel 63 0: abcdef
3563     *** Failers
3564     No match
3565     abcxyz
3566     No match
3567 ph10 102 abcxyzf
3568 nigel 63 --->abcxyzf
3569 nigel 75 0 ^ ^ d
3570 nigel 63 No match
3571    
3572 nigel 93 /abc(?C)de(?C1)f/I
3573 nigel 63 Capturing subpattern count = 0
3574     No options
3575     First char = 'a'
3576     Need char = 'f'
3577     123abcdef
3578     --->123abcdef
3579 nigel 75 0 ^ ^ d
3580     1 ^ ^ f
3581 nigel 63 0: abcdef
3582 ph10 102
3583 ph10 612 /(?C1)\dabc(?C2)def/IS
3584 nigel 63 Capturing subpattern count = 0
3585     No options
3586     No first char
3587     Need char = 'f'
3588 ph10 612 Subject length lower bound = 7
3589     Starting byte set: 0 1 2 3 4 5 6 7 8 9
3590 nigel 63 1234abcdef
3591     --->1234abcdef
3592 nigel 75 1 ^ \d
3593     1 ^ \d
3594     1 ^ \d
3595     1 ^ \d
3596     2 ^ ^ d
3597 nigel 63 0: 4abcdef
3598     *** Failers
3599     No match
3600 ph10 102 abcdef
3601 ph10 612 No match
3602    
3603     /(?C1)\dabc(?C2)def/ISS
3604     Capturing subpattern count = 0
3605     No options
3606     No first char
3607     Need char = 'f'
3608     1234abcdef
3609     --->1234abcdef
3610     1 ^ \d
3611     1 ^ \d
3612     1 ^ \d
3613     1 ^ \d
3614     2 ^ ^ d
3615     0: 4abcdef
3616     *** Failers
3617     No match
3618     abcdef
3619 nigel 63 --->abcdef
3620 nigel 75 1 ^ \d
3621     1 ^ \d
3622     1 ^ \d
3623     1 ^ \d
3624     1 ^ \d
3625     1 ^ \d
3626 nigel 63 No match
3627 ph10 102
3628 nigel 93 /(?C255)ab/I
3629 nigel 63 Capturing subpattern count = 0
3630     No options
3631     First char = 'a'
3632     Need char = 'b'
3633    
3634 nigel 93 /(?C256)ab/I
3635 nigel 63 Failed: number after (?C is > 255 at offset 6
3636    
3637 ph10 102 /(?Cab)xx/I
3638 nigel 63 Failed: closing ) for (?C expected at offset 3
3639    
3640 nigel 93 /(?C12vr)x/I
3641 nigel 63 Failed: closing ) for (?C expected at offset 5
3642    
3643 nigel 93 /abc(?C)def/I
3644 nigel 63 Capturing subpattern count = 0
3645     No options
3646     First char = 'a'
3647     Need char = 'f'
3648     *** Failers
3649     No match
3650     \x83\x0\x61bcdef
3651     --->\x83\x00abcdef
3652 nigel 75 0 ^ ^ d
3653 nigel 63 0: abcdef
3654    
3655 nigel 93 /(abc)(?C)de(?C1)f/I
3656 nigel 63 Capturing subpattern count = 1
3657     No options
3658     First char = 'a'
3659     Need char = 'f'
3660     123abcdef
3661     --->123abcdef
3662 nigel 75 0 ^ ^ d
3663     1 ^ ^ f
3664 nigel 63 0: abcdef
3665     1: abc
3666 ph10 102 123abcdef\C+
3667 nigel 63 Callout 0: last capture = 1
3668     0: <unset>
3669     1: abc
3670     --->123abcdef
3671 nigel 75 ^ ^ d
3672 nigel 63 Callout 1: last capture = 1
3673     0: <unset>
3674     1: abc
3675     --->123abcdef
3676 nigel 75 ^ ^ f
3677 nigel 63 0: abcdef
3678     1: abc
3679 ph10 102 123abcdef\C-
3680 nigel 63 0: abcdef
3681     1: abc
3682     *** Failers
3683     No match
3684 ph10 102 123abcdef\C!1
3685 nigel 63 --->123abcdef
3686 nigel 75 0 ^ ^ d
3687     1 ^ ^ f
3688 nigel 63 No match
3689 ph10 102
3690 nigel 93 /(?C0)(abc(?C1))*/I
3691 nigel 63 Capturing subpattern count = 1
3692     No options
3693     No first char
3694     No need char
3695     abcabcabc
3696     --->abcabcabc
3697 nigel 75 0 ^ (abc(?C1))*
3698     1 ^ ^ )
3699     1 ^ ^ )
3700     1 ^ ^ )
3701 nigel 63 0: abcabcabc
3702     1: abc
3703 ph10 102 abcabc\C!1!3
3704 nigel 63 --->abcabc
3705 nigel 75 0 ^ (abc(?C1))*
3706     1 ^ ^ )
3707     1 ^ ^ )
3708 nigel 63 0: abcabc
3709     1: abc
3710     *** Failers
3711     --->*** Failers
3712 nigel 75 0 ^ (abc(?C1))*
3713 nigel 63 0:
3714 ph10 102 abcabcabc\C!1!3
3715 nigel 63 --->abcabcabc
3716 nigel 75 0 ^ (abc(?C1))*
3717     1 ^ ^ )
3718     1 ^ ^ )
3719     1 ^ ^ )
3720 nigel 63 0: abcabc
3721     1: abc
3722    
3723 nigel 93 /(\d{3}(?C))*/I
3724 nigel 63 Capturing subpattern count = 1
3725     No options
3726     No first char
3727     No need char
3728     123\C+
3729     Callout 0: last capture = -1
3730     0: <unset>
3731     --->123
3732 nigel 75 ^ ^ )
3733 nigel 63 0: 123
3734     1: 123
3735     123456\C+
3736     Callout 0: last capture = -1
3737     0: <unset>
3738     --->123456
3739 nigel 75 ^ ^ )
3740 nigel 63 Callout 0: last capture = 1
3741     0: <unset>
3742     1: 123
3743     --->123456
3744 nigel 75 ^ ^ )
3745 nigel 63 0: 123456
3746     1: 456
3747 ph10 102 123456789\C+
3748 nigel 63 Callout 0: last capture = -1
3749     0: <unset>
3750     --->123456789
3751 nigel 75 ^ ^ )
3752 nigel 63 Callout 0: last capture = 1
3753     0: <unset>
3754     1: 123
3755     --->123456789
3756 nigel 75 ^ ^ )
3757 nigel 63 Callout 0: last capture = 1
3758     0: <unset>
3759     1: 456
3760     --->123456789
3761 nigel 75 ^ ^ )
3762 nigel 63 0: 123456789
3763     1: 789
3764    
3765 nigel 93 /((xyz)(?C)p|(?C1)xyzabc)/I
3766 nigel 63 Capturing subpattern count = 2
3767     No options
3768     First char = 'x'
3769     No need char
3770     xyzabc\C+
3771     Callout 0: last capture = 2
3772     0: <unset>
3773     1: <unset>
3774     2: xyz
3775     --->xyzabc
3776 nigel 75 ^ ^ p
3777 nigel 63 Callout 1: last capture = -1
3778     0: <unset>
3779     --->xyzabc
3780 nigel 75 ^ x
3781 nigel 63 0: xyzabc
3782     1: xyzabc
3783    
3784 nigel 93 /(X)((xyz)(?C)p|(?C1)xyzabc)/I
3785 nigel 63 Capturing subpattern count = 3
3786     No options
3787     First char = 'X'
3788     Need char = 'x'
3789     Xxyzabc\C+
3790     Callout 0: last capture = 3
3791     0: <unset>
3792     1: X
3793     2: <unset>
3794     3: xyz
3795     --->Xxyzabc
3796 nigel 75 ^ ^ p
3797 nigel 63 Callout 1: last capture = 1
3798     0: <unset>
3799     1: X
3800     --->Xxyzabc
3801 nigel 75 ^^ x
3802 nigel 63 0: Xxyzabc
3803     1: X
3804     2: xyzabc
3805    
3806 nigel 93 /(?=(abc))(?C)abcdef/I
3807 nigel 63 Capturing subpattern count = 1
3808     No options
3809     First char = 'a'
3810     Need char = 'f'
3811     abcdef\C+
3812     Callout 0: last capture = 1
3813     0: <unset>
3814     1: abc
3815     --->abcdef
3816 nigel 75 ^ a
3817 nigel 63 0: abcdef
3818     1: abc
3819 ph10 102
3820 nigel 93 /(?!(abc)(?C1)d)(?C2)abcxyz/I
3821 nigel 63 Capturing subpattern count = 1
3822     No options
3823     First char = 'a'
3824     Need char = 'z'
3825 ph10 102 abcxyz\C+
3826 nigel 63 Callout 1: last capture = 1
3827     0: <unset>
3828     1: abc
3829     --->abcxyz
3830 nigel 75 ^ ^ d
3831 nigel 63 Callout 2: last capture = -1
3832     0: <unset>
3833     --->abcxyz
3834 nigel 75 ^ a
3835 nigel 63 0: abcxyz
3836    
3837 nigel 93 /(?<=(abc)(?C))xyz/I
3838 nigel 63 Capturing subpattern count = 1
3839     No options
3840     First char = 'x'
3841     Need char = 'z'
3842     abcxyz\C+
3843     Callout 0: last capture = 1
3844     0: <unset>
3845     1: abc
3846     --->abcxyz
3847 nigel 75 ^ )
3848 nigel 63 0: xyz
3849     1: abc
3850 ph10 102
3851 nigel 93 /a(b+)(c*)(?C1)/I
3852 nigel 77 Capturing subpattern count = 2
3853     No options
3854     First char = 'a'
3855     Need char = 'b'
3856     abbbbbccc\C*1
3857     --->abbbbbccc
3858     1 ^ ^
3859     Callout data = 1
3860     1 ^ ^
3861     Callout data = 1
3862     1 ^ ^
3863     Callout data = 1
3864     1 ^ ^
3865     Callout data = 1
3866     1 ^ ^
3867     Callout data = 1
3868     1 ^ ^
3869     Callout data = 1
3870     1 ^ ^
3871     Callout data = 1
3872     1 ^ ^
3873     Callout data = 1
3874     No match
3875    
3876 nigel 93 /a(b+?)(c*?)(?C1)/I
3877 nigel 77 Capturing subpattern count = 2
3878     No options
3879     First char = 'a'
3880     Need char = 'b'
3881     abbbbbccc\C*1
3882     --->abbbbbccc
3883     1 ^ ^
3884     Callout data = 1
3885     1 ^ ^
3886     Callout data = 1
3887     1 ^ ^
3888     Callout data = 1
3889     1 ^ ^
3890     Callout data = 1
3891     1 ^ ^
3892     Callout data = 1
3893     1 ^ ^
3894     Callout data = 1
3895     1 ^ ^
3896     Callout data = 1
3897     1 ^ ^
3898     Callout data = 1
3899     No match
3900 ph10 102
3901     /(?C)abc/I
3902 nigel 63 Capturing subpattern count = 0
3903     No options
3904     First char = 'a'
3905     Need char = 'c'
3906    
3907 nigel 93 /(?C)^abc/I
3908 nigel 63 Capturing subpattern count = 0
3909     Options: anchored
3910     No first char
3911 nigel 65 No need char
3912 nigel 63
3913 nigel 93 /(?C)a|b/IS
3914 nigel 63 Capturing subpattern count = 0
3915     No options
3916     No first char
3917     No need char
3918 ph10 455 Subject length lower bound = 1
3919 nigel 75 Starting byte set: a b
3920 nigel 63
3921 nigel 93 /(?R)/I
3922 nigel 63 Failed: recursive call could loop indefinitely at offset 3
3923    
3924 nigel 93 /(a|(?R))/I
3925 nigel 63 Failed: recursive call could loop indefinitely at offset 6
3926    
3927 nigel 93 /(ab|(bc|(de|(?R))))/I
3928 nigel 63 Failed: recursive call could loop indefinitely at offset 15
3929    
3930 nigel 93 /x(ab|(bc|(de|(?R))))/I
3931 nigel 63 Capturing subpattern count = 3
3932     No options
3933     First char = 'x'
3934     No need char
3935     xab
3936     0: xab
3937     1: ab
3938     xbc
3939     0: xbc
3940     1: bc
3941     2: bc
3942     xde
3943     0: xde
3944     1: de
3945     2: de
3946     3: de
3947     xxab
3948     0: xxab
3949     1: xab
3950     2: xab
3951     3: xab
3952     xxxab
3953     0: xxxab
3954     1: xxab
3955     2: xxab
3956     3: xxab
3957     *** Failers
3958     No match
3959 ph10 102 xyab
3960 nigel 63 No match
3961    
3962 nigel 93 /(ab|(bc|(de|(?1))))/I
3963 nigel 63 Failed: recursive call could loop indefinitely at offset 15
3964    
3965 nigel 93 /x(ab|(bc|(de|(?1)x)x)x)/I
3966 nigel 63 Failed: recursive call could loop indefinitely at offset 16
3967    
3968 nigel 93 /^([^()]|\((?1)*\))*$/I
3969 nigel 63 Capturing subpattern count = 1
3970     Options: anchored
3971     No first char
3972     No need char
3973     abc
3974     0: abc
3975     1: c
3976     a(b)c
3977     0: a(b)c
3978     1: c
3979 ph10 102 a(b(c))d
3980 nigel 63 0: a(b(c))d
3981     1: d
3982     *** Failers)
3983     No match
3984 ph10 102 a(b(c)d
3985 nigel 63 No match
3986    
3987 nigel 93 /^>abc>([^()]|\((?1)*\))*<xyz<$/I
3988 nigel 63 Capturing subpattern count = 1
3989     Options: anchored
3990     No first char
3991     Need char = '<'
3992     >abc>123<xyz<
3993     0: >abc>123<xyz<
3994     1: 3
3995     >abc>1(2)3<xyz<
3996     0: >abc>1(2)3<xyz<
3997     1: 3
3998     >abc>(1(2)3)<xyz<
3999