1# There are two sorts of patterns in this test. A number of them are
2# representative patterns whose lengths and offsets are checked. This is just a
3# doublecheck test to ensure the sizes don't go horribly wrong when something
4# is changed. The operation of these patterns is checked in other tests.
5#
6# This file also contains tests whose output varies with code unit size and/or
7# link size. Unicode support is required for these tests. There are separate
8# output files for each code unit size and link size.
9
10#pattern fullbincode,memory
11
12/((?i)b)/
13Memory allocation (code space): 25
14------------------------------------------------------------------
15  0  19 Bra
16  5   9 CBra 1
17 12  /i b
18 14   9 Ket
19 19  19 Ket
20 24     End
21------------------------------------------------------------------
22
23/(?s)(.*X|^B)/
24Memory allocation (code space): 35
25------------------------------------------------------------------
26  0  29 Bra
27  5  11 CBra 1
28 12     AllAny*
29 14     X
30 16   8 Alt
31 21     ^
32 22     B
33 24  19 Ket
34 29  29 Ket
35 34     End
36------------------------------------------------------------------
37
38/(?s:.*X|^B)/
39Memory allocation (code space): 33
40------------------------------------------------------------------
41  0  27 Bra
42  5   9 Bra
43 10     AllAny*
44 12     X
45 14   8 Alt
46 19     ^
47 20     B
48 22  17 Ket
49 27  27 Ket
50 32     End
51------------------------------------------------------------------
52
53/^[[:alnum:]]/
54Memory allocation (code space): 45
55------------------------------------------------------------------
56  0  39 Bra
57  5     ^
58  6     [0-9A-Za-z]
59 39  39 Ket
60 44     End
61------------------------------------------------------------------
62
63/#/Ix
64Memory allocation (code space): 11
65------------------------------------------------------------------
66  0   5 Bra
67  5   5 Ket
68 10     End
69------------------------------------------------------------------
70Capturing subpattern count = 0
71May match empty string
72Options: extended
73Subject length lower bound = 0
74
75/a#/Ix
76Memory allocation (code space): 13
77------------------------------------------------------------------
78  0   7 Bra
79  5     a
80  7   7 Ket
81 12     End
82------------------------------------------------------------------
83Capturing subpattern count = 0
84Options: extended
85First code unit = 'a'
86Subject length lower bound = 1
87
88/x?+/
89Memory allocation (code space): 13
90------------------------------------------------------------------
91  0   7 Bra
92  5     x?+
93  7   7 Ket
94 12     End
95------------------------------------------------------------------
96
97/x++/
98Memory allocation (code space): 13
99------------------------------------------------------------------
100  0   7 Bra
101  5     x++
102  7   7 Ket
103 12     End
104------------------------------------------------------------------
105
106/x{1,3}+/
107Memory allocation (code space): 17
108------------------------------------------------------------------
109  0  11 Bra
110  5     x
111  7     x{0,2}+
112 11  11 Ket
113 16     End
114------------------------------------------------------------------
115
116/(x)*+/
117Memory allocation (code space): 26
118------------------------------------------------------------------
119  0  20 Bra
120  5     Braposzero
121  6   9 CBraPos 1
122 13     x
123 15   9 KetRpos
124 20  20 Ket
125 25     End
126------------------------------------------------------------------
127
128/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/
129Memory allocation (code space): 144
130------------------------------------------------------------------
131  0 138 Bra
132  5     ^
133  6 127 CBra 1
134 13   9 CBra 2
135 20     a+
136 22   9 Ket
137 27  41 CBra 3
138 34     [ab]+?
139 68  41 Ket
140 73  41 CBra 4
141 80     [bc]+
142114  41 Ket
143119   9 CBra 5
144126     \w*+
145128   9 Ket
146133 127 Ket
147138 138 Ket
148143     End
149------------------------------------------------------------------
150
151"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"
152Memory allocation (code space): 830
153------------------------------------------------------------------
154  0 824 Bra
155  5     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
156823     \b
157824 824 Ket
158829     End
159------------------------------------------------------------------
160
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\b"
162Memory allocation (code space): 820
163------------------------------------------------------------------
164  0 814 Bra
165  5     $<.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
166813     \b
167814 814 Ket
168819     End
169------------------------------------------------------------------
170
171/(a(?1)b)/
172Memory allocation (code space): 32
173------------------------------------------------------------------
174  0  26 Bra
175  5  16 CBra 1
176 12     a
177 14   5 Recurse
178 19     b
179 21  16 Ket
180 26  26 Ket
181 31     End
182------------------------------------------------------------------
183
184/(a(?1)+b)/
185Memory allocation (code space): 42
186------------------------------------------------------------------
187  0  36 Bra
188  5  26 CBra 1
189 12     a
190 14  10 Once
191 19   5 Recurse
192 24  10 KetRmax
193 29     b
194 31  26 Ket
195 36  36 Ket
196 41     End
197------------------------------------------------------------------
198
199/a(?P<name1>b|c)d(?P<longername2>e)/
200Memory allocation (code space): 50
201------------------------------------------------------------------
202  0  44 Bra
203  5     a
204  7   9 CBra 1
205 14     b
206 16   7 Alt
207 21     c
208 23  16 Ket
209 28     d
210 30   9 CBra 2
211 37     e
212 39   9 Ket
213 44  44 Ket
214 49     End
215------------------------------------------------------------------
216
217/(?:a(?P<c>c(?P<d>d)))(?P<a>a)/
218Memory allocation (code space): 65
219------------------------------------------------------------------
220  0  59 Bra
221  5  35 Bra
222 10     a
223 12  23 CBra 1
224 19     c
225 21   9 CBra 2
226 28     d
227 30   9 Ket
228 35  23 Ket
229 40  35 Ket
230 45   9 CBra 3
231 52     a
232 54   9 Ket
233 59  59 Ket
234 64     End
235------------------------------------------------------------------
236
237/(?P<a>a)...(?P=a)bbb(?P>a)d/
238Memory allocation (code space): 44
239------------------------------------------------------------------
240  0  38 Bra
241  5   9 CBra 1
242 12     a
243 14   9 Ket
244 19     Any
245 20     Any
246 21     Any
247 22     \1
248 25     bbb
249 31   5 Recurse
250 36     d
251 38  38 Ket
252 43     End
253------------------------------------------------------------------
254
255/abc(?C255)de(?C)f/
256Memory allocation (code space): 43
257------------------------------------------------------------------
258  0  37 Bra
259  5     abc
260 11     Callout 255 10 1
261 21     de
262 25     Callout 0 16 1
263 35     f
264 37  37 Ket
265 42     End
266------------------------------------------------------------------
267
268/abcde/auto_callout
269Memory allocation (code space): 81
270------------------------------------------------------------------
271  0  75 Bra
272  5     Callout 255 0 1
273 15     a
274 17     Callout 255 1 1
275 27     b
276 29     Callout 255 2 1
277 39     c
278 41     Callout 255 3 1
279 51     d
280 53     Callout 255 4 1
281 63     e
282 65     Callout 255 5 0
283 75  75 Ket
284 80     End
285------------------------------------------------------------------
286
287/\x{100}/utf
288Memory allocation (code space): 14
289------------------------------------------------------------------
290  0   8 Bra
291  5     \x{100}
292  8   8 Ket
293 13     End
294------------------------------------------------------------------
295
296/\x{1000}/utf
297Memory allocation (code space): 15
298------------------------------------------------------------------
299  0   9 Bra
300  5     \x{1000}
301  9   9 Ket
302 14     End
303------------------------------------------------------------------
304
305/\x{10000}/utf
306Memory allocation (code space): 16
307------------------------------------------------------------------
308  0  10 Bra
309  5     \x{10000}
310 10  10 Ket
311 15     End
312------------------------------------------------------------------
313
314/\x{100000}/utf
315Memory allocation (code space): 16
316------------------------------------------------------------------
317  0  10 Bra
318  5     \x{100000}
319 10  10 Ket
320 15     End
321------------------------------------------------------------------
322
323/\x{10ffff}/utf
324Memory allocation (code space): 16
325------------------------------------------------------------------
326  0  10 Bra
327  5     \x{10ffff}
328 10  10 Ket
329 15     End
330------------------------------------------------------------------
331
332/\x{110000}/utf
333Failed: error 134 at offset 9: character code point value in \x{} or \o{} is too large
334
335/[\x{ff}]/utf
336Memory allocation (code space): 14
337------------------------------------------------------------------
338  0   8 Bra
339  5     \x{ff}
340  8   8 Ket
341 13     End
342------------------------------------------------------------------
343
344/[\x{100}]/utf
345Memory allocation (code space): 14
346------------------------------------------------------------------
347  0   8 Bra
348  5     \x{100}
349  8   8 Ket
350 13     End
351------------------------------------------------------------------
352
353/\x80/utf
354Memory allocation (code space): 14
355------------------------------------------------------------------
356  0   8 Bra
357  5     \x{80}
358  8   8 Ket
359 13     End
360------------------------------------------------------------------
361
362/\xff/utf
363Memory allocation (code space): 14
364------------------------------------------------------------------
365  0   8 Bra
366  5     \x{ff}
367  8   8 Ket
368 13     End
369------------------------------------------------------------------
370
371/\x{0041}\x{2262}\x{0391}\x{002e}/I,utf
372Memory allocation (code space): 22
373------------------------------------------------------------------
374  0  16 Bra
375  5     A\x{2262}\x{391}.
376 16  16 Ket
377 21     End
378------------------------------------------------------------------
379Capturing subpattern count = 0
380Options: utf
381First code unit = 'A'
382Last code unit = '.'
383Subject length lower bound = 4
384
385/\x{D55c}\x{ad6d}\x{C5B4}/I,utf
386Memory allocation (code space): 23
387------------------------------------------------------------------
388  0  17 Bra
389  5     \x{d55c}\x{ad6d}\x{c5b4}
390 17  17 Ket
391 22     End
392------------------------------------------------------------------
393Capturing subpattern count = 0
394Options: utf
395First code unit = \xed
396Last code unit = \xb4
397Subject length lower bound = 3
398
399/\x{65e5}\x{672c}\x{8a9e}/I,utf
400Memory allocation (code space): 23
401------------------------------------------------------------------
402  0  17 Bra
403  5     \x{65e5}\x{672c}\x{8a9e}
404 17  17 Ket
405 22     End
406------------------------------------------------------------------
407Capturing subpattern count = 0
408Options: utf
409First code unit = \xe6
410Last code unit = \x9e
411Subject length lower bound = 3
412
413/[\x{100}]/utf
414Memory allocation (code space): 14
415------------------------------------------------------------------
416  0   8 Bra
417  5     \x{100}
418  8   8 Ket
419 13     End
420------------------------------------------------------------------
421
422/[Z\x{100}]/utf
423Memory allocation (code space): 53
424------------------------------------------------------------------
425  0  47 Bra
426  5     [Z\x{100}]
427 47  47 Ket
428 52     End
429------------------------------------------------------------------
430
431/^[\x{100}\E-\Q\E\x{150}]/utf
432Memory allocation (code space): 24
433------------------------------------------------------------------
434  0  18 Bra
435  5     ^
436  6     [\x{100}-\x{150}]
437 18  18 Ket
438 23     End
439------------------------------------------------------------------
440
441/^[\QĀ\E-\QŐ\E]/utf
442Memory allocation (code space): 24
443------------------------------------------------------------------
444  0  18 Bra
445  5     ^
446  6     [\x{100}-\x{150}]
447 18  18 Ket
448 23     End
449------------------------------------------------------------------
450
451/^[\QĀ\E-\QŐ\E/utf
452Failed: error 106 at offset 15: missing terminating ] for character class
453
454/[\p{L}]/
455Memory allocation (code space): 21
456------------------------------------------------------------------
457  0  15 Bra
458  5     [\p{L}]
459 15  15 Ket
460 20     End
461------------------------------------------------------------------
462
463/[\p{^L}]/
464Memory allocation (code space): 21
465------------------------------------------------------------------
466  0  15 Bra
467  5     [\P{L}]
468 15  15 Ket
469 20     End
470------------------------------------------------------------------
471
472/[\P{L}]/
473Memory allocation (code space): 21
474------------------------------------------------------------------
475  0  15 Bra
476  5     [\P{L}]
477 15  15 Ket
478 20     End
479------------------------------------------------------------------
480
481/[\P{^L}]/
482Memory allocation (code space): 21
483------------------------------------------------------------------
484  0  15 Bra
485  5     [\p{L}]
486 15  15 Ket
487 20     End
488------------------------------------------------------------------
489
490/[abc\p{L}\x{0660}]/utf
491Memory allocation (code space): 56
492------------------------------------------------------------------
493  0  50 Bra
494  5     [a-c\p{L}\x{660}]
495 50  50 Ket
496 55     End
497------------------------------------------------------------------
498
499/[\p{Nd}]/utf
500Memory allocation (code space): 21
501------------------------------------------------------------------
502  0  15 Bra
503  5     [\p{Nd}]
504 15  15 Ket
505 20     End
506------------------------------------------------------------------
507
508/[\p{Nd}+-]+/utf
509Memory allocation (code space): 54
510------------------------------------------------------------------
511  0  48 Bra
512  5     [+\-\p{Nd}]++
513 48  48 Ket
514 53     End
515------------------------------------------------------------------
516
517/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/i,utf
518Memory allocation (code space): 29
519------------------------------------------------------------------
520  0  23 Bra
521  5  /i A\x{391}\x{10427}\x{ff3a}\x{1fb0}
522 23  23 Ket
523 28     End
524------------------------------------------------------------------
525
526/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/utf
527Memory allocation (code space): 29
528------------------------------------------------------------------
529  0  23 Bra
530  5     A\x{391}\x{10427}\x{ff3a}\x{1fb0}
531 23  23 Ket
532 28     End
533------------------------------------------------------------------
534
535/[\x{105}-\x{109}]/i,utf
536Memory allocation (code space): 23
537------------------------------------------------------------------
538  0  17 Bra
539  5     [\x{104}-\x{109}]
540 17  17 Ket
541 22     End
542------------------------------------------------------------------
543
544/( ( (?(1)0|) )*   )/x
545Memory allocation (code space): 56
546------------------------------------------------------------------
547  0  50 Bra
548  5  40 CBra 1
549 12     Brazero
550 13  27 SCBra 2
551 20  10 Cond
552 25   1 Cond ref
553 28     0
554 30   5 Alt
555 35  15 Ket
556 40  27 KetRmax
557 45  40 Ket
558 50  50 Ket
559 55     End
560------------------------------------------------------------------
561
562/(  (?(1)0|)*   )/x
563Memory allocation (code space): 44
564------------------------------------------------------------------
565  0  38 Bra
566  5  28 CBra 1
567 12     Brazero
568 13  10 SCond
569 18   1 Cond ref
570 21     0
571 23   5 Alt
572 28  15 KetRmax
573 33  28 Ket
574 38  38 Ket
575 43     End
576------------------------------------------------------------------
577
578/[a]/
579Memory allocation (code space): 13
580------------------------------------------------------------------
581  0   7 Bra
582  5     a
583  7   7 Ket
584 12     End
585------------------------------------------------------------------
586
587/[a]/utf
588Memory allocation (code space): 13
589------------------------------------------------------------------
590  0   7 Bra
591  5     a
592  7   7 Ket
593 12     End
594------------------------------------------------------------------
595
596/[\xaa]/
597Memory allocation (code space): 13
598------------------------------------------------------------------
599  0   7 Bra
600  5     \x{aa}
601  7   7 Ket
602 12     End
603------------------------------------------------------------------
604
605/[\xaa]/utf
606Memory allocation (code space): 14
607------------------------------------------------------------------
608  0   8 Bra
609  5     \x{aa}
610  8   8 Ket
611 13     End
612------------------------------------------------------------------
613
614/[^a]/
615Memory allocation (code space): 13
616------------------------------------------------------------------
617  0   7 Bra
618  5     [^a]
619  7   7 Ket
620 12     End
621------------------------------------------------------------------
622
623/[^a]/utf
624Memory allocation (code space): 13
625------------------------------------------------------------------
626  0   7 Bra
627  5     [^a]
628  7   7 Ket
629 12     End
630------------------------------------------------------------------
631
632/[^\xaa]/
633Memory allocation (code space): 13
634------------------------------------------------------------------
635  0   7 Bra
636  5     [^\x{aa}]
637  7   7 Ket
638 12     End
639------------------------------------------------------------------
640
641/[^\xaa]/utf
642Memory allocation (code space): 14
643------------------------------------------------------------------
644  0   8 Bra
645  5     [^\x{aa}]
646  8   8 Ket
647 13     End
648------------------------------------------------------------------
649
650#pattern -memory
651
652/[^\d]/utf,ucp
653------------------------------------------------------------------
654  0  15 Bra
655  5     [^\p{Nd}]
656 15  15 Ket
657 20     End
658------------------------------------------------------------------
659
660/[[:^alpha:][:^cntrl:]]+/utf,ucp
661------------------------------------------------------------------
662  0  19 Bra
663  5     [\P{L}\P{Cc}]++
664 19  19 Ket
665 24     End
666------------------------------------------------------------------
667
668/[[:^cntrl:][:^alpha:]]+/utf,ucp
669------------------------------------------------------------------
670  0  19 Bra
671  5     [\P{Cc}\P{L}]++
672 19  19 Ket
673 24     End
674------------------------------------------------------------------
675
676/[[:alpha:]]+/utf,ucp
677------------------------------------------------------------------
678  0  16 Bra
679  5     [\p{L}]++
680 16  16 Ket
681 21     End
682------------------------------------------------------------------
683
684/[[:^alpha:]\S]+/utf,ucp
685------------------------------------------------------------------
686  0  19 Bra
687  5     [\P{L}\P{Xsp}]++
688 19  19 Ket
689 24     End
690------------------------------------------------------------------
691
692/abc(d|e)(*THEN)x(123(*THEN)4|567(b|q)(*THEN)xx)/
693------------------------------------------------------------------
694  0  93 Bra
695  5     abc
696 11   9 CBra 1
697 18     d
698 20   7 Alt
699 25     e
700 27  16 Ket
701 32     *THEN
702 33     x
703 35  16 CBra 2
704 42     123
705 48     *THEN
706 49     4
707 51  37 Alt
708 56     567
709 62   9 CBra 3
710 69     b
711 71   7 Alt
712 76     q
713 78  16 Ket
714 83     *THEN
715 84     xx
716 88  53 Ket
717 93  93 Ket
718 98     End
719------------------------------------------------------------------
720
721/(((a\2)|(a*)\g<-1>))*a?/
722------------------------------------------------------------------
723  0  83 Bra
724  5     Brazero
725  6  70 SCBra 1
726 13  58 Once
727 18  24 CBra 2
728 25  12 CBra 3
729 32     a
730 34     \2
731 37  12 Ket
732 42  24 Alt
733 47   9 CBra 4
734 54     a*
735 56   9 Ket
736 61  47 Recurse
737 66  48 Ket
738 71  58 Ket
739 76  70 KetRmax
740 81     a?+
741 83  83 Ket
742 88     End
743------------------------------------------------------------------
744
745/((?+1)(\1))/
746------------------------------------------------------------------
747  0  47 Bra
748  5  37 Once
749 10  27 CBra 1
750 17  22 Recurse
751 22  10 CBra 2
752 29     \1
753 32  10 Ket
754 37  27 Ket
755 42  37 Ket
756 47  47 Ket
757 52     End
758------------------------------------------------------------------
759
760"(?1)(?#?'){2}(a)"
761------------------------------------------------------------------
762  0  49 Bra
763  5  10 Once
764 10  35 Recurse
765 15  10 Ket
766 20  10 Once
767 25  35 Recurse
768 30  10 Ket
769 35   9 CBra 1
770 42     a
771 44   9 Ket
772 49  49 Ket
773 54     End
774------------------------------------------------------------------
775
776/.((?2)(?R)|\1|$)()/
777------------------------------------------------------------------
778  0  64 Bra
779  5     Any
780  6  41 Once
781 11  17 CBra 1
782 18  52 Recurse
783 23   0 Recurse
784 28   8 Alt
785 33     \1
786 36   6 Alt
787 41     $
788 42  31 Ket
789 47  41 Ket
790 52   7 CBra 2
791 59   7 Ket
792 64  64 Ket
793 69     End
794------------------------------------------------------------------
795
796/.((?3)(?R)()(?2)|\1|$)()/
797------------------------------------------------------------------
798  0  81 Bra
799  5     Any
800  6  58 Once
801 11  34 CBra 1
802 18  69 Recurse
803 23   0 Recurse
804 28   7 CBra 2
805 35   7 Ket
806 40  28 Recurse
807 45   8 Alt
808 50     \1
809 53   6 Alt
810 58     $
811 59  48 Ket
812 64  58 Ket
813 69   7 CBra 3
814 76   7 Ket
815 81  81 Ket
816 86     End
817------------------------------------------------------------------
818
819/(?1)()((((((\1++))\x85)+)|))/
820------------------------------------------------------------------
821  0 115 Bra
822  5  10 Recurse
823 10   7 CBra 1
824 17   7 Ket
825 22  88 CBra 2
826 29  71 CBra 3
827 36  59 CBra 4
828 43  47 CBra 5
829 50  33 CBra 6
830 57  21 CBra 7
831 64   9 Once
832 69     \1+
833 73   9 Ket
834 78  21 Ket
835 83  33 Ket
836 88     \x{85}
837 90  47 KetRmax
838 95  59 Ket
839100   5 Alt
840105  76 Ket
841110  88 Ket
842115 115 Ket
843120     End
844------------------------------------------------------------------
845
846# Check the absolute limit on nesting (?| etc. This varies with code unit
847# width because the workspace is a different number of bytes. It will fail
848# with link size 2 in 8-bit and 16-bit but not in 32-bit.
849
850/(?|(?|(?J:(?|(?x:(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|
851)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
852/parens_nest_limit=1000,-fullbincode
853
854# Use "expand" to create some very long patterns with nested parentheses, in
855# order to test workspace overflow. Again, this varies with code unit width,
856# and even with it fails in two modes, the error offset differs. It also varies
857# with link size - hence multiple tests with different values.
858
859/(?'ABC'\[[bar](]{105}*THEN:\[A]{255}\[)]{106}/expand,-fullbincode
860
861/(?'ABC'\[[bar](]{106}*THEN:\[A]{255}\[)]{107}/expand,-fullbincode
862
863/(?'ABC'\[[bar](]{159}*THEN:\[A]{255}\[)]{160}/expand,-fullbincode
864
865/(?'ABC'\[[bar](]{199}*THEN:\[A]{255}\[)]{200}/expand,-fullbincode
866
867/(?'ABC'\[[bar](]{299}*THEN:\[A]{255}\[)]{300}/expand,-fullbincode
868Failed: error 186 at offset 1224: regular expression is too complicated
869
870/(?(1)(?1)){8,}+()/debug
871------------------------------------------------------------------
872  0 181 Bra
873  5 159 Once
874 10  13 Cond
875 15   1 Cond ref
876 18 169 Recurse
877 23  13 Ket
878 28  13 Cond
879 33   1 Cond ref
880 36 169 Recurse
881 41  13 Ket
882 46  13 Cond
883 51   1 Cond ref
884 54 169 Recurse
885 59  13 Ket
886 64  13 Cond
887 69   1 Cond ref
888 72 169 Recurse
889 77  13 Ket
890 82  13 Cond
891 87   1 Cond ref
892 90 169 Recurse
893 95  13 Ket
894100  13 Cond
895105   1 Cond ref
896108 169 Recurse
897113  13 Ket
898118  13 Cond
899123   1 Cond ref
900126 169 Recurse
901131  13 Ket
902136  23 SBraPos
903141  13 SCond
904146   1 Cond ref
905149 169 Recurse
906154  13 Ket
907159  23 KetRpos
908164 159 Ket
909169   7 CBra 1
910176   7 Ket
911181 181 Ket
912186     End
913------------------------------------------------------------------
914Capturing subpattern count = 1
915Max back reference = 1
916May match empty string
917Subject length lower bound = 0
918    abcd
919 0:
920 1:
921
922/(?(1)|a(?1)b){2,}+()/debug
923------------------------------------------------------------------
924  0  91 Bra
925  5  69 Once
926 10   8 Cond
927 15   1 Cond ref
928 18  14 Alt
929 23     a
930 25  79 Recurse
931 30     b
932 32  22 Ket
933 37  32 SBraPos
934 42   8 SCond
935 47   1 Cond ref
936 50  14 Alt
937 55     a
938 57  79 Recurse
939 62     b
940 64  22 Ket
941 69  32 KetRpos
942 74  69 Ket
943 79   7 CBra 1
944 86   7 Ket
945 91  91 Ket
946 96     End
947------------------------------------------------------------------
948Capturing subpattern count = 1
949Max back reference = 1
950May match empty string
951Subject length lower bound = 0
952    abcde
953No match
954
955/((?1)(?2)(?3)(?4)(?5)(?6)(?7)(?8)(?9)(?9)(?8)(?7)(?6)(?5)(?4)(?3)(?2)(?1)(?0)){2,}()()()()()()()()()/debug
956------------------------------------------------------------------
957  0 327 Bra
958  5 102 CBra 1
959 12   5 Recurse
960 17 219 Recurse
961 22 231 Recurse
962 27 243 Recurse
963 32 255 Recurse
964 37 267 Recurse
965 42 279 Recurse
966 47 291 Recurse
967 52 303 Recurse
968 57 303 Recurse
969 62 291 Recurse
970 67 279 Recurse
971 72 267 Recurse
972 77 255 Recurse
973 82 243 Recurse
974 87 231 Recurse
975 92 219 Recurse
976 97   5 Recurse
977102   0 Recurse
978107 102 Ket
979112 102 SCBra 1
980119   5 Recurse
981124 219 Recurse
982129 231 Recurse
983134 243 Recurse
984139 255 Recurse
985144 267 Recurse
986149 279 Recurse
987154 291 Recurse
988159 303 Recurse
989164 303 Recurse
990169 291 Recurse
991174 279 Recurse
992179 267 Recurse
993184 255 Recurse
994189 243 Recurse
995194 231 Recurse
996199 219 Recurse
997204   5 Recurse
998209   0 Recurse
999214 102 KetRmax
1000219   7 CBra 2
1001226   7 Ket
1002231   7 CBra 3
1003238   7 Ket
1004243   7 CBra 4
1005250   7 Ket
1006255   7 CBra 5
1007262   7 Ket
1008267   7 CBra 6
1009274   7 Ket
1010279   7 CBra 7
1011286   7 Ket
1012291   7 CBra 8
1013298   7 Ket
1014303   7 CBra 9
1015310   7 Ket
1016315   7 CBra 10
1017322   7 Ket
1018327 327 Ket
1019332     End
1020------------------------------------------------------------------
1021Capturing subpattern count = 10
1022May match empty string
1023Subject length lower bound = 0
1024
1025/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)/
1026Failed: error 114 at offset 509: missing closing parenthesis
1027
1028/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))/-fullbincode
1029
1030# End of testinput8
1031