xref: /aosp_15_r20/external/pcre/testdata/testoutput8-8-3 (revision 22dc650d8ae982c6770746019a6f94af92b0f024)
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 - compiled block : 157
14Memory allocation - code portion   : 21
15------------------------------------------------------------------
16  0  16 Bra
17  4   8 CBra 1
18 10  /i b
19 12   8 Ket
20 16  16 Ket
21 20     End
22------------------------------------------------------------------
23
24/(?s)(.*X|^B)/
25Memory allocation - compiled block : 166
26Memory allocation - code portion   : 30
27------------------------------------------------------------------
28  0  25 Bra
29  4  10 CBra 1
30 10     AllAny*
31 12     X
32 14   7 Alt
33 18     ^
34 19     B
35 21  17 Ket
36 25  25 Ket
37 29     End
38------------------------------------------------------------------
39
40/(?s:.*X|^B)/
41Memory allocation - compiled block : 164
42Memory allocation - code portion   : 28
43------------------------------------------------------------------
44  0  23 Bra
45  4   8 Bra
46  8     AllAny*
47 10     X
48 12   7 Alt
49 16     ^
50 17     B
51 19  15 Ket
52 23  23 Ket
53 27     End
54------------------------------------------------------------------
55
56/^[[:alnum:]]/
57Memory allocation - compiled block : 179
58Memory allocation - code portion   : 43
59------------------------------------------------------------------
60  0  38 Bra
61  4     ^
62  5     [0-9A-Za-z]
63 38  38 Ket
64 42     End
65------------------------------------------------------------------
66
67/#/Ix
68Memory allocation - compiled block : 145
69Memory allocation - code portion   : 9
70------------------------------------------------------------------
71  0   4 Bra
72  4   4 Ket
73  8     End
74------------------------------------------------------------------
75Capture group count = 0
76May match empty string
77Options: extended
78Subject length lower bound = 0
79
80/a#/Ix
81Memory allocation - compiled block : 147
82Memory allocation - code portion   : 11
83------------------------------------------------------------------
84  0   6 Bra
85  4     a
86  6   6 Ket
87 10     End
88------------------------------------------------------------------
89Capture group count = 0
90Options: extended
91First code unit = 'a'
92Subject length lower bound = 1
93
94/x?+/
95Memory allocation - compiled block : 147
96Memory allocation - code portion   : 11
97------------------------------------------------------------------
98  0   6 Bra
99  4     x?+
100  6   6 Ket
101 10     End
102------------------------------------------------------------------
103
104/x++/
105Memory allocation - compiled block : 147
106Memory allocation - code portion   : 11
107------------------------------------------------------------------
108  0   6 Bra
109  4     x++
110  6   6 Ket
111 10     End
112------------------------------------------------------------------
113
114/x{1,3}+/
115Memory allocation - compiled block : 151
116Memory allocation - code portion   : 15
117------------------------------------------------------------------
118  0  10 Bra
119  4     x
120  6     x{0,2}+
121 10  10 Ket
122 14     End
123------------------------------------------------------------------
124
125/(x)*+/
126Memory allocation - compiled block : 158
127Memory allocation - code portion   : 22
128------------------------------------------------------------------
129  0  17 Bra
130  4     Braposzero
131  5   8 CBraPos 1
132 11     x
133 13   8 KetRpos
134 17  17 Ket
135 21     End
136------------------------------------------------------------------
137
138/^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/
139Memory allocation - compiled block : 268
140Memory allocation - code portion   : 132
141------------------------------------------------------------------
142  0 127 Bra
143  4     ^
144  5 118 CBra 1
145 11   8 CBra 2
146 17     a+
147 19   8 Ket
148 23  40 CBra 3
149 29     [ab]+?
150 63  40 Ket
151 67  40 CBra 4
152 73     [bc]+
153107  40 Ket
154111   8 CBra 5
155117     \w*+
156119   8 Ket
157123 118 Ket
158127 127 Ket
159131     End
160------------------------------------------------------------------
161
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"
163Memory allocation - compiled block : 964
164Memory allocation - code portion   : 828
165------------------------------------------------------------------
166  0 823 Bra
167  4     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
168822     \b
169823 823 Ket
170827     End
171------------------------------------------------------------------
172
173"\$\<\.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"
174Memory allocation - compiled block : 954
175Memory allocation - code portion   : 818
176------------------------------------------------------------------
177  0 813 Bra
178  4     $<.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
179812     \b
180813 813 Ket
181817     End
182------------------------------------------------------------------
183
184/(a(?1)b)/
185Memory allocation - compiled block : 163
186Memory allocation - code portion   : 27
187------------------------------------------------------------------
188  0  22 Bra
189  4  14 CBra 1
190 10     a
191 12   4 Recurse
192 16     b
193 18  14 Ket
194 22  22 Ket
195 26     End
196------------------------------------------------------------------
197
198/(a(?1)+b)/
199Memory allocation - compiled block : 171
200Memory allocation - code portion   : 35
201------------------------------------------------------------------
202  0  30 Bra
203  4  22 CBra 1
204 10     a
205 12   8 SBra
206 16   4 Recurse
207 20   8 KetRmax
208 24     b
209 26  22 Ket
210 30  30 Ket
211 34     End
212------------------------------------------------------------------
213
214/a(?P<name1>b|c)d(?P<longername2>e)/
215Memory allocation - compiled block : 207
216Memory allocation - code portion   : 43
217------------------------------------------------------------------
218  0  38 Bra
219  4     a
220  6   8 CBra 1
221 12     b
222 14   6 Alt
223 18     c
224 20  14 Ket
225 24     d
226 26   8 CBra 2
227 32     e
228 34   8 Ket
229 38  38 Ket
230 42     End
231------------------------------------------------------------------
232
233/(?:a(?P<c>c(?P<d>d)))(?P<a>a)/
234Memory allocation - compiled block : 203
235Memory allocation - code portion   : 55
236------------------------------------------------------------------
237  0  50 Bra
238  4  30 Bra
239  8     a
240 10  20 CBra 1
241 16     c
242 18   8 CBra 2
243 24     d
244 26   8 Ket
245 30  20 Ket
246 34  30 Ket
247 38   8 CBra 3
248 44     a
249 46   8 Ket
250 50  50 Ket
251 54     End
252------------------------------------------------------------------
253
254/(?P<a>a)...(?P=a)bbb(?P>a)d/
255Memory allocation - compiled block : 179
256Memory allocation - code portion   : 39
257------------------------------------------------------------------
258  0  34 Bra
259  4   8 CBra 1
260 10     a
261 12   8 Ket
262 16     Any
263 17     Any
264 18     Any
265 19     \1
266 22     bbb
267 28   4 Recurse
268 32     d
269 34  34 Ket
270 38     End
271------------------------------------------------------------------
272
273/abc(?C255)de(?C)f/
274Memory allocation - compiled block : 173
275Memory allocation - code portion   : 37
276------------------------------------------------------------------
277  0  32 Bra
278  4     abc
279 10     Callout 255 10 1
280 18     de
281 22     Callout 0 16 1
282 30     f
283 32  32 Ket
284 36     End
285------------------------------------------------------------------
286
287/abcde/auto_callout
288Memory allocation - compiled block : 203
289Memory allocation - code portion   : 67
290------------------------------------------------------------------
291  0  62 Bra
292  4     Callout 255 0 1
293 12     a
294 14     Callout 255 1 1
295 22     b
296 24     Callout 255 2 1
297 32     c
298 34     Callout 255 3 1
299 42     d
300 44     Callout 255 4 1
301 52     e
302 54     Callout 255 5 0
303 62  62 Ket
304 66     End
305------------------------------------------------------------------
306
307/\x{100}/utf
308Memory allocation - compiled block : 148
309Memory allocation - code portion   : 12
310------------------------------------------------------------------
311  0   7 Bra
312  4     \x{100}
313  7   7 Ket
314 11     End
315------------------------------------------------------------------
316
317/\x{1000}/utf
318Memory allocation - compiled block : 149
319Memory allocation - code portion   : 13
320------------------------------------------------------------------
321  0   8 Bra
322  4     \x{1000}
323  8   8 Ket
324 12     End
325------------------------------------------------------------------
326
327/\x{10000}/utf
328Memory allocation - compiled block : 150
329Memory allocation - code portion   : 14
330------------------------------------------------------------------
331  0   9 Bra
332  4     \x{10000}
333  9   9 Ket
334 13     End
335------------------------------------------------------------------
336
337/\x{100000}/utf
338Memory allocation - compiled block : 150
339Memory allocation - code portion   : 14
340------------------------------------------------------------------
341  0   9 Bra
342  4     \x{100000}
343  9   9 Ket
344 13     End
345------------------------------------------------------------------
346
347/\x{10ffff}/utf
348Memory allocation - compiled block : 150
349Memory allocation - code portion   : 14
350------------------------------------------------------------------
351  0   9 Bra
352  4     \x{10ffff}
353  9   9 Ket
354 13     End
355------------------------------------------------------------------
356
357/\x{110000}/utf
358Failed: error 134 at offset 9: character code point value in \x{} or \o{} is too large
359
360/[\x{ff}]/utf
361Memory allocation - compiled block : 148
362Memory allocation - code portion   : 12
363------------------------------------------------------------------
364  0   7 Bra
365  4     \x{ff}
366  7   7 Ket
367 11     End
368------------------------------------------------------------------
369
370/[\x{100}]/utf
371Memory allocation - compiled block : 148
372Memory allocation - code portion   : 12
373------------------------------------------------------------------
374  0   7 Bra
375  4     \x{100}
376  7   7 Ket
377 11     End
378------------------------------------------------------------------
379
380/\x80/utf
381Memory allocation - compiled block : 148
382Memory allocation - code portion   : 12
383------------------------------------------------------------------
384  0   7 Bra
385  4     \x{80}
386  7   7 Ket
387 11     End
388------------------------------------------------------------------
389
390/\xff/utf
391Memory allocation - compiled block : 148
392Memory allocation - code portion   : 12
393------------------------------------------------------------------
394  0   7 Bra
395  4     \x{ff}
396  7   7 Ket
397 11     End
398------------------------------------------------------------------
399
400/\x{0041}\x{2262}\x{0391}\x{002e}/I,utf
401Memory allocation - compiled block : 156
402Memory allocation - code portion   : 20
403------------------------------------------------------------------
404  0  15 Bra
405  4     A\x{2262}\x{391}.
406 15  15 Ket
407 19     End
408------------------------------------------------------------------
409Capture group count = 0
410Options: utf
411First code unit = 'A'
412Last code unit = '.'
413Subject length lower bound = 4
414
415/\x{D55c}\x{ad6d}\x{C5B4}/I,utf
416Memory allocation - compiled block : 157
417Memory allocation - code portion   : 21
418------------------------------------------------------------------
419  0  16 Bra
420  4     \x{d55c}\x{ad6d}\x{c5b4}
421 16  16 Ket
422 20     End
423------------------------------------------------------------------
424Capture group count = 0
425Options: utf
426First code unit = \xed
427Last code unit = \xb4
428Subject length lower bound = 3
429
430/\x{65e5}\x{672c}\x{8a9e}/I,utf
431Memory allocation - compiled block : 157
432Memory allocation - code portion   : 21
433------------------------------------------------------------------
434  0  16 Bra
435  4     \x{65e5}\x{672c}\x{8a9e}
436 16  16 Ket
437 20     End
438------------------------------------------------------------------
439Capture group count = 0
440Options: utf
441First code unit = \xe6
442Last code unit = \x9e
443Subject length lower bound = 3
444
445/[\x{100}]/utf
446Memory allocation - compiled block : 148
447Memory allocation - code portion   : 12
448------------------------------------------------------------------
449  0   7 Bra
450  4     \x{100}
451  7   7 Ket
452 11     End
453------------------------------------------------------------------
454
455/[Z\x{100}]/utf
456Memory allocation - compiled block : 186
457Memory allocation - code portion   : 50
458------------------------------------------------------------------
459  0  45 Bra
460  4     [Z\x{100}]
461 45  45 Ket
462 49     End
463------------------------------------------------------------------
464
465/^[\x{100}\E-\Q\E\x{150}]/utf
466Memory allocation - compiled block : 157
467Memory allocation - code portion   : 21
468------------------------------------------------------------------
469  0  16 Bra
470  4     ^
471  5     [\x{100}-\x{150}]
472 16  16 Ket
473 20     End
474------------------------------------------------------------------
475
476/^[\QĀ\E-\QŐ\E]/utf
477Memory allocation - compiled block : 157
478Memory allocation - code portion   : 21
479------------------------------------------------------------------
480  0  16 Bra
481  4     ^
482  5     [\x{100}-\x{150}]
483 16  16 Ket
484 20     End
485------------------------------------------------------------------
486
487/^[\QĀ\E-\QŐ\E/utf
488Failed: error 106 at offset 15: missing terminating ] for character class
489
490/[\p{L}]/
491Memory allocation - compiled block : 154
492Memory allocation - code portion   : 18
493------------------------------------------------------------------
494  0  13 Bra
495  4     [\p{L}]
496 13  13 Ket
497 17     End
498------------------------------------------------------------------
499
500/[\p{^L}]/
501Memory allocation - compiled block : 154
502Memory allocation - code portion   : 18
503------------------------------------------------------------------
504  0  13 Bra
505  4     [\P{L}]
506 13  13 Ket
507 17     End
508------------------------------------------------------------------
509
510/[\P{L}]/
511Memory allocation - compiled block : 154
512Memory allocation - code portion   : 18
513------------------------------------------------------------------
514  0  13 Bra
515  4     [\P{L}]
516 13  13 Ket
517 17     End
518------------------------------------------------------------------
519
520/[\P{^L}]/
521Memory allocation - compiled block : 154
522Memory allocation - code portion   : 18
523------------------------------------------------------------------
524  0  13 Bra
525  4     [\p{L}]
526 13  13 Ket
527 17     End
528------------------------------------------------------------------
529
530/[abc\p{L}\x{0660}]/utf
531Memory allocation - compiled block : 189
532Memory allocation - code portion   : 53
533------------------------------------------------------------------
534  0  48 Bra
535  4     [a-c\p{L}\x{660}]
536 48  48 Ket
537 52     End
538------------------------------------------------------------------
539
540/[\p{Nd}]/utf
541Memory allocation - compiled block : 154
542Memory allocation - code portion   : 18
543------------------------------------------------------------------
544  0  13 Bra
545  4     [\p{Nd}]
546 13  13 Ket
547 17     End
548------------------------------------------------------------------
549
550/[\p{Nd}+-]+/utf
551Memory allocation - compiled block : 187
552Memory allocation - code portion   : 51
553------------------------------------------------------------------
554  0  46 Bra
555  4     [+\-\p{Nd}]++
556 46  46 Ket
557 50     End
558------------------------------------------------------------------
559
560/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/i,utf
561Memory allocation - compiled block : 163
562Memory allocation - code portion   : 27
563------------------------------------------------------------------
564  0  22 Bra
565  4  /i A\x{391}\x{10427}\x{ff3a}\x{1fb0}
566 22  22 Ket
567 26     End
568------------------------------------------------------------------
569
570/A\x{391}\x{10427}\x{ff3a}\x{1fb0}/utf
571Memory allocation - compiled block : 163
572Memory allocation - code portion   : 27
573------------------------------------------------------------------
574  0  22 Bra
575  4     A\x{391}\x{10427}\x{ff3a}\x{1fb0}
576 22  22 Ket
577 26     End
578------------------------------------------------------------------
579
580/[\x{105}-\x{109}]/i,utf
581Memory allocation - compiled block : 156
582Memory allocation - code portion   : 20
583------------------------------------------------------------------
584  0  15 Bra
585  4     [\x{104}-\x{109}]
586 15  15 Ket
587 19     End
588------------------------------------------------------------------
589
590/( ( (?(1)0|) )*   )/x
591Memory allocation - compiled block : 183
592Memory allocation - code portion   : 47
593------------------------------------------------------------------
594  0  42 Bra
595  4  34 CBra 1
596 10     Brazero
597 11  23 SCBra 2
598 17   9 Cond
599 21   1 Cond ref
600 24     0
601 26   4 Alt
602 30  13 Ket
603 34  23 KetRmax
604 38  34 Ket
605 42  42 Ket
606 46     End
607------------------------------------------------------------------
608
609/(  (?(1)0|)*   )/x
610Memory allocation - compiled block : 173
611Memory allocation - code portion   : 37
612------------------------------------------------------------------
613  0  32 Bra
614  4  24 CBra 1
615 10     Brazero
616 11   9 SCond
617 15   1 Cond ref
618 18     0
619 20   4 Alt
620 24  13 KetRmax
621 28  24 Ket
622 32  32 Ket
623 36     End
624------------------------------------------------------------------
625
626/[a]/
627Memory allocation - compiled block : 147
628Memory allocation - code portion   : 11
629------------------------------------------------------------------
630  0   6 Bra
631  4     a
632  6   6 Ket
633 10     End
634------------------------------------------------------------------
635
636/[a]/utf
637Memory allocation - compiled block : 147
638Memory allocation - code portion   : 11
639------------------------------------------------------------------
640  0   6 Bra
641  4     a
642  6   6 Ket
643 10     End
644------------------------------------------------------------------
645
646/[\xaa]/
647Memory allocation - compiled block : 147
648Memory allocation - code portion   : 11
649------------------------------------------------------------------
650  0   6 Bra
651  4     \x{aa}
652  6   6 Ket
653 10     End
654------------------------------------------------------------------
655
656/[\xaa]/utf
657Memory allocation - compiled block : 148
658Memory allocation - code portion   : 12
659------------------------------------------------------------------
660  0   7 Bra
661  4     \x{aa}
662  7   7 Ket
663 11     End
664------------------------------------------------------------------
665
666/[^a]/
667Memory allocation - compiled block : 147
668Memory allocation - code portion   : 11
669------------------------------------------------------------------
670  0   6 Bra
671  4     [^a]
672  6   6 Ket
673 10     End
674------------------------------------------------------------------
675
676/[^a]/utf
677Memory allocation - compiled block : 147
678Memory allocation - code portion   : 11
679------------------------------------------------------------------
680  0   6 Bra
681  4     [^a]
682  6   6 Ket
683 10     End
684------------------------------------------------------------------
685
686/[^\xaa]/
687Memory allocation - compiled block : 147
688Memory allocation - code portion   : 11
689------------------------------------------------------------------
690  0   6 Bra
691  4     [^\x{aa}]
692  6   6 Ket
693 10     End
694------------------------------------------------------------------
695
696/[^\xaa]/utf
697Memory allocation - compiled block : 148
698Memory allocation - code portion   : 12
699------------------------------------------------------------------
700  0   7 Bra
701  4     [^\x{aa}]
702  7   7 Ket
703 11     End
704------------------------------------------------------------------
705
706#pattern -memory
707
708/[^\d]/utf,ucp
709------------------------------------------------------------------
710  0  13 Bra
711  4     [^\p{Nd}]
712 13  13 Ket
713 17     End
714------------------------------------------------------------------
715
716/[[:^alpha:][:^cntrl:]]+/utf,ucp
717------------------------------------------------------------------
718  0  17 Bra
719  4     [\P{L}\P{Cc}]++
720 17  17 Ket
721 21     End
722------------------------------------------------------------------
723
724/[[:^cntrl:][:^alpha:]]+/utf,ucp
725------------------------------------------------------------------
726  0  17 Bra
727  4     [\P{Cc}\P{L}]++
728 17  17 Ket
729 21     End
730------------------------------------------------------------------
731
732/[[:alpha:]]+/utf,ucp
733------------------------------------------------------------------
734  0  14 Bra
735  4     [\p{L}]++
736 14  14 Ket
737 18     End
738------------------------------------------------------------------
739
740/[[:^alpha:]\S]+/utf,ucp
741------------------------------------------------------------------
742  0  17 Bra
743  4     [\P{L}\P{Xsp}]++
744 17  17 Ket
745 21     End
746------------------------------------------------------------------
747
748/abc(d|e)(*THEN)x(123(*THEN)4|567(b|q)(*THEN)xx)/
749------------------------------------------------------------------
750  0  83 Bra
751  4     abc
752 10   8 CBra 1
753 16     d
754 18   6 Alt
755 22     e
756 24  14 Ket
757 28     *THEN
758 29     x
759 31  15 CBra 2
760 37     123
761 43     *THEN
762 44     4
763 46  33 Alt
764 50     567
765 56   8 CBra 3
766 62     b
767 64   6 Alt
768 68     q
769 70  14 Ket
770 74     *THEN
771 75     xx
772 79  48 Ket
773 83  83 Ket
774 87     End
775------------------------------------------------------------------
776
777/(((a\2)|(a*)\g<-1>))*a?/
778------------------------------------------------------------------
779  0  62 Bra
780  4     Brazero
781  5  51 SCBra 1
782 11  21 CBra 2
783 17  11 CBra 3
784 23     a
785 25     \2
786 28  11 Ket
787 32  20 Alt
788 36   8 CBra 4
789 42     a*
790 44   8 Ket
791 48  36 Recurse
792 52  41 Ket
793 56  51 KetRmax
794 60     a?+
795 62  62 Ket
796 66     End
797------------------------------------------------------------------
798
799/((?+1)(\1))/
800------------------------------------------------------------------
801  0  31 Bra
802  4  23 CBra 1
803 10  14 Recurse
804 14   9 CBra 2
805 20     \1
806 23   9 Ket
807 27  23 Ket
808 31  31 Ket
809 35     End
810------------------------------------------------------------------
811
812"(?1)(?#?'){2}(a)"
813------------------------------------------------------------------
814  0  24 Bra
815  4  12 Recurse
816  8  12 Recurse
817 12   8 CBra 1
818 18     a
819 20   8 Ket
820 24  24 Ket
821 28     End
822------------------------------------------------------------------
823
824/.((?2)(?R)|\1|$)()/
825------------------------------------------------------------------
826  0  45 Bra
827  4     Any
828  5  14 CBra 1
829 11  35 Recurse
830 15   0 Recurse
831 19   7 Alt
832 23     \1
833 26   5 Alt
834 30     $
835 31  26 Ket
836 35   6 CBra 2
837 41   6 Ket
838 45  45 Ket
839 49     End
840------------------------------------------------------------------
841
842/.((?3)(?R)()(?2)|\1|$)()/
843------------------------------------------------------------------
844  0  59 Bra
845  4     Any
846  5  28 CBra 1
847 11  49 Recurse
848 15   0 Recurse
849 19   6 CBra 2
850 25   6 Ket
851 29  19 Recurse
852 33   7 Alt
853 37     \1
854 40   5 Alt
855 44     $
856 45  40 Ket
857 49   6 CBra 3
858 55   6 Ket
859 59  59 Ket
860 63     End
861------------------------------------------------------------------
862
863/(?1)()((((((\1++))\x85)+)|))/
864------------------------------------------------------------------
865  0  96 Bra
866  4   8 Recurse
867  8   6 CBra 1
868 14   6 Ket
869 18  74 CBra 2
870 24  60 CBra 3
871 30  50 CBra 4
872 36  40 CBra 5
873 42  28 CBra 6
874 48  18 CBra 7
875 54   8 Once
876 58     \1+
877 62   8 Ket
878 66  18 Ket
879 70  28 Ket
880 74     \x{85}
881 76  40 KetRmax
882 80  50 Ket
883 84   4 Alt
884 88  64 Ket
885 92  74 Ket
886 96  96 Ket
887100     End
888------------------------------------------------------------------
889
890# Check the absolute limit on nesting (?| etc. This varies with code unit
891# width because the workspace is a different number of bytes. It will fail
892# with link size 2 in 8-bit and 16-bit but not in 32-bit.
893
894/(?|(?|(?J:(?|(?x:(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|(?|
895)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
896/parens_nest_limit=1000,-fullbincode
897
898# Use "expand" to create some very long patterns with nested parentheses, in
899# order to test workspace overflow. Again, this varies with code unit width,
900# and even when it fails in two modes, the error offset differs. It also varies
901# with link size - hence multiple tests with different values.
902
903/(?'ABC'\[[bar](]{792}*THEN:\[A]{255}\[)]{793}/expand,-fullbincode,parens_nest_limit=1000
904
905/(?'ABC'\[[bar](]{793}*THEN:\[A]{255}\[)]{794}/expand,-fullbincode,parens_nest_limit=1000
906
907/(?'ABC'\[[bar](]{1793}*THEN:\[A]{255}\[)]{1794}/expand,-fullbincode,parens_nest_limit=2000
908Failed: error 186 at offset 12820: regular expression is too complicated
909
910/(?(1)(?1)){8,}+()/debug
911------------------------------------------------------------------
912  0 150 Bra
913  4 132 Once
914  8  11 Cond
915 12   1 Cond ref
916 15 140 Recurse
917 19  11 Ket
918 23  11 Cond
919 27   1 Cond ref
920 30 140 Recurse
921 34  11 Ket
922 38  11 Cond
923 42   1 Cond ref
924 45 140 Recurse
925 49  11 Ket
926 53  11 Cond
927 57   1 Cond ref
928 60 140 Recurse
929 64  11 Ket
930 68  11 Cond
931 72   1 Cond ref
932 75 140 Recurse
933 79  11 Ket
934 83  11 Cond
935 87   1 Cond ref
936 90 140 Recurse
937 94  11 Ket
938 98  11 Cond
939102   1 Cond ref
940105 140 Recurse
941109  11 Ket
942113  19 SBraPos
943117  11 SCond
944121   1 Cond ref
945124 140 Recurse
946128  11 Ket
947132  19 KetRpos
948136 132 Ket
949140   6 CBra 1
950146   6 Ket
951150 150 Ket
952154     End
953------------------------------------------------------------------
954Capture group count = 1
955Max back reference = 1
956May match empty string
957Subject length lower bound = 0
958    abcd
959 0:
960 1:
961
962/(?(1)|a(?1)b){2,}+()/debug
963------------------------------------------------------------------
964  0  76 Bra
965  4  58 Once
966  8   7 Cond
967 12   1 Cond ref
968 15  12 Alt
969 19     a
970 21  66 Recurse
971 25     b
972 27  19 Ket
973 31  27 SBraPos
974 35   7 SCond
975 39   1 Cond ref
976 42  12 Alt
977 46     a
978 48  66 Recurse
979 52     b
980 54  19 Ket
981 58  27 KetRpos
982 62  58 Ket
983 66   6 CBra 1
984 72   6 Ket
985 76  76 Ket
986 80     End
987------------------------------------------------------------------
988Capture group count = 1
989Max back reference = 1
990May match empty string
991Subject length lower bound = 0
992    abcde
993No match
994
995/((?1)(?2)(?3)(?4)(?5)(?6)(?7)(?8)(?9)(?9)(?8)(?7)(?6)(?5)(?4)(?3)(?2)(?1)(?0)){2,}()()()()()()()()()/debug
996------------------------------------------------------------------
997  0 266 Bra
998  4  82 CBra 1
999 10   4 Recurse
1000 14 176 Recurse
1001 18 186 Recurse
1002 22 196 Recurse
1003 26 206 Recurse
1004 30 216 Recurse
1005 34 226 Recurse
1006 38 236 Recurse
1007 42 246 Recurse
1008 46 246 Recurse
1009 50 236 Recurse
1010 54 226 Recurse
1011 58 216 Recurse
1012 62 206 Recurse
1013 66 196 Recurse
1014 70 186 Recurse
1015 74 176 Recurse
1016 78   4 Recurse
1017 82   0 Recurse
1018 86  82 Ket
1019 90  82 SCBra 1
1020 96   4 Recurse
1021100 176 Recurse
1022104 186 Recurse
1023108 196 Recurse
1024112 206 Recurse
1025116 216 Recurse
1026120 226 Recurse
1027124 236 Recurse
1028128 246 Recurse
1029132 246 Recurse
1030136 236 Recurse
1031140 226 Recurse
1032144 216 Recurse
1033148 206 Recurse
1034152 196 Recurse
1035156 186 Recurse
1036160 176 Recurse
1037164   4 Recurse
1038168   0 Recurse
1039172  82 KetRmax
1040176   6 CBra 2
1041182   6 Ket
1042186   6 CBra 3
1043192   6 Ket
1044196   6 CBra 4
1045202   6 Ket
1046206   6 CBra 5
1047212   6 Ket
1048216   6 CBra 6
1049222   6 Ket
1050226   6 CBra 7
1051232   6 Ket
1052236   6 CBra 8
1053242   6 Ket
1054246   6 CBra 9
1055252   6 Ket
1056256   6 CBra 10
1057262   6 Ket
1058266 266 Ket
1059270     End
1060------------------------------------------------------------------
1061Capture group count = 10
1062May match empty string
1063Subject length lower bound = 0
1064
1065/([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)/
1066Failed: error 114 at offset 509: missing closing parenthesis
1067
1068/([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
1069
1070#pattern -fullbincode
1071
1072/\[()]{65535}/expand
1073
1074# End of testinput8
1075