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