/[pcre2]/code/trunk/testdata/testinput2
ViewVC logotype

Contents of /code/trunk/testdata/testinput2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 696 - (show annotations)
Tue Mar 21 17:46:21 2017 UTC (2 years, 4 months ago) by ph10
File size: 88328 byte(s)
Fix 32-bit error buffer size bug in pcre2test (Bugzilla 2079).
1 # This set of tests is not Perl-compatible. It checks on special features
2 # of PCRE2's API, error diagnostics, and the compiled code of some patterns.
3 # It also checks the non-Perl syntax that PCRE2 supports (Python, .NET,
4 # Oniguruma). There are also some tests where PCRE2 and Perl differ,
5 # either because PCRE2 can't be compatible, or there is a possible Perl
6 # bug.
7
8 # NOTE: This is a non-UTF set of tests. When UTF support is needed, use
9 # test 5.
10
11 #forbid_utf
12 #newline_default lf any anycrlf
13
14 # Test binary zeroes in the pattern
15
16 # /a\0B/ where 0 is a binary zero
17 /61 5c 00 62/B,hex
18 a\x{0}b
19
20 # /a0b/ where 0 is a binary zero
21 /61 00 62/B,hex
22 a\x{0}b
23
24 # /(?#B0C)DE/ where 0 is a binary zero
25 /28 3f 23 42 00 43 29 44 45/B,hex
26 DE
27
28 /(a)b|/I
29
30 /abc/I
31 abc
32 defabc
33 abc\=anchored
34 \= Expect no match
35 defabc\=anchored
36 ABC
37
38 /^abc/I
39 abc
40 abc\=anchored
41 \= Expect no match
42 defabc
43 defabc\=anchored
44
45 /a+bc/I
46
47 /a*bc/I
48
49 /a{3}bc/I
50
51 /(abc|a+z)/I
52
53 /^abc$/I
54 abc
55 \= Expect no match
56 def\nabc
57
58 /ab\idef/
59
60 /(?X)ab\idef/
61
62 /x{5,4}/
63
64 /z{65536}/
65
66 /[abcd/
67
68 /[\B]/B
69
70 /[\R]/B
71
72 /[\X]/B
73
74 /[z-a]/
75
76 /^*/
77
78 /(abc/
79
80 /(?# abc/
81
82 /(?z)abc/
83
84 /.*b/I
85
86 /.*?b/I
87
88 /cat|dog|elephant/I
89 this sentence eventually mentions a cat
90 this sentences rambles on and on for a while and then reaches elephant
91
92 /cat|dog|elephant/I
93 this sentence eventually mentions a cat
94 this sentences rambles on and on for a while and then reaches elephant
95
96 /cat|dog|elephant/Ii
97 this sentence eventually mentions a CAT cat
98 this sentences rambles on and on for a while to elephant ElePhant
99
100 /a|[bcd]/I
101
102 /(a|[^\dZ])/I
103
104 /(a|b)*[\s]/I
105
106 /(ab\2)/
107
108 /{4,5}abc/
109
110 /(a)(b)(c)\2/I
111 abcb
112 abcb\=ovector=0
113 abcb\=ovector=1
114 abcb\=ovector=2
115 abcb\=ovector=3
116 abcb\=ovector=4
117
118 /(a)bc|(a)(b)\2/I
119 abc
120 abc\=ovector=0
121 abc\=ovector=1
122 abc\=ovector=2
123 aba
124 aba\=ovector=0
125 aba\=ovector=1
126 aba\=ovector=2
127 aba\=ovector=3
128 aba\=ovector=4
129
130 /abc$/I,dollar_endonly
131 abc
132 \= Expect no match
133 abc\n
134 abc\ndef
135
136 /(a)(b)(c)(d)(e)\6/
137
138 /the quick brown fox/I
139 the quick brown fox
140 this is a line with the quick brown fox
141
142 /the quick brown fox/I,anchored
143 the quick brown fox
144 \= Expect no match
145 this is a line with the quick brown fox
146
147 /ab(?z)cd/
148
149 /^abc|def/I
150 abcdef
151 abcdef\=notbol
152
153 /.*((abc)$|(def))/I
154 defabc
155 defabc\=noteol
156
157 /)/
158
159 /a[]b/
160
161 /[^aeiou ]{3,}/I
162 co-processors, and for
163
164 /<.*>/I
165 abc<def>ghi<klm>nop
166
167 /<.*?>/I
168 abc<def>ghi<klm>nop
169
170 /<.*>/I,ungreedy
171 abc<def>ghi<klm>nop
172
173 /(?U)<.*>/I
174 abc<def>ghi<klm>nop
175
176 /<.*?>/I,ungreedy
177 abc<def>ghi<klm>nop
178
179 /={3,}/I,ungreedy
180 abc========def
181
182 /(?U)={3,}?/I
183 abc========def
184
185 /(?<!bar|cattle)foo/I
186 foo
187 catfoo
188 \= Expect no match
189 the barfoo
190 and cattlefoo
191
192 /abc(?<=a+)b/
193
194 /12345(?<=aaa|b{0,3})b/
195
196 /(?<!(foo)a\1)bar/
197
198 /(?i)abc/I
199
200 /(a|(?m)a)/I
201
202 /(?i)^1234/I
203
204 /(^b|(?i)^d)/I
205
206 /(?s).*/I
207
208 /[abcd]/I
209
210 /(?i)[abcd]/I
211
212 /(?m)[xy]|(b|c)/I
213
214 /(^a|^b)/Im
215
216 /(?i)(^a|^b)/Im
217
218 /(a)(?(1)a|b|c)/
219
220 /(?(?=a)a|b|c)/
221
222 /(?(1a)/
223
224 /(?(1a))/
225
226 /(?(?i))/
227
228 /(?(abc))/
229
230 /(?(?<ab))/
231
232 /((?s)blah)\s+\1/I
233
234 /((?i)blah)\s+\1/I
235
236 /((?i)b)/IB
237
238 /(a*b|(?i:c*(?-i)d))/I
239
240 /a$/I
241 a
242 a\n
243 \= Expect no match
244 a\=noteol
245 a\n\=noteol
246
247 /a$/Im
248 a
249 a\n
250 a\n\=noteol
251 \= Expect no match
252 a\=noteol
253
254 /\Aabc/Im
255
256 /^abc/Im
257
258 /^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/I
259 aaaaabbbbbcccccdef
260
261 /(?<=foo)[ab]/I
262
263 /(?<!foo)(alpha|omega)/I
264
265 /(?!alphabet)[ab]/I
266
267 /(?<=foo\n)^bar/Im
268 foo\nbarbar
269 \= Expect no match
270 rhubarb
271 barbell
272 abc\nbarton
273
274 /^(?<=foo\n)bar/Im
275 foo\nbarbar
276 \= Expect no match
277 rhubarb
278 barbell
279 abc\nbarton
280
281 /(?>^abc)/Im
282 abc
283 def\nabc
284 \= Expect no match
285 defabc
286
287 /(?<=ab(c+)d)ef/
288
289 /(?<=ab(?<=c+)d)ef/
290
291 /(?<=ab(c|de)f)g/
292
293 /The next three are in testinput2 because they have variable length branches/
294
295 /(?<=bullock|donkey)-cart/I
296 the bullock-cart
297 a donkey-cart race
298 \= Expect no match
299 cart
300 horse-and-cart
301
302 /(?<=ab(?i)x|y|z)/I
303
304 /(?>.*)(?<=(abcd)|(xyz))/I
305 alphabetabcd
306 endingxyz
307
308 /(?<=ab(?i)x(?-i)y|(?i)z|b)ZZ/I
309 abxyZZ
310 abXyZZ
311 ZZZ
312 zZZ
313 bZZ
314 BZZ
315 \= Expect no match
316 ZZ
317 abXYZZ
318 zzz
319 bzz
320
321 /(?<!(foo)a)bar/I
322 bar
323 foobbar
324 \= Expect no match
325 fooabar
326
327 # This one is here because Perl behaves differently; see also the following.
328
329 /^(a\1?){4}$/I
330 \= Expect no match
331 aaaa
332 aaaaaa
333
334 # Perl does not fail these two for the final subjects. Neither did PCRE until
335 # release 8.01. The problem is in backtracking into a subpattern that contains
336 # a recursive reference to itself. PCRE has now made these into atomic patterns.
337
338 /^(xa|=?\1a){2}$/
339 xa=xaa
340 \= Expect no match
341 xa=xaaa
342
343 /^(xa|=?\1a)+$/
344 xa=xaa
345 \= Expect no match
346 xa=xaaa
347
348 # These are syntax tests from Perl 5.005
349
350 /a[b-a]/
351
352 /a[]b/
353
354 /a[/
355
356 /*a/
357
358 /(*)b/
359
360 /abc)/
361
362 /(abc/
363
364 /a**/
365
366 /)(/
367
368 /\1/
369
370 /\2/
371
372 /(a)|\2/
373
374 /a[b-a]/Ii
375
376 /a[]b/Ii
377
378 /a[/Ii
379
380 /*a/Ii
381
382 /(*)b/Ii
383
384 /abc)/Ii
385
386 /(abc/Ii
387
388 /a**/Ii
389
390 /)(/Ii
391
392 /:(?:/
393
394 /(?<%)b/
395
396 /a(?{)b/
397
398 /a(?{{})b/
399
400 /a(?{}})b/
401
402 /a(?{"{"})b/
403
404 /a(?{"{"}})b/
405
406 /(?(1?)a|b)/
407
408 /[a[:xyz:/
409
410 /(?<=x+)y/
411
412 /a{37,17}/
413
414 /abc/\
415
416 /abc/\i
417
418 /(a)bc(d)/I
419 abcd
420 abcd\=copy=2
421 abcd\=copy=5
422
423 /(.{20})/I
424 abcdefghijklmnopqrstuvwxyz
425 abcdefghijklmnopqrstuvwxyz\=copy=1
426 abcdefghijklmnopqrstuvwxyz\=get=1
427
428 /(.{15})/I
429 abcdefghijklmnopqrstuvwxyz
430 abcdefghijklmnopqrstuvwxyz\=copy=1,get=1
431
432 /(.{16})/I
433 abcdefghijklmnopqrstuvwxyz
434 abcdefghijklmnopqrstuvwxyz\=copy=1,get=1,getall
435
436 /^(a|(bc))de(f)/I
437 adef\=get=1,get=2,get=3,get=4,getall
438 bcdef\=get=1,get=2,get=3,get=4,getall
439 adefghijk\=copy=0
440
441 /^abc\00def/I
442 abc\00def\=copy=0,getall
443
444 /word ((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+
445 )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+ )((?:[a-zA-Z0-9]+
446 )?)?)?)?)?)?)?)?)?otherword/I
447
448 /.*X/IB
449
450 /.*X/IBs
451
452 /(.*X|^B)/IB
453
454 /(.*X|^B)/IBs
455
456 /(?s)(.*X|^B)/IB
457
458 /(?s:.*X|^B)/IB
459
460 /\Biss\B/I,aftertext
461 Mississippi
462
463 /iss/I,aftertext,altglobal
464 Mississippi
465
466 /\Biss\B/I,aftertext,altglobal
467 Mississippi
468
469 /\Biss\B/Ig,aftertext
470 Mississippi
471 \= Expect no match
472 Mississippi\=anchored
473
474 /(?<=[Ms])iss/Ig,aftertext
475 Mississippi
476
477 /(?<=[Ms])iss/I,aftertext,altglobal
478 Mississippi
479
480 /^iss/Ig,aftertext
481 ississippi
482
483 /.*iss/Ig,aftertext
484 abciss\nxyzisspqr
485
486 /.i./Ig,aftertext
487 Mississippi
488 Mississippi\=anchored
489 Missouri river
490 Missouri river\=anchored
491
492 /^.is/Ig,aftertext
493 Mississippi
494
495 /^ab\n/Ig,aftertext
496 ab\nab\ncd
497
498 /^ab\n/Igm,aftertext
499 ab\nab\ncd
500
501 /^/gm,newline=any
502 a\rb\nc\r\nxyz\=aftertext
503
504 /abc/I
505
506 /abc|bac/I
507
508 /(abc|bac)/I
509
510 /(abc|(c|dc))/I
511
512 /(abc|(d|de)c)/I
513
514 /a*/I
515
516 /a+/I
517
518 /(baa|a+)/I
519
520 /a{0,3}/I
521
522 /baa{3,}/I
523
524 /"([^\\"]+|\\.)*"/I
525
526 /(abc|ab[cd])/I
527
528 /(a|.)/I
529
530 /a|ba|\w/I
531
532 /abc(?=pqr)/I
533
534 /...(?<=abc)/I
535
536 /abc(?!pqr)/I
537
538 /ab./I
539
540 /ab[xyz]/I
541
542 /abc*/I
543
544 /ab.c*/I
545
546 /a.c*/I
547
548 /.c*/I
549
550 /ac*/I
551
552 /(a.c*|b.c*)/I
553
554 /a.c*|aba/I
555
556 /.+a/I
557
558 /(?=abcda)a.*/I
559
560 /(?=a)a.*/I
561
562 /a(b)*/I
563
564 /a\d*/I
565
566 /ab\d*/I
567
568 /a(\d)*/I
569
570 /abcde{0,0}/I
571
572 /ab\d+/I
573
574 /a(?(1)b)(.)/I
575
576 /a(?(1)bag|big)(.)/I
577
578 /a(?(1)bag|big)*(.)/I
579
580 /a(?(1)bag|big)+(.)/I
581
582 /a(?(1)b..|b..)(.)/I
583
584 /ab\d{0}e/I
585
586 /a?b?/I
587 a
588 b
589 ab
590 \
591 \= Expect no match
592 \=notempty
593
594 /|-/I
595 abcd
596 -abc
597 ab-c\=notempty
598 \= Expect no match
599 abc\=notempty
600
601 /^.?abcd/I
602
603 /\( # ( at start
604 (?: # Non-capturing bracket
605 (?>[^()]+) # Either a sequence of non-brackets (no backtracking)
606 | # Or
607 (?R) # Recurse - i.e. nested bracketed string
608 )* # Zero or more contents
609 \) # Closing )
610 /Ix
611 (abcd)
612 (abcd)xyz
613 xyz(abcd)
614 (ab(xy)cd)pqr
615 (ab(xycd)pqr
616 () abc ()
617 12(abcde(fsh)xyz(foo(bar))lmno)89
618 \= Expect no match
619 abcd
620 abcd)
621 (abcd
622
623 /\( ( (?>[^()]+) | (?R) )* \) /Igx
624 (ab(xy)cd)pqr
625 1(abcd)(x(y)z)pqr
626
627 /\( (?: (?>[^()]+) | (?R) ) \) /Ix
628 (abcd)
629 (ab(xy)cd)
630 (a(b(c)d)e)
631 ((ab))
632 \= Expect no match
633 ()
634
635 /\( (?: (?>[^()]+) | (?R) )? \) /Ix
636 ()
637 12(abcde(fsh)xyz(foo(bar))lmno)89
638
639 /\( ( (?>[^()]+) | (?R) )* \) /Ix
640 (ab(xy)cd)
641
642 /\( ( ( (?>[^()]+) | (?R) )* ) \) /Ix
643 (ab(xy)cd)
644
645 /\( (123)? ( ( (?>[^()]+) | (?R) )* ) \) /Ix
646 (ab(xy)cd)
647 (123ab(xy)cd)
648
649 /\( ( (123)? ( (?>[^()]+) | (?R) )* ) \) /Ix
650 (ab(xy)cd)
651 (123ab(xy)cd)
652
653 /\( (((((((((( ( (?>[^()]+) | (?R) )* )))))))))) \) /Ix
654 (ab(xy)cd)
655
656 /\( ( ( (?>[^()<>]+) | ((?>[^()]+)) | (?R) )* ) \) /Ix
657 (abcd(xyz<p>qrs)123)
658
659 /\( ( ( (?>[^()]+) | ((?R)) )* ) \) /Ix
660 (ab(cd)ef)
661 (ab(cd(ef)gh)ij)
662
663 /^[[:alnum:]]/IB
664
665 /^[[:^alnum:]]/IB
666
667 /^[[:alpha:]]/IB
668
669 /^[[:^alpha:]]/IB
670
671 /[_[:alpha:]]/I
672
673 /^[[:ascii:]]/IB
674
675 /^[[:^ascii:]]/IB
676
677 /^[[:blank:]]/IB
678
679 /^[[:^blank:]]/IB
680
681 /[\n\x0b\x0c\x0d[:blank:]]/I
682
683 /^[[:cntrl:]]/IB
684
685 /^[[:digit:]]/IB
686
687 /^[[:graph:]]/IB
688
689 /^[[:lower:]]/IB
690
691 /^[[:print:]]/IB
692
693 /^[[:punct:]]/IB
694
695 /^[[:space:]]/IB
696
697 /^[[:upper:]]/IB
698
699 /^[[:xdigit:]]/IB
700
701 /^[[:word:]]/IB
702
703 /^[[:^cntrl:]]/IB
704
705 /^[12[:^digit:]]/IB
706
707 /^[[:^blank:]]/IB
708
709 /[01[:alpha:]%]/IB
710
711 /[[.ch.]]/I
712
713 /[[=ch=]]/I
714
715 /[[:rhubarb:]]/I
716
717 /[[:upper:]]/Ii
718 A
719 a
720
721 /[[:lower:]]/Ii
722 A
723 a
724
725 /((?-i)[[:lower:]])[[:lower:]]/Ii
726 ab
727 aB
728 \= Expect no match
729 Ab
730 AB
731
732 /[\200-\110]/I
733
734 /^(?(0)f|b)oo/I
735
736 # This one's here because of the large output vector needed
737
738 /(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\d+(?:\s|$))(\w+)\s+(\270)/I
739 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 ABC ABC\=ovector=300
740
741 # This one's here because Perl does this differently and PCRE2 can't at present
742
743 /(main(O)?)+/I
744 mainmain
745 mainOmain
746
747 # These are all cases where Perl does it differently (nested captures)
748
749 /^(a(b)?)+$/I
750 aba
751
752 /^(aa(bb)?)+$/I
753 aabbaa
754
755 /^(aa|aa(bb))+$/I
756 aabbaa
757
758 /^(aa(bb)??)+$/I
759 aabbaa
760
761 /^(?:aa(bb)?)+$/I
762 aabbaa
763
764 /^(aa(b(b))?)+$/I
765 aabbaa
766
767 /^(?:aa(b(b))?)+$/I
768 aabbaa
769
770 /^(?:aa(b(?:b))?)+$/I
771 aabbaa
772
773 /^(?:aa(bb(?:b))?)+$/I
774 aabbbaa
775
776 /^(?:aa(b(?:bb))?)+$/I
777 aabbbaa
778
779 /^(?:aa(?:b(b))?)+$/I
780 aabbaa
781
782 /^(?:aa(?:b(bb))?)+$/I
783 aabbbaa
784
785 /^(aa(b(bb))?)+$/I
786 aabbbaa
787
788 /^(aa(bb(bb))?)+$/I
789 aabbbbaa
790
791 # ----------------
792
793 /#/IBx
794
795 /a#/IBx
796
797 /[\s]/IB
798
799 /[\S]/IB
800
801 /a(?i)b/IB
802 ab
803 aB
804 \= Expect no match
805 AB
806
807 /(a(?i)b)/IB
808 ab
809 aB
810 \= Expect no match
811 AB
812
813 / (?i)abc/IBx
814
815 /#this is a comment
816 (?i)abc/IBx
817
818 /123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/IB
819
820 /\Q123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/IB
821
822 /\Q\E/IB
823 \
824
825 /\Q\Ex/IB
826
827 / \Q\E/IB
828
829 /a\Q\E/IB
830 abc
831 bca
832 bac
833
834 /a\Q\Eb/IB
835 abc
836
837 /\Q\Eabc/IB
838
839 /x*+\w/IB
840 \= Expect no match
841 xxxxx
842
843 /x?+/IB
844
845 /x++/IB
846
847 /x{1,3}+/B,no_auto_possess
848
849 /x{1,3}+/Bi,no_auto_possess
850
851 /[^x]{1,3}+/B,no_auto_possess
852
853 /[^x]{1,3}+/Bi,no_auto_possess
854
855 /(x)*+/IB
856
857 /^(\w++|\s++)*$/I
858 now is the time for all good men to come to the aid of the party
859 \= Expect no match
860 this is not a line with only words and spaces!
861
862 /(\d++)(\w)/I
863 12345a
864 \= Expect no match
865 12345+
866
867 /a++b/I
868 aaab
869
870 /(a++b)/I
871 aaab
872
873 /(a++)b/I
874 aaab
875
876 /([^()]++|\([^()]*\))+/I
877 ((abc(ade)ufh()()x
878
879 /\(([^()]++|\([^()]+\))+\)/I
880 (abc)
881 (abc(def)xyz)
882 \= Expect no match
883 ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
884
885 /(abc){1,3}+/IB
886
887 /a+?+/I
888
889 /a{2,3}?+b/I
890
891 /(?U)a+?+/I
892
893 /a{2,3}?+b/I,ungreedy
894
895 /x(?U)a++b/IB
896 xaaaab
897
898 /(?U)xa++b/IB
899 xaaaab
900
901 /^((a+)(?U)([ab]+)(?-U)([bc]+)(\w*))/IB
902
903 /^x(?U)a+b/IB
904
905 /^x(?U)(a+)b/IB
906
907 /[.x.]/I
908
909 /[=x=]/I
910
911 /[:x:]/I
912
913 /\l/I
914
915 /\L/I
916
917 /\N{name}/I
918
919 /\u/I
920
921 /\U/I
922
923 /a{1,3}b/ungreedy
924 ab
925
926 /[/I
927
928 /[a-/I
929
930 /[[:space:]/I
931
932 /[\s]/IB
933
934 /[[:space:]]/IB
935
936 /[[:space:]abcde]/IB
937
938 /< (?: (?(R) \d++ | [^<>]*+) | (?R)) * >/Ix
939 <>
940 <abcd>
941 <abc <123> hij>
942 <abc <def> hij>
943 <abc<>def>
944 <abc<>
945 \= Expect no match
946 <abc
947
948 /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/IB
949
950 /\$\<\.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/IB
951
952 /(.*)\d+\1/I
953
954 /(.*)\d+/I
955
956 /(.*)\d+\1/Is
957
958 /(.*)\d+/Is
959
960 /(.*(xyz))\d+\2/I
961
962 /((.*))\d+\1/I
963 abc123bc
964
965 /a[b]/I
966
967 /(?=a).*/I
968
969 /(?=abc).xyz/Ii
970
971 /(?=abc)(?i).xyz/I
972
973 /(?=a)(?=b)/I
974
975 /(?=.)a/I
976
977 /((?=abcda)a)/I
978
979 /((?=abcda)ab)/I
980
981 /()a/I
982
983 /(?:(?=.)|(?<!x))a/I
984
985 /(?(1)ab|ac)(.)/I
986
987 /(?(1)abz|acz)(.)/I
988
989 /(?(1)abz)(.)/I
990
991 /(?(1)abz)(1)23/I
992
993 /(a)+/I
994
995 /(a){2,3}/I
996
997 /(a)*/I
998
999 /[a]/I
1000
1001 /[ab]/I
1002
1003 /[ab]/I
1004
1005 /[^a]/I
1006
1007 /\d456/I
1008
1009 /\d456/I
1010
1011 /a^b/I
1012
1013 /^a/Im
1014 abcde
1015 xy\nabc
1016 \= Expect no match
1017 xyabc
1018
1019 /c|abc/I
1020
1021 /(?i)[ab]/I
1022
1023 /[ab](?i)cd/I
1024
1025 /abc(?C)def/I
1026 abcdef
1027 1234abcdef
1028 \= Expect no match
1029 abcxyz
1030 abcxyzf
1031
1032 /abc(?C)de(?C1)f/I
1033 123abcdef
1034
1035 /(?C1)\dabc(?C2)def/I
1036 1234abcdef
1037 \= Expect no match
1038 abcdef
1039
1040 /(?C1)\dabc(?C2)def/I
1041 1234abcdef
1042 \= Expect no match
1043 abcdef
1044
1045 /(?C255)ab/I
1046
1047 /(?C256)ab/I
1048
1049 /(?Cab)xx/I
1050
1051 /(?C12vr)x/I
1052
1053 /abc(?C)def/I
1054 \x83\x0\x61bcdef
1055
1056 /(abc)(?C)de(?C1)f/I
1057 123abcdef
1058 123abcdef\=callout_capture
1059 123abcdefC-\=callout_none
1060 \= Expect no match
1061 123abcdef\=callout_fail=1
1062
1063 /(?C0)(abc(?C1))*/I
1064 abcabcabc
1065 abcabc\=callout_fail=1:4
1066 abcabcabc\=callout_fail=1:4
1067
1068 /(\d{3}(?C))*/I
1069 123\=callout_capture
1070 123456\=callout_capture
1071 123456789\=callout_capture
1072
1073 /((xyz)(?C)p|(?C1)xyzabc)/I
1074 xyzabc\=callout_capture
1075
1076 /(X)((xyz)(?C)p|(?C1)xyzabc)/I
1077 Xxyzabc\=callout_capture
1078
1079 /(?=(abc))(?C)abcdef/I
1080 abcdef\=callout_capture
1081
1082 /(?!(abc)(?C1)d)(?C2)abcxyz/I
1083 abcxyz\=callout_capture
1084
1085 /(?<=(abc)(?C))xyz/I
1086 abcxyz\=callout_capture
1087
1088 /a(b+)(c*)(?C1)/I
1089 \= Expect no match
1090 abbbbbccc\=callout_data=1
1091
1092 /a(b+?)(c*?)(?C1)/I
1093 \= Expect no match
1094 abbbbbccc\=callout_data=1
1095
1096 /(?C)abc/I
1097
1098 /(?C)^abc/I
1099
1100 /(?C)a|b/I
1101
1102 /x(ab|(bc|(de|(?R))))/I
1103 xab
1104 xbc
1105 xde
1106 xxab
1107 xxxab
1108 \= Expect no match
1109 xyab
1110
1111 /^([^()]|\((?1)*\))*$/I
1112 abc
1113 a(b)c
1114 a(b(c))d
1115 \= Expect no match)
1116 a(b(c)d
1117
1118 /^>abc>([^()]|\((?1)*\))*<xyz<$/I
1119 >abc>123<xyz<
1120 >abc>1(2)3<xyz<
1121 >abc>(1(2)3)<xyz<
1122
1123 /(a(?1)b)/IB
1124
1125 /(a(?1)+b)/IB
1126
1127 /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/I
1128 12
1129 (((2+2)*-3)-7)
1130 -12
1131 \= Expect no match
1132 ((2+2)*-3)-7)
1133
1134 /^(x(y|(?1){2})z)/I
1135 xyz
1136 xxyzxyzz
1137 \= Expect no match
1138 xxyzz
1139 xxyzxyzxyzz
1140
1141 /((< (?: (?(R) \d++ | [^<>]*+) | (?2)) * >))/Ix
1142 <>
1143 <abcd>
1144 <abc <123> hij>
1145 <abc <def> hij>
1146 <abc<>def>
1147 <abc<>
1148 \= Expect no match
1149 <abc
1150
1151 /(?1)/I
1152
1153 /((?2)(abc)/I
1154
1155 /^(abc)def(?1)/I
1156 abcdefabc
1157
1158 /^(a|b|c)=(?1)+/I
1159 a=a
1160 a=b
1161 a=bc
1162
1163 /^(a|b|c)=((?1))+/I
1164 a=a
1165 a=b
1166 a=bc
1167
1168 /a(?P<name1>b|c)d(?P<longername2>e)/IB
1169 abde
1170 acde
1171
1172 /(?:a(?P<c>c(?P<d>d)))(?P<a>a)/IB
1173
1174 /(?P<a>a)...(?P=a)bbb(?P>a)d/IB
1175
1176 /^\W*(?:(?P<one>(?P<two>.)\W*(?P>one)\W*(?P=two)|)|(?P<three>(?P<four>.)\W*(?P>three)\W*(?P=four)|\W*.\W*))\W*$/Ii
1177 1221
1178 Satan, oscillate my metallic sonatas!
1179 A man, a plan, a canal: Panama!
1180 Able was I ere I saw Elba.
1181 \= Expect no match
1182 The quick brown fox
1183
1184 /((?(R)a|b))\1(?1)?/I
1185 bb
1186 bbaa
1187
1188 /(.*)a/Is
1189
1190 /(.*)a\1/Is
1191
1192 /(.*)a(b)\2/Is
1193
1194 /((.*)a|(.*)b)z/Is
1195
1196 /((.*)a|(.*)b)z\1/Is
1197
1198 /((.*)a|(.*)b)z\2/Is
1199
1200 /((.*)a|(.*)b)z\3/Is
1201
1202 /((.*)a|^(.*)b)z\3/Is
1203
1204 /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a/Is
1205
1206 /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\31/Is
1207
1208 /(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\32/Is
1209
1210 /(a)(bc)/IB,no_auto_capture
1211 abc
1212
1213 /(?P<one>a)(bc)/IB,no_auto_capture
1214 abc
1215
1216 /(a)(?P<named>bc)/IB,no_auto_capture
1217
1218 /(aaa(?C1)bbb|ab)/I
1219 aaabbb
1220 aaabbb\=callout_data=0
1221 aaabbb\=callout_data=1
1222 \= Expect no match
1223 aaabbb\=callout_data=-1
1224
1225 /ab(?P<one>cd)ef(?P<two>gh)/I
1226 abcdefgh
1227 abcdefgh\=copy=1,get=two
1228 abcdefgh\=copy=one,copy=two
1229 abcdefgh\=copy=three
1230
1231 /(?P<Tes>)(?P<Test>)/IB
1232
1233 /(?P<Test>)(?P<Tes>)/IB
1234
1235 /(?P<Z>zz)(?P<A>aa)/I
1236 zzaa\=copy=Z
1237 zzaa\=copy=A
1238
1239 /(?P<x>eks)(?P<x>eccs)/I
1240
1241 /(?P<abc>abc(?P<def>def)(?P<abc>xyz))/I
1242
1243 "\[((?P<elem>\d+)(,(?P>elem))*)\]"I
1244 [10,20,30,5,5,4,4,2,43,23,4234]
1245 \= Expect no match
1246 []
1247
1248 "\[((?P<elem>\d+)(,(?P>elem))*)?\]"I
1249 [10,20,30,5,5,4,4,2,43,23,4234]
1250 []
1251
1252 /(a(b(?2)c))?/IB
1253
1254 /(a(b(?2)c))*/IB
1255
1256 /(a(b(?2)c)){0,2}/IB
1257
1258 /[ab]{1}+/B
1259
1260 /()(?1){1}/B
1261
1262 /()(?1)/B
1263
1264 /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/Ii
1265 Baby Bjorn Active Carrier - With free SHIPPING!!
1266
1267 /((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/Ii
1268 Baby Bjorn Active Carrier - With free SHIPPING!!
1269
1270 /a*.*b/IB
1271
1272 /(a|b)*.?c/IB
1273
1274 /abc(?C255)de(?C)f/IB
1275
1276 /abcde/IB,auto_callout
1277 abcde
1278 \= Expect no match
1279 abcdfe
1280
1281 /a*b/IB,auto_callout
1282 ab
1283 aaaab
1284 aaaacb
1285
1286 /a*b/IB,auto_callout
1287 ab
1288 aaaab
1289 aaaacb
1290
1291 /a+b/IB,auto_callout
1292 ab
1293 aaaab
1294 \= Expect no match
1295 aaaacb
1296
1297 /(abc|def)x/IB,auto_callout
1298 abcx
1299 defx
1300 \= Expect no match
1301 abcdefzx
1302
1303 /(abc|def)x/IB,auto_callout
1304 abcx
1305 defx
1306 \= Expect no match
1307 abcdefzx
1308
1309 /(ab|cd){3,4}/I,auto_callout
1310 ababab
1311 abcdabcd
1312 abcdcdcdcdcd
1313
1314 /([ab]{,4}c|xy)/IB,auto_callout
1315 \= Expect no match
1316 Note: that { does NOT introduce a quantifier
1317
1318 /([ab]{,4}c|xy)/IB,auto_callout
1319 \= Expect no match
1320 Note: that { does NOT introduce a quantifier
1321
1322 /([ab]{1,4}c|xy){4,5}?123/IB,auto_callout
1323 aacaacaacaacaac123
1324
1325 /\b.*/I
1326 ab cd\=offset=1
1327
1328 /\b.*/Is
1329 ab cd\=startoffset=1
1330
1331 /(?!.bcd).*/I
1332 Xbcd12345
1333
1334 /abcde/I
1335 ab\=ps
1336 abc\=ps
1337 abcd\=ps
1338 abcde\=ps
1339 the quick brown abc\=ps
1340 \= Expect no match\=ps
1341 the quick brown abxyz fox\=ps
1342
1343 "^(0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[012])/(20)?\d\d$"I
1344 13/05/04\=ps
1345 13/5/2004\=ps
1346 02/05/09\=ps
1347 1\=ps
1348 1/2\=ps
1349 1/2/0\=ps
1350 1/2/04\=ps
1351 0\=ps
1352 02/\=ps
1353 02/0\=ps
1354 02/1\=ps
1355 \= Expect no match\=ps
1356 \=ps
1357 123\=ps
1358 33/4/04\=ps
1359 3/13/04\=ps
1360 0/1/2003\=ps
1361 0/\=ps
1362 02/0/\=ps
1363 02/13\=ps
1364
1365 /0{0,2}ABC/I
1366
1367 /\d{3,}ABC/I
1368
1369 /\d*ABC/I
1370
1371 /[abc]+DE/I
1372
1373 /[abc]?123/I
1374 123\=ps
1375 a\=ps
1376 b\=ps
1377 c\=ps
1378 c12\=ps
1379 c123\=ps
1380
1381 /^(?:\d){3,5}X/I
1382 1\=ps
1383 123\=ps
1384 123X
1385 1234\=ps
1386 1234X
1387 12345\=ps
1388 12345X
1389 \= Expect no match
1390 1X
1391 123456\=ps
1392
1393 "<(\w+)/?>(.)*</(\1)>"Igms
1394 <!DOCTYPE seite SYSTEM "http://www.lco.lineas.de/xmlCms.dtd">\n<seite>\n<dokumenteninformation>\n<seitentitel>Partner der LCO</seitentitel>\n<sprache>de</sprache>\n<seitenbeschreibung>Partner der LINEAS Consulting\nGmbH</seitenbeschreibung>\n<schluesselworte>LINEAS Consulting GmbH Hamburg\nPartnerfirmen</schluesselworte>\n<revisit>30 days</revisit>\n<robots>index,follow</robots>\n<menueinformation>\n<aktiv>ja</aktiv>\n<menueposition>3</menueposition>\n<menuetext>Partner</menuetext>\n</menueinformation>\n<lastedited>\n<autor>LCO</autor>\n<firma>LINEAS Consulting</firma>\n<datum>15.10.2003</datum>\n</lastedited>\n</dokumenteninformation>\n<inhalt>\n\n<absatzueberschrift>Die Partnerfirmen der LINEAS Consulting\nGmbH</absatzueberschrift>\n\n<absatz><link ziel="http://www.ca.com/" zielfenster="_blank">\n<bild name="logo_ca.gif" rahmen="no"/></link> <link\nziel="http://www.ey.com/" zielfenster="_blank"><bild\nname="logo_euy.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.cisco.de/" zielfenster="_blank">\n<bild name="logo_cisco.gif" rahmen="ja"/></link></absatz>\n\n<absatz><link ziel="http://www.atelion.de/"\nzielfenster="_blank"><bild\nname="logo_atelion.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.line-information.de/"\nzielfenster="_blank">\n<bild name="logo_line_information.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><bild name="logo_aw.gif" rahmen="no"/></absatz>\n\n<absatz><link ziel="http://www.incognis.de/"\nzielfenster="_blank"><bild\nname="logo_incognis.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.addcraft.com/"\nzielfenster="_blank"><bild\nname="logo_addcraft.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.comendo.com/"\nzielfenster="_blank"><bild\nname="logo_comendo.gif" rahmen="no"/></link></absatz>\n\n</inhalt>\n</seite>\=jitstack=1024
1395
1396 /line\nbreak/I
1397 this is a line\nbreak
1398 line one\nthis is a line\nbreak in the second line
1399
1400 /line\nbreak/I,firstline
1401 this is a line\nbreak
1402 \= Expect no match
1403 line one\nthis is a line\nbreak in the second line
1404
1405 /line\nbreak/Im,firstline
1406 this is a line\nbreak
1407 \= Expect no match
1408 line one\nthis is a line\nbreak in the second line
1409
1410 /(?i)(?-i)AbCd/I
1411 AbCd
1412 \= Expect no match
1413 abcd
1414
1415 /a{11111111111111111111}/I
1416
1417 /(){64294967295}/I
1418
1419 /(){2,4294967295}/I
1420
1421 "(?i:a)(?i:b)(?i:c)(?i:d)(?i:e)(?i:f)(?i:g)(?i:h)(?i:i)(?i:j)(k)(?i:l)A\1B"I
1422 abcdefghijklAkB
1423
1424 "(?P<n0>a)(?P<n1>b)(?P<n2>c)(?P<n3>d)(?P<n4>e)(?P<n5>f)(?P<n6>g)(?P<n7>h)(?P<n8>i)(?P<n9>j)(?P<n10>k)(?P<n11>l)A\11B"I
1425 abcdefghijklAkB
1426
1427 "(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)A\11B"I
1428 abcdefghijklAkB
1429
1430 "(?P<name0>a)(?P<name1>a)(?P<name2>a)(?P<name3>a)(?P<name4>a)(?P<name5>a)(?P<name6>a)(?P<name7>a)(?P<name8>a)(?P<name9>a)(?P<name10>a)(?P<name11>a)(?P<name12>a)(?P<name13>a)(?P<name14>a)(?P<name15>a)(?P<name16>a)(?P<name17>a)(?P<name18>a)(?P<name19>a)(?P<name20>a)(?P<name21>a)(?P<name22>a)(?P<name23>a)(?P<name24>a)(?P<name25>a)(?P<name26>a)(?P<name27>a)(?P<name28>a)(?P<name29>a)(?P<name30>a)(?P<name31>a)(?P<name32>a)(?P<name33>a)(?P<name34>a)(?P<name35>a)(?P<name36>a)(?P<name37>a)(?P<name38>a)(?P<name39>a)(?P<name40>a)(?P<name41>a)(?P<name42>a)(?P<name43>a)(?P<name44>a)(?P<name45>a)(?P<name46>a)(?P<name47>a)(?P<name48>a)(?P<name49>a)(?P<name50>a)(?P<name51>a)(?P<name52>a)(?P<name53>a)(?P<name54>a)(?P<name55>a)(?P<name56>a)(?P<name57>a)(?P<name58>a)(?P<name59>a)(?P<name60>a)(?P<name61>a)(?P<name62>a)(?P<name63>a)(?P<name64>a)(?P<name65>a)(?P<name66>a)(?P<name67>a)(?P<name68>a)(?P<name69>a)(?P<name70>a)(?P<name71>a)(?P<name72>a)(?P<name73>a)(?P<name74>a)(?P<name75>a)(?P<name76>a)(?P<name77>a)(?P<name78>a)(?P<name79>a)(?P<name80>a)(?P<name81>a)(?P<name82>a)(?P<name83>a)(?P<name84>a)(?P<name85>a)(?P<name86>a)(?P<name87>a)(?P<name88>a)(?P<name89>a)(?P<name90>a)(?P<name91>a)(?P<name92>a)(?P<name93>a)(?P<name94>a)(?P<name95>a)(?P<name96>a)(?P<name97>a)(?P<name98>a)(?P<name99>a)(?P<name100>a)"I
1431 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1432
1433 "(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)(a)"I
1434 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1435
1436 /[^()]*(?:\((?R)\)[^()]*)*/I
1437 (this(and)that
1438 (this(and)that)
1439 (this(and)that)stuff
1440
1441 /[^()]*(?:\((?>(?R))\)[^()]*)*/I
1442 (this(and)that
1443 (this(and)that)
1444
1445 /[^()]*(?:\((?R)\))*[^()]*/I
1446 (this(and)that
1447 (this(and)that)
1448
1449 /(?:\((?R)\))*[^()]*/I
1450 (this(and)that
1451 (this(and)that)
1452 ((this))
1453
1454 /(?:\((?R)\))|[^()]*/I
1455 (this(and)that
1456 (this(and)that)
1457 (this)
1458 ((this))
1459
1460 /\x{0000ff}/I
1461
1462 /^((?P<A>a1)|(?P<A>a2)b)/I
1463
1464 /^((?P<A>a1)|(?P<A>a2)b)/I,dupnames
1465 a1b\=copy=A
1466 a2b\=copy=A
1467 a1b\=copy=Z,copy=A
1468
1469 /(?|(?<a>)(?<b>)(?<a>)|(?<a>)(?<b>)(?<a>))/I,dupnames
1470
1471 /^(?P<A>a)(?P<A>b)/I,dupnames
1472 ab\=copy=A
1473
1474 /^(?P<A>a)(?P<A>b)|cd/I,dupnames
1475 ab\=copy=A
1476 cd\=copy=A
1477
1478 /^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/I,dupnames
1479 cdefgh\=copy=A
1480
1481 /^((?P<A>a1)|(?P<A>a2)b)/I,dupnames
1482 a1b\=get=A
1483 a2b\=get=A
1484 a1b\=get=Z,get=A
1485
1486 /^(?P<A>a)(?P<A>b)/I,dupnames
1487 ab\=get=A
1488
1489 /^(?P<A>a)(?P<A>b)|cd/I,dupnames
1490 ab\=get=A
1491 cd\=get=A
1492
1493 /^(?P<A>a)(?P<A>b)|cd(?P<A>ef)(?P<A>gh)/I,dupnames
1494 cdefgh\=get=A
1495
1496 /(?J)^((?P<A>a1)|(?P<A>a2)b)/I
1497 a1b\=copy=A
1498 a2b\=copy=A
1499
1500 /^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<A>d)/I
1501
1502 # In this next test, J is not set at the outer level; consequently it isn't set
1503 # in the pattern's options; consequently pcre2_substring_get_byname() produces
1504 # a random value.
1505
1506 /^(?P<A>a) (?J:(?P<B>b)(?P<B>c)) (?P<C>d)/I
1507 a bc d\=copy=A,copy=B,copy=C
1508
1509 /^(?P<A>a)?(?(A)a|b)/I
1510 aabc
1511 bc
1512 \= Expect no match
1513 abc
1514
1515 /(?:(?(ZZ)a|b)(?P<ZZ>X))+/I
1516 bXaX
1517
1518 /(?:(?(2y)a|b)(X))+/I
1519
1520 /(?:(?(ZA)a|b)(?P<ZZ>X))+/I
1521
1522 /(?:(?(ZZ)a|b)(?(ZZ)a|b)(?P<ZZ>X))+/I
1523 bbXaaX
1524
1525 /(?:(?(ZZ)a|\(b\))\\(?P<ZZ>X))+/I
1526 (b)\\Xa\\X
1527
1528 /(?P<ABC/I
1529
1530 /(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
1531 bXXaYYaY
1532 bXYaXXaX
1533
1534 /()()()()()()()()()(?:(?(A)(?P=A)a|b)(?P<A>X|Y))+/I
1535 bXXaYYaY
1536
1537 /\s*,\s*/I
1538 \x0b,\x0b
1539 \x0c,\x0d
1540
1541 /^abc/Im,newline=lf
1542 xyz\nabc
1543 xyz\r\nabc
1544 \= Expect no match
1545 xyz\rabc
1546 xyzabc\r
1547 xyzabc\rpqr
1548 xyzabc\r\n
1549 xyzabc\r\npqr
1550
1551 /^abc/Im,newline=crlf
1552 xyz\r\nabclf>
1553 \= Expect no match
1554 xyz\nabclf
1555 xyz\rabclf
1556
1557 /^abc/Im,newline=cr
1558 xyz\rabc
1559 \= Expect no match
1560 xyz\nabc
1561 xyz\r\nabc
1562
1563 /^abc/Im,newline=bad
1564
1565 /.*/I,newline=lf
1566 abc\ndef
1567 abc\rdef
1568 abc\r\ndef
1569
1570 /.*/I,newline=cr
1571 abc\ndef
1572 abc\rdef
1573 abc\r\ndef
1574
1575 /.*/I,newline=crlf
1576 abc\ndef
1577 abc\rdef
1578 abc\r\ndef
1579
1580 /\w+(.)(.)?def/Is
1581 abc\ndef
1582 abc\rdef
1583 abc\r\ndef
1584
1585 /(?P<B>25[0-5]|2[0-4]\d|[01]?\d?\d)(?:\.(?P>B)){3}/I
1586
1587 /()()()()()()()()()()()()()()()()()()()()
1588 ()()()()()()()()()()()()()()()()()()()()
1589 ()()()()()()()()()()()()()()()()()()()()
1590 ()()()()()()()()()()()()()()()()()()()()
1591 ()()()()()()()()()()()()()()()()()()()()
1592 (.(.))/Ix
1593 XY\=ovector=133
1594
1595 /(a*b|(?i:c*(?-i)d))/I
1596
1597 /()[ab]xyz/I
1598
1599 /(|)[ab]xyz/I
1600
1601 /(|c)[ab]xyz/I
1602
1603 /(|c?)[ab]xyz/I
1604
1605 /(d?|c?)[ab]xyz/I
1606
1607 /(d?|c)[ab]xyz/I
1608
1609 /^a*b\d/IB
1610
1611 /^a*+b\d/IB
1612
1613 /^a*?b\d/IB
1614
1615 /^a+A\d/IB
1616 aaaA5
1617 \= Expect no match
1618 aaaa5
1619
1620 /^a*A\d/IBi
1621 aaaA5
1622 aaaa5
1623
1624 /(a*|b*)[cd]/I
1625
1626 /(a+|b*)[cd]/I
1627
1628 /(a*|b+)[cd]/I
1629
1630 /(a+|b+)[cd]/I
1631
1632 /((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
1633 ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
1634 (((
1635 a
1636 ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
1637 ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
1638 )))
1639 /Ix
1640 large nest
1641
1642 /a*\d/B
1643
1644 /a*\D/B
1645
1646 /0*\d/B
1647
1648 /0*\D/B
1649
1650 /a*\s/B
1651
1652 /a*\S/B
1653
1654 / *\s/B
1655
1656 / *\S/B
1657
1658 /a*\w/B
1659
1660 /a*\W/B
1661
1662 /=*\w/B
1663
1664 /=*\W/B
1665
1666 /\d*a/B
1667
1668 /\d*2/B
1669
1670 /\d*\d/B
1671
1672 /\d*\D/B
1673
1674 /\d*\s/B
1675
1676 /\d*\S/B
1677
1678 /\d*\w/B
1679
1680 /\d*\W/B
1681
1682 /\D*a/B
1683
1684 /\D*2/B
1685
1686 /\D*\d/B
1687
1688 /\D*\D/B
1689
1690 /\D*\s/B
1691
1692 /\D*\S/B
1693
1694 /\D*\w/B
1695
1696 /\D*\W/B
1697
1698 /\s*a/B
1699
1700 /\s*2/B
1701
1702 /\s*\d/B
1703
1704 /\s*\D/B
1705
1706 /\s*\s/B
1707
1708 /\s*\S/B
1709
1710 /\s*\w/B
1711
1712 /\s*\W/B
1713
1714 /\S*a/B
1715
1716 /\S*2/B
1717
1718 /\S*\d/B
1719
1720 /\S*\D/B
1721
1722 /\S*\s/B
1723
1724 /\S*\S/B
1725
1726 /\S*\w/B
1727
1728 /\S*\W/B
1729
1730 /\w*a/B
1731
1732 /\w*2/B
1733
1734 /\w*\d/B
1735
1736 /\w*\D/B
1737
1738 /\w*\s/B
1739
1740 /\w*\S/B
1741
1742 /\w*\w/B
1743
1744 /\w*\W/B
1745
1746 /\W*a/B
1747
1748 /\W*2/B
1749
1750 /\W*\d/B
1751
1752 /\W*\D/B
1753
1754 /\W*\s/B
1755
1756 /\W*\S/B
1757
1758 /\W*\w/B
1759
1760 /\W*\W/B
1761
1762 /[^a]+a/B
1763
1764 /[^a]+a/Bi
1765
1766 /[^a]+A/Bi
1767
1768 /[^a]+b/B
1769
1770 /[^a]+\d/B
1771
1772 /a*[^a]/B
1773
1774 /(?P<abc>x)(?P<xyz>y)/I
1775 xy\=copy=abc,copy=xyz
1776
1777 /(?<abc>x)(?'xyz'y)/I
1778 xy\=copy=abc,copy=xyz
1779
1780 /(?<abc'x)(?'xyz'y)/I
1781
1782 /(?<abc>x)(?'xyz>y)/I
1783
1784 /(?P'abc'x)(?P<xyz>y)/I
1785
1786 /^(?:(?(ZZ)a|b)(?<ZZ>X))+/
1787 bXaX
1788 bXbX
1789 \= Expect no match
1790 aXaX
1791 aXbX
1792
1793 /^(?P>abc)(?<abcd>xxx)/
1794
1795 /^(?P>abc)(?<abc>x|y)/
1796 xx
1797 xy
1798 yy
1799 yx
1800
1801 /^(?P>abc)(?P<abc>x|y)/
1802 xx
1803 xy
1804 yy
1805 yx
1806
1807 /^((?(abc)a|b)(?<abc>x|y))+/
1808 bxay
1809 bxby
1810 \= Expect no match
1811 axby
1812
1813 /^(((?P=abc)|X)(?<abc>x|y))+/
1814 XxXxxx
1815 XxXyyx
1816 XxXyxx
1817 \= Expect no match
1818 x
1819
1820 /^(?1)(abc)/
1821 abcabc
1822
1823 /^(?:(?:\1|X)(a|b))+/
1824 Xaaa
1825 Xaba
1826
1827 /^[\E\Qa\E-\Qz\E]+/B
1828
1829 /^[a\Q]bc\E]/B
1830
1831 /^[a-\Q\E]/B
1832
1833 /^(?P>abc)[()](?<abc>)/B
1834
1835 /^((?(abc)y)[()](?P<abc>x))+/B
1836 (xy)x
1837
1838 /^(?P>abc)\Q()\E(?<abc>)/B
1839
1840 /^(?P>abc)[a\Q(]\E(](?<abc>)/B
1841
1842 /^(?P>abc) # this is (a comment)
1843 (?<abc>)/Bx
1844
1845 /^\W*(?:(?<one>(?<two>.)\W*(?&one)\W*\k<two>|)|(?<three>(?<four>.)\W*(?&three)\W*\k'four'|\W*.\W*))\W*$/Ii
1846 1221
1847 Satan, oscillate my metallic sonatas!
1848 A man, a plan, a canal: Panama!
1849 Able was I ere I saw Elba.
1850 \= Expect no match
1851 The quick brown fox
1852
1853 /(?=(\w+))\1:/I
1854 abcd:
1855
1856 /(?=(?'abc'\w+))\k<abc>:/I
1857 abcd:
1858
1859 /(?'abc'a|b)(?<abc>d|e)\k<abc>{2}/dupnames
1860 adaa
1861 \= Expect no match
1862 addd
1863 adbb
1864
1865 /(?'abc'a|b)(?<abc>d|e)(?&abc){2}/dupnames
1866 bdaa
1867 bdab
1868 \= Expect no match
1869 bddd
1870
1871 /(?(<bc))/
1872
1873 /(?(''))/
1874
1875 /(?('R')stuff)/
1876
1877 /((abc (?(R) (?(R1)1) (?(R2)2) X | (?1) (?2) (?R) ))) /x
1878 abcabc1Xabc2XabcXabcabc
1879
1880 /(?<A> (?'B' abc (?(R) (?(R&A)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
1881 abcabc1Xabc2XabcXabcabc
1882
1883 /(?<A> (?'B' abc (?(R) (?(R&C)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
1884
1885 /^(?(DEFINE) abc | xyz ) /x
1886
1887 /(?(DEFINE) abc) xyz/Ix
1888
1889 /(a|)*\d/
1890 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4\=ovector=0
1891 \= Expect no match
1892 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\=ovector=0
1893
1894 /^a.b/newline=lf
1895 a\rb
1896 \= Expect no match
1897 a\nb
1898
1899 /^a.b/newline=cr
1900 a\nb
1901 \= Expect no match
1902 a\rb
1903
1904 /^a.b/newline=anycrlf
1905 a\x85b
1906 \= Expect no match
1907 a\rb
1908
1909 /^a.b/newline=any
1910 \= Expect no match
1911 a\nb
1912 a\rb
1913 a\x85b
1914
1915 /^abc./gmx,newline=any
1916 abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK
1917
1918 /abc.$/gmx,newline=any
1919 abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc7 abc9
1920
1921 /^a\Rb/bsr=unicode
1922 a\nb
1923 a\rb
1924 a\r\nb
1925 a\x0bb
1926 a\x0cb
1927 a\x85b
1928 \= Expect no match
1929 a\n\rb
1930
1931 /^a\R*b/bsr=unicode
1932 ab
1933 a\nb
1934 a\rb
1935 a\r\nb
1936 a\x0bb
1937 a\x0cb
1938 a\x85b
1939 a\n\rb
1940 a\n\r\x85\x0cb
1941
1942 /^a\R+b/bsr=unicode
1943 a\nb
1944 a\rb
1945 a\r\nb
1946 a\x0bb
1947 a\x0cb
1948 a\x85b
1949 a\n\rb
1950 a\n\r\x85\x0cb
1951 \= Expect no match
1952 ab
1953
1954 /^a\R{1,3}b/bsr=unicode
1955 a\nb
1956 a\n\rb
1957 a\n\r\x85b
1958 a\r\n\r\nb
1959 a\r\n\r\n\r\nb
1960 a\n\r\n\rb
1961 a\n\n\r\nb
1962 \= Expect no match
1963 a\n\n\n\rb
1964 a\r
1965
1966 /(?&abc)X(?<abc>P)/I
1967 abcPXP123
1968
1969 /(?1)X(?<abc>P)/I
1970 abcPXP123
1971
1972 /(?:a(?&abc)b)*(?<abc>x)/
1973 123axbaxbaxbx456
1974 123axbaxbaxb456
1975
1976 /(?:a(?&abc)b){1,5}(?<abc>x)/
1977 123axbaxbaxbx456
1978
1979 /(?:a(?&abc)b){2,5}(?<abc>x)/
1980 123axbaxbaxbx456
1981
1982 /(?:a(?&abc)b){2,}(?<abc>x)/
1983 123axbaxbaxbx456
1984
1985 /(abc)(?i:(?1))/
1986 defabcabcxyz
1987 \= Expect no match
1988 DEFabcABCXYZ
1989
1990 /(abc)(?:(?i)(?1))/
1991 defabcabcxyz
1992 \= Expect no match
1993 DEFabcABCXYZ
1994
1995 /^(a)\g-2/
1996
1997 /^(a)\g/
1998
1999 /^(a)\g{0}/
2000
2001 /^(a)\g{3/
2002
2003 /^(a)\g{aa}/
2004
2005 /^a.b/newline=lf
2006 a\rb
2007 \= Expect no match
2008 a\nb
2009
2010 /.+foo/
2011 afoo
2012 \= Expect no match
2013 \r\nfoo
2014 \nfoo
2015
2016 /.+foo/newline=crlf
2017 afoo
2018 \nfoo
2019 \= Expect no match
2020 \r\nfoo
2021
2022 /.+foo/newline=any
2023 afoo
2024 \= Expect no match
2025 \nfoo
2026 \r\nfoo
2027
2028 /.+foo/s
2029 afoo
2030 \r\nfoo
2031 \nfoo
2032
2033 /^$/gm,newline=any
2034 abc\r\rxyz
2035 abc\n\rxyz
2036 \= Expect no match
2037 abc\r\nxyz
2038
2039 /(?m)^$/g,newline=any,aftertext
2040 abc\r\n\r\n
2041
2042 /(?m)^$|^\r\n/g,newline=any,aftertext
2043 abc\r\n\r\n
2044
2045 /(?m)$/g,newline=any,aftertext
2046 abc\r\n\r\n
2047
2048 /abc.$/gmx,newline=anycrlf
2049 abc1\x0a abc2\x0b abc3\x0c abc4\x0d abc5\x0d\x0a abc6\x85 abc9
2050
2051 /^X/m
2052 XABC
2053 \= Expect no match
2054 XABC\=notbol
2055
2056 /(ab|c)(?-1)/B
2057 abc
2058
2059 /xy(?+1)(abc)/B
2060 xyabcabc
2061 \= Expect no match
2062 xyabc
2063
2064 /x(?-0)y/
2065
2066 /x(?-1)y/
2067
2068 /x(?+0)y/
2069
2070 /x(?+1)y/
2071
2072 /^(abc)?(?(-1)X|Y)/B
2073 abcX
2074 Y
2075 \= Expect no match
2076 abcY
2077
2078 /^((?(+1)X|Y)(abc))+/B
2079 YabcXabc
2080 YabcXabcXabc
2081 \= Expect no match
2082 XabcXabc
2083
2084 /(?(-1)a)/B
2085
2086 /((?(-1)a))/B
2087
2088 /((?(-2)a))/B
2089
2090 /^(?(+1)X|Y)(.)/B
2091 Y!
2092
2093 /(?<A>tom|bon)-\k{A}/
2094 tom-tom
2095 bon-bon
2096 \= Expect no match
2097 tom-bon
2098
2099 /\g{A/
2100
2101 /(?|(abc)|(xyz))/B
2102 >abc<
2103 >xyz<
2104
2105 /(x)(?|(abc)|(xyz))(x)/B
2106 xabcx
2107 xxyzx
2108
2109 /(x)(?|(abc)(pqr)|(xyz))(x)/B
2110 xabcpqrx
2111 xxyzx
2112
2113 /\H++X/B
2114 \= Expect no match
2115 XXXX
2116
2117 /\H+\hY/B
2118 XXXX Y
2119
2120 /\H+ Y/B
2121
2122 /\h+A/B
2123
2124 /\v*B/B
2125
2126 /\V+\x0a/B
2127
2128 /A+\h/B
2129
2130 / *\H/B
2131
2132 /A*\v/B
2133
2134 /\x0b*\V/B
2135
2136 /\d+\h/B
2137
2138 /\d*\v/B
2139
2140 /S+\h\S+\v/B
2141
2142 /\w{3,}\h\w+\v/B
2143
2144 /\h+\d\h+\w\h+\S\h+\H/B
2145
2146 /\v+\d\v+\w\v+\S\v+\V/B
2147
2148 /\H+\h\H+\d/B
2149
2150 /\V+\v\V+\w/B
2151
2152 /\( (?: [^()]* | (?R) )* \)/x
2153 (0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(0(00)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)0)\=jitstack=1024
2154
2155 /[\E]AAA/
2156
2157 /[\Q\E]AAA/
2158
2159 /[^\E]AAA/
2160
2161 /[^\Q\E]AAA/
2162
2163 /[\E^]AAA/
2164
2165 /[\Q\E^]AAA/
2166
2167 /A(*PRUNE)B(*SKIP)C(*THEN)D(*COMMIT)E(*F)F(*FAIL)G(?!)H(*ACCEPT)I/B
2168
2169 /^a+(*FAIL)/auto_callout
2170 \= Expect no match
2171 aaaaaa
2172
2173 /a+b?c+(*FAIL)/auto_callout
2174 \= Expect no match
2175 aaabccc
2176
2177 /a+b?(*PRUNE)c+(*FAIL)/auto_callout
2178 \= Expect no match
2179 aaabccc
2180
2181 /a+b?(*COMMIT)c+(*FAIL)/auto_callout
2182 \= Expect no match
2183 aaabccc
2184
2185 /a+b?(*SKIP)c+(*FAIL)/auto_callout
2186 \= Expect no match
2187 aaabcccaaabccc
2188
2189 /a+b?(*THEN)c+(*FAIL)/auto_callout
2190 \= Expect no match
2191 aaabccc
2192
2193 /a(*MARK)b/
2194
2195 /(?i:A{1,}\6666666666)/
2196
2197 /\g6666666666/
2198
2199 /[\g6666666666]/B
2200
2201 /(?1)\c[/
2202
2203 /.+A/newline=crlf
2204 \= Expect no match
2205 \r\nA
2206
2207 /\nA/newline=crlf
2208 \r\nA
2209
2210 /[\r\n]A/newline=crlf
2211 \r\nA
2212
2213 /(\r|\n)A/newline=crlf
2214 \r\nA
2215
2216 /a(*CR)b/
2217
2218 /(*CR)a.b/
2219 a\nb
2220 \= Expect no match
2221 a\rb
2222
2223 /(*CR)a.b/newline=lf
2224 a\nb
2225 \= Expect no match
2226 a\rb
2227
2228 /(*LF)a.b/newline=CRLF
2229 a\rb
2230 \= Expect no match
2231 a\nb
2232
2233 /(*CRLF)a.b/
2234 a\rb
2235 a\nb
2236 \= Expect no match
2237 a\r\nb
2238
2239 /(*ANYCRLF)a.b/newline=CR
2240 \= Expect no match
2241 a\rb
2242 a\nb
2243 a\r\nb
2244
2245 /(*ANY)a.b/newline=cr
2246 \= Expect no match
2247 a\rb
2248 a\nb
2249 a\r\nb
2250 a\x85b
2251
2252 /(*ANY).*/g
2253 abc\r\ndef
2254
2255 /(*ANYCRLF).*/g
2256 abc\r\ndef
2257
2258 /(*CRLF).*/g
2259 abc\r\ndef
2260
2261 /a\Rb/I,bsr=anycrlf
2262 a\rb
2263 a\nb
2264 a\r\nb
2265 \= Expect no match
2266 a\x85b
2267 a\x0bb
2268
2269 /a\Rb/I,bsr=unicode
2270 a\rb
2271 a\nb
2272 a\r\nb
2273 a\x85b
2274 a\x0bb
2275
2276 /a\R?b/I,bsr=anycrlf
2277 a\rb
2278 a\nb
2279 a\r\nb
2280 \= Expect no match
2281 a\x85b
2282 a\x0bb
2283
2284 /a\R?b/I,bsr=unicode
2285 a\rb
2286 a\nb
2287 a\r\nb
2288 a\x85b
2289 a\x0bb
2290
2291 /a\R{2,4}b/I,bsr=anycrlf
2292 a\r\n\nb
2293 a\n\r\rb
2294 a\r\n\r\n\r\n\r\nb
2295 \= Expect no match
2296 a\x85\x85b
2297 a\x0b\x0bb
2298
2299 /a\R{2,4}b/I,bsr=unicode
2300 a\r\rb
2301 a\n\n\nb
2302 a\r\n\n\r\rb
2303 a\x85\x85b
2304 a\x0b\x0bb
2305 \= Expect no match
2306 a\r\r\r\r\rb
2307
2308 /(*BSR_ANYCRLF)a\Rb/I
2309 a\nb
2310 a\rb
2311
2312 /(*BSR_UNICODE)a\Rb/I
2313 a\x85b
2314
2315 /(*BSR_ANYCRLF)(*CRLF)a\Rb/I
2316 a\nb
2317 a\rb
2318
2319 /(*CRLF)(*BSR_UNICODE)a\Rb/I
2320 a\x85b
2321
2322 /(*CRLF)(*BSR_ANYCRLF)(*CR)ab/I
2323
2324 /(?<a>)(?&)/
2325
2326 /(?<abc>)(?&a)/
2327
2328 /(?<a>)(?&aaaaaaaaaaaaaaaaaaaaaaa)/
2329
2330 /(?+-a)/
2331
2332 /(?-+a)/
2333
2334 /(?(-1))/
2335
2336 /(?(+10))/
2337
2338 /(?(10))/
2339
2340 /(?(+2))()()/
2341
2342 /(?(2))()()/
2343
2344 /\k''/
2345
2346 /\k<>/
2347
2348 /\k{}/
2349
2350 /\k/
2351
2352 /\kabc/
2353
2354 /(?P=)/
2355
2356 /(?P>)/
2357
2358 /[[:foo:]]/
2359
2360 /[[:1234:]]/
2361
2362 /[[:f\oo:]]/
2363
2364 /[[: :]]/
2365
2366 /[[:...:]]/
2367
2368 /[[:l\ower:]]/
2369
2370 /[[:abc\:]]/
2371
2372 /[abc[:x\]pqr:]]/
2373
2374 /[[:a\dz:]]/
2375
2376 /(^(a|b\g<-1'c))/
2377
2378 /^(?+1)(?<a>x|y){0}z/
2379 xzxx
2380 yzyy
2381 \= Expect no match
2382 xxz
2383
2384 /(\3)(\1)(a)/
2385 \= Expect no match
2386 cat
2387
2388 /(\3)(\1)(a)/alt_bsux,allow_empty_class,match_unset_backref,dupnames
2389 cat
2390
2391 /TA]/
2392 The ACTA] comes
2393
2394 /TA]/alt_bsux,allow_empty_class,match_unset_backref,dupnames
2395 The ACTA] comes
2396
2397 /(?2)[]a()b](abc)/
2398 abcbabc
2399
2400 /(?2)[^]a()b](abc)/
2401 abcbabc
2402
2403 /(?1)[]a()b](abc)/
2404 abcbabc
2405 \= Expect no match
2406 abcXabc
2407
2408 /(?1)[^]a()b](abc)/
2409 abcXabc
2410 \= Expect no match
2411 abcbabc
2412
2413 /(?2)[]a()b](abc)(xyz)/
2414 xyzbabcxyz
2415
2416 /(?&N)[]a(?<N>)](?<M>abc)/
2417 abc<abc
2418
2419 /(?&N)[]a(?<N>)](abc)/
2420 abc<abc
2421
2422 /a[]b/
2423
2424 /a[^]b/
2425
2426 /a[]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
2427 \= Expect no match
2428 ab
2429
2430 /a[]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
2431 \= Expect no match
2432 ab
2433
2434 /a[]*+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
2435 \= Expect no match
2436 ab
2437
2438 /a[^]b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
2439 aXb
2440 a\nb
2441 \= Expect no match
2442 ab
2443
2444 /a[^]+b/alt_bsux,allow_empty_class,match_unset_backref,dupnames
2445 aXb
2446 a\nX\nXb
2447 \= Expect no match
2448 ab
2449
2450 /a(?!)b/B
2451
2452 /(?!)?a/B
2453 ab
2454
2455 /a(*FAIL)+b/
2456
2457 /(abc|pqr|123){0}[xyz]/I
2458
2459 /(?(?=.*b)b|^)/I,auto_callout
2460 adc
2461 abc
2462
2463 /(?(?=b).*b|^d)/I
2464
2465 /(?(?=.*b).*b|^d)/I
2466
2467 /xyz/auto_callout
2468 xyz
2469 abcxyz
2470 \= Expect no match
2471 abc
2472 abcxypqr
2473
2474 /xyz/auto_callout,no_start_optimize
2475 abcxyz
2476 \= Expect no match
2477 abc
2478 abcxypqr
2479
2480 /(*NO_START_OPT)xyz/auto_callout
2481 abcxyz
2482
2483 /(*NO_AUTO_POSSESS)a+b/B
2484
2485 /xyz/auto_callout,no_start_optimize
2486 abcxyz
2487
2488 /^"((?(?=[a])[^"])|b)*"$/auto_callout
2489 "ab"
2490
2491 /^"((?(?=[a])[^"])|b)*"$/
2492 "ab"
2493
2494 /^X(?5)(a)(?|(b)|(q))(c)(d)Y/
2495 XYabcdY
2496
2497 /^X(?&N)(a)(?|(b)|(q))(c)(d)(?<N>Y)/
2498 XYabcdY
2499
2500 /Xa{2,4}b/
2501 X\=ps
2502 Xa\=ps
2503 Xaa\=ps
2504 Xaaa\=ps
2505 Xaaaa\=ps
2506
2507 /Xa{2,4}?b/
2508 X\=ps
2509 Xa\=ps
2510 Xaa\=ps
2511 Xaaa\=ps
2512 Xaaaa\=ps
2513
2514 /Xa{2,4}+b/
2515 X\=ps
2516 Xa\=ps
2517 Xaa\=ps
2518 Xaaa\=ps
2519 Xaaaa\=ps
2520
2521 /X\d{2,4}b/
2522 X\=ps
2523 X3\=ps
2524 X33\=ps
2525 X333\=ps
2526 X3333\=ps
2527
2528 /X\d{2,4}?b/
2529 X\=ps
2530 X3\=ps
2531 X33\=ps
2532 X333\=ps
2533 X3333\=ps
2534
2535 /X\d{2,4}+b/
2536 X\=ps
2537 X3\=ps
2538 X33\=ps
2539 X333\=ps
2540 X3333\=ps
2541
2542 /X\D{2,4}b/
2543 X\=ps
2544 Xa\=ps
2545 Xaa\=ps
2546 Xaaa\=ps
2547 Xaaaa\=ps
2548
2549 /X\D{2,4}?b/
2550 X\=ps
2551 Xa\=ps
2552 Xaa\=ps
2553 Xaaa\=ps
2554 Xaaaa\=ps
2555
2556 /X\D{2,4}+b/
2557 X\=ps
2558 Xa\=ps
2559 Xaa\=ps
2560 Xaaa\=ps
2561 Xaaaa\=ps
2562
2563 /X[abc]{2,4}b/
2564 X\=ps
2565 Xa\=ps
2566 Xaa\=ps
2567 Xaaa\=ps
2568 Xaaaa\=ps
2569
2570 /X[abc]{2,4}?b/
2571 X\=ps
2572 Xa\=ps
2573 Xaa\=ps
2574 Xaaa\=ps
2575 Xaaaa\=ps
2576
2577 /X[abc]{2,4}+b/
2578 X\=ps
2579 Xa\=ps
2580 Xaa\=ps
2581 Xaaa\=ps
2582 Xaaaa\=ps
2583
2584 /X[^a]{2,4}b/
2585 X\=ps
2586 Xz\=ps
2587 Xzz\=ps
2588 Xzzz\=ps
2589 Xzzzz\=ps
2590
2591 /X[^a]{2,4}?b/
2592 X\=ps
2593 Xz\=ps
2594 Xzz\=ps
2595 Xzzz\=ps
2596 Xzzzz\=ps
2597
2598 /X[^a]{2,4}+b/
2599 X\=ps
2600 Xz\=ps
2601 Xzz\=ps
2602 Xzzz\=ps
2603 Xzzzz\=ps
2604
2605 /(Y)X\1{2,4}b/
2606 YX\=ps
2607 YXY\=ps
2608 YXYY\=ps
2609 YXYYY\=ps
2610 YXYYYY\=ps
2611
2612 /(Y)X\1{2,4}?b/
2613 YX\=ps
2614 YXY\=ps
2615 YXYY\=ps
2616 YXYYY\=ps
2617 YXYYYY\=ps
2618
2619 /(Y)X\1{2,4}+b/
2620 YX\=ps
2621 YXY\=ps
2622 YXYY\=ps
2623 YXYYY\=ps
2624 YXYYYY\=ps
2625
2626 /\++\KZ|\d+X|9+Y/startchar
2627 ++++123999\=ps
2628 ++++123999Y\=ps
2629 ++++Z1234\=ps
2630
2631 /Z(*F)/
2632 \= Expect no match
2633 Z\=ps
2634 ZA\=ps
2635
2636 /Z(?!)/
2637 \= Expect no match
2638 Z\=ps
2639 ZA\=ps
2640
2641 /dog(sbody)?/
2642 dogs\=ps
2643 dogs\=ph
2644
2645 /dog(sbody)??/
2646 dogs\=ps
2647 dogs\=ph
2648
2649 /dog|dogsbody/
2650 dogs\=ps
2651 dogs\=ph
2652
2653 /dogsbody|dog/
2654 dogs\=ps
2655 dogs\=ph
2656
2657 /\bthe cat\b/
2658 the cat\=ps
2659 the cat\=ph
2660
2661 /abc/
2662 abc\=ps
2663 abc\=ph
2664
2665 /abc\K123/startchar
2666 xyzabc123pqr
2667 xyzabc12\=ps
2668 xyzabc12\=ph
2669
2670 /(?<=abc)123/
2671 xyzabc123pqr
2672 xyzabc12\=ps
2673 xyzabc12\=ph
2674
2675 /\babc\b/
2676 +++abc+++
2677 +++ab\=ps
2678 +++ab\=ph
2679
2680 /(?&word)(?&element)(?(DEFINE)(?<element><[^m][^>]>[^<])(?<word>\w*+))/B
2681
2682 /(?&word)(?&element)(?(DEFINE)(?<element><[^\d][^>]>[^<])(?<word>\w*+))/B
2683
2684 /(ab)(x(y)z(cd(*ACCEPT)))pq/B
2685
2686 /abc\K/aftertext,startchar
2687 abcdef
2688 abcdef\=notempty_atstart
2689 xyzabcdef\=notempty_atstart
2690 \= Expect no match
2691 abcdef\=notempty
2692 xyzabcdef\=notempty
2693
2694 /^(?:(?=abc)|abc\K)/aftertext,startchar
2695 abcdef
2696 abcdef\=notempty_atstart
2697 \= Expect no match
2698 abcdef\=notempty
2699
2700 /a?b?/aftertext
2701 xyz
2702 xyzabc
2703 xyzabc\=notempty
2704 xyzabc\=notempty_atstart
2705 xyz\=notempty_atstart
2706 \= Expect no match
2707 xyz\=notempty
2708
2709 /^a?b?/aftertext
2710 xyz
2711 xyzabc
2712 \= Expect no match
2713 xyzabc\=notempty
2714 xyzabc\=notempty_atstart
2715 xyz\=notempty_atstart
2716 xyz\=notempty
2717
2718 /^(?<name>a|b\g<name>c)/
2719 aaaa
2720 bacxxx
2721 bbaccxxx
2722 bbbacccxx
2723
2724 /^(?<name>a|b\g'name'c)/
2725 aaaa
2726 bacxxx
2727 bbaccxxx
2728 bbbacccxx
2729
2730 /^(a|b\g<1>c)/
2731 aaaa
2732 bacxxx
2733 bbaccxxx
2734 bbbacccxx
2735
2736 /^(a|b\g'1'c)/
2737 aaaa
2738 bacxxx
2739 bbaccxxx
2740 bbbacccxx
2741
2742 /^(a|b\g'-1'c)/
2743 aaaa
2744 bacxxx
2745 bbaccxxx
2746 bbbacccxx
2747
2748 /(^(a|b\g<-1>c))/
2749 aaaa
2750 bacxxx
2751 bbaccxxx
2752 bbbacccxx
2753
2754 /(?-i:\g<name>)(?i:(?<name>a))/
2755 XaaX
2756 XAAX
2757
2758 /(?i:\g<name>)(?-i:(?<name>a))/
2759 XaaX
2760 \= Expect no match
2761 XAAX
2762
2763 /(?-i:\g<+1>)(?i:(a))/
2764 XaaX
2765 XAAX
2766
2767 /(?=(?<regex>(?#simplesyntax)\$(?<name>[a-zA-Z_\x{7f}-\x{ff}][a-zA-Z0-9_\x{7f}-\x{ff}]*)(?:\[(?<index>[a-zA-Z0-9_\x{7f}-\x{ff}]+|\$\g<name>)\]|->\g<name>(\(.*?\))?)?|(?#simple syntax withbraces)\$\{(?:\g<name>(?<indices>\[(?:\g<index>|'(?:\\.|[^'\\])*'|"(?:\g<regex>|\\.|[^"\\])*")\])?|\g<complex>|\$\{\g<complex>\})\}|(?#complexsyntax)\{(?<complex>\$(?<segment>\g<name>(\g<indices>*|\(.*?\))?)(?:->\g<segment>)*|\$\g<complex>|\$\{\g<complex>\})\}))\{/
2768
2769 /(?<n>a|b|c)\g<n>*/
2770 abc
2771 accccbbb
2772
2773 /^X(?7)(a)(?|(b)|(q)(r)(s))(c)(d)(Y)/
2774 XYabcdY
2775
2776 /(?<=b(?1)|zzz)(a)/
2777 xbaax
2778 xzzzax
2779
2780 /(a)(?<=b\1)/
2781
2782 /(a)(?<=b+(?1))/
2783
2784 /(a+)(?<=b(?1))/
2785
2786 /(a(?<=b(?1)))/
2787
2788 /(?<=b(?1))xyz/
2789
2790 /(?<=b(?1))xyz(b+)pqrstuvew/
2791
2792 /(a|bc)\1/I
2793
2794 /(a|bc)\1{2,3}/I
2795
2796 /(a|bc)(?1)/I
2797
2798 /(a|b\1)(a|b\1)/I
2799
2800 /(a|b\1){2}/I
2801
2802 /(a|bbbb\1)(a|bbbb\1)/I
2803
2804 /(a|bbbb\1){2}/I
2805
2806 /^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/I
2807
2808 /<tr([\w\W\s\d][^<>]{0,})><TD([\w\W\s\d][^<>]{0,})>([\d]{0,}\.)(.*)((<BR>([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/Iis
2809
2810 "(?>.*/)foo"I
2811
2812 /(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /Ix
2813
2814 /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/Ii
2815
2816 /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/I
2817
2818 /<a[\s]+href[\s]*=[\s]* # find <a href=
2819 ([\"\'])? # find single or double quote
2820 (?(1) (.*?)\1 | ([^\s]+)) # if quote found, match up to next matching
2821 # quote, otherwise match up to next space
2822 /Iisx
2823
2824 /^(?!:) # colon disallowed at start
2825 (?: # start of item
2826 (?: [0-9a-f]{1,4} | # 1-4 hex digits or
2827 (?(1)0 | () ) ) # if null previously matched, fail; else null
2828 : # followed by colon
2829 ){1,7} # end item; 1-7 of them required
2830 [0-9a-f]{1,4} $ # final hex number at end of string
2831 (?(1)|.) # check that there was an empty component
2832 /Iix
2833
2834 /(?|(?<a>A)|(?<a>B))/I
2835 AB\=copy=a
2836 BA\=copy=a
2837
2838 /(?|(?<a>A)|(?<b>B))/
2839
2840 /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |
2841 b(?<quote> (?<apostrophe>')|(?<realquote>")) )
2842 (?('quote')[a-z]+|[0-9]+)/Ix,dupnames
2843 a"aaaaa
2844 b"aaaaa
2845 \= Expect no match
2846 b"11111
2847 a"11111
2848
2849 /^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/IBx,dupnames
2850 abcdX
2851 eX
2852 \= Expect no match
2853 abcdY
2854 ey
2855
2856 /(?<A>a) (b)(c) (?<A>d (?(R&A)$ | (?4)) )/IBx,dupnames
2857 abcdd
2858 \= Expect no match
2859 abcdde
2860
2861 /abcd*/
2862 xxxxabcd\=ps
2863 xxxxabcd\=ph
2864
2865 /abcd*/i
2866 xxxxabcd\=ps
2867 xxxxabcd\=ph
2868 XXXXABCD\=ps
2869 XXXXABCD\=ph
2870
2871 /abc\d*/
2872 xxxxabc1\=ps
2873 xxxxabc1\=ph
2874
2875 /(a)bc\1*/
2876 xxxxabca\=ps
2877 xxxxabca\=ph
2878
2879 /abc[de]*/
2880 xxxxabcde\=ps
2881 xxxxabcde\=ph
2882
2883 /(\3)(\1)(a)/alt_bsux,allow_empty_class,match_unset_backref,dupnames
2884 cat
2885
2886 /(\3)(\1)(a)/I,alt_bsux,allow_empty_class,match_unset_backref,dupnames
2887 cat
2888
2889 /(\3)(\1)(a)/I
2890 \= Expect no match
2891 cat
2892
2893 /i(?(DEFINE)(?<s>a))/I
2894 i
2895
2896 /()i(?(1)a)/I
2897 ia
2898
2899 /(?i)a(?-i)b|c/B
2900 XabX
2901 XAbX
2902 CcC
2903 \= Expect no match
2904 XABX
2905
2906 /(?i)a(?s)b|c/B
2907
2908 /(?i)a(?s-i)b|c/B
2909
2910 /^(ab(c\1)d|x){2}$/B
2911 xabcxd
2912
2913 /^(?&t)*+(?(DEFINE)(?<t>.))$/B
2914
2915 /^(?&t)*(?(DEFINE)(?<t>.))$/B
2916
2917 # This one is here because Perl gives the match as "b" rather than "ab". I
2918 # believe this to be a Perl bug.
2919
2920 /(?>a\Kb)z|(ab)/
2921 ab\=startchar
2922
2923 /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
2924 abcd
2925 0abc
2926
2927 /abc(*MARK:)pqr/
2928
2929 /abc(*:)pqr/
2930
2931 /abc(*FAIL:123)xyz/
2932
2933 # This should, and does, fail. In Perl, it does not, which I think is a
2934 # bug because replacing the B in the pattern by (B|D) does make it fail.
2935
2936 /A(*COMMIT)B/aftertext,mark
2937 \= Expect no match
2938 ACABX
2939
2940 # These should be different, but in Perl they are not, which I think
2941 # is a bug in Perl.
2942
2943 /A(*THEN)B|A(*THEN)C/mark
2944 AC
2945
2946 /A(*PRUNE)B|A(*PRUNE)C/mark
2947 \= Expect no match
2948 AC
2949
2950 # Mark names can be duplicated. Perl doesn't give a mark for this one,
2951 # though PCRE2 does.
2952
2953 /^A(*:A)B|^X(*:A)Y/mark
2954 \= Expect no match
2955 XAQQ
2956
2957 # COMMIT at the start of a pattern should be the same as an anchor. Perl
2958 # optimizations defeat this. So does the PCRE2 optimization unless we disable
2959 # it.
2960
2961 /(*COMMIT)ABC/
2962 ABCDEFG
2963
2964 /(*COMMIT)ABC/no_start_optimize
2965 \= Expect no match
2966 DEFGABC
2967
2968 /^(ab (c+(*THEN)cd) | xyz)/x
2969 \= Expect no match
2970 abcccd
2971
2972 /^(ab (c+(*PRUNE)cd) | xyz)/x
2973 \= Expect no match
2974 abcccd
2975
2976 /^(ab (c+(*FAIL)cd) | xyz)/x
2977 \= Expect no match
2978 abcccd
2979
2980 # Perl gets some of these wrong
2981
2982 /(?>.(*ACCEPT))*?5/
2983 abcde
2984
2985 /(.(*ACCEPT))*?5/
2986 abcde
2987
2988 /(.(*ACCEPT))5/
2989 abcde
2990
2991 /(.(*ACCEPT))*5/
2992 abcde
2993
2994 /A\NB./B
2995 ACBD
2996 \= Expect no match
2997 A\nB
2998 ACB\n
2999
3000 /A\NB./Bs
3001 ACBD
3002 ACB\n
3003 \= Expect no match
3004 A\nB
3005
3006 /A\NB/newline=crlf
3007 A\nB
3008 A\rB
3009 \= Expect no match
3010 A\r\nB
3011
3012 /\R+b/B
3013
3014 /\R+\n/B
3015
3016 /\R+\d/B
3017
3018 /\d*\R/B
3019
3020 /\s*\R/B
3021 \x20\x0a
3022 \x20\x0d
3023 \x20\x0d\x0a
3024
3025 /\S*\R/B
3026 a\x0a
3027
3028 /X\h*\R/B
3029 X\x20\x0a
3030
3031 /X\H*\R/B
3032 X\x0d\x0a
3033
3034 /X\H+\R/B
3035 X\x0d\x0a
3036
3037 /X\H++\R/B
3038 \= Expect no match
3039 X\x0d\x0a
3040
3041 /(?<=abc)def/
3042 abc\=ph
3043
3044 /abc$/
3045 abc
3046 abc\=ps
3047 abc\=ph
3048
3049 /abc$/m
3050 abc
3051 abc\n
3052 abc\=ph
3053 abc\n\=ph
3054 abc\=ps
3055 abc\n\=ps
3056
3057 /abc\z/
3058 abc
3059 abc\=ps
3060 abc\=ph
3061
3062 /abc\Z/
3063 abc
3064 abc\=ps
3065 abc\=ph
3066
3067 /abc\b/
3068 abc
3069 abc\=ps
3070 abc\=ph
3071
3072 /abc\B/
3073 abc\=ps
3074 abc\=ph
3075 \= Expect no match
3076 abc
3077
3078 /.+/
3079 \= Bad offsets
3080 abc\=offset=4
3081 abc\=offset=-4
3082 \= Valid data
3083 abc\=offset=0
3084 abc\=offset=1
3085 abc\=offset=2
3086 \= Expect no match
3087 abc\=offset=3
3088
3089 /^\cģ/
3090
3091 /(?P<abn>(?P=abn)xxx)/B
3092
3093 /(a\1z)/B
3094
3095 /(?P<abn>(?P=abn)(?<badstufxxx)/B
3096
3097 /(?P<abn>(?P=axn)xxx)/B
3098
3099 /(?P<abn>(?P=axn)xxx)(?<axn>yy)/B
3100
3101 # These tests are here because Perl gets the first one wrong.
3102
3103 /(\R*)(.)/s
3104 \r\n
3105 \r\r\n\n\r
3106 \r\r\n\n\r\n
3107
3108 /(\R)*(.)/s
3109 \r\n
3110 \r\r\n\n\r
3111 \r\r\n\n\r\n
3112
3113 /((?>\r\n|\n|\x0b|\f|\r|\x85)*)(.)/s
3114 \r\n
3115 \r\r\n\n\r
3116 \r\r\n\n\r\n
3117
3118 # -------------
3119
3120 /^abc$/B
3121
3122 /^abc$/Bm
3123
3124 /^(a)*+(\w)/
3125 aaaaX
3126 \= Expect no match
3127 aaaa
3128
3129 /^(?:a)*+(\w)/
3130 aaaaX
3131 \= Expect no match
3132 aaaa
3133
3134 /(a)++1234/IB
3135
3136 /([abc])++1234/I
3137
3138 /(?<=(abc)+)X/
3139
3140 /(^ab)/I
3141
3142 /(^ab)++/I
3143
3144 /(^ab|^)+/I
3145
3146 /(^ab|^)++/I
3147
3148 /(?:^ab)/I
3149
3150 /(?:^ab)++/I
3151
3152 /(?:^ab|^)+/I
3153
3154 /(?:^ab|^)++/I
3155
3156 /(.*ab)/I
3157
3158 /(.*ab)++/I
3159
3160 /(.*ab|.*)+/I
3161
3162 /(.*ab|.*)++/I
3163
3164 /(?:.*ab)/I
3165
3166 /(?:.*ab)++/I
3167
3168 /(?:.*ab|.*)+/I
3169
3170 /(?:.*ab|.*)++/I
3171
3172 /(?=a)[bcd]/I
3173
3174 /((?=a))[bcd]/I
3175
3176 /((?=a))+[bcd]/I
3177
3178 /((?=a))++[bcd]/I
3179
3180 /(?=a+)[bcd]/Ii
3181
3182 /(?=a+?)[bcd]/Ii
3183
3184 /(?=a++)[bcd]/Ii
3185
3186 /(?=a{3})[bcd]/Ii
3187
3188 /(abc)\1+/
3189
3190 # Perl doesn't get these right IMO (the 3rd is PCRE2-specific)
3191
3192 /(?1)(?:(b(*ACCEPT))){0}/
3193 b
3194
3195 /(?1)(?:(b(*ACCEPT))){0}c/
3196 bc
3197 \= Expect no match
3198 b
3199
3200 /(?1)(?:((*ACCEPT))){0}c/
3201 c
3202 c\=notempty
3203
3204 /^.*?(?(?=a)a|b(*THEN)c)/
3205 \= Expect no match
3206 ba
3207
3208 /^.*?(?(?=a)a|bc)/
3209 ba
3210
3211 /^.*?(?(?=a)a(*THEN)b|c)/
3212 \= Expect no match
3213 ac
3214
3215 /^.*?(?(?=a)a(*THEN)b)c/
3216 \= Expect no match
3217 ac
3218
3219 /^.*?(a(*THEN)b)c/
3220 \= Expect no match
3221 aabc
3222
3223 /^.*? (?1) c (?(DEFINE)(a(*THEN)b))/x
3224 aabc
3225
3226 /^.*?(a(*THEN)b|z)c/
3227 aabc
3228
3229 /^.*?(z|a(*THEN)b)c/
3230 aabc
3231
3232 # These are here because they are not Perl-compatible; the studying means the
3233 # mark is not seen.
3234
3235 /(*MARK:A)(*SKIP:B)(C|X)/mark
3236 C
3237 \= Expect no match
3238 D
3239
3240 /(*:A)A+(*SKIP:A)(B|Z)/mark
3241 \= Expect no match
3242 AAAC
3243
3244 # ----------------------------
3245
3246 "(?=a*(*ACCEPT)b)c"
3247 c
3248 c\=notempty
3249
3250 /(?1)c(?(DEFINE)((*ACCEPT)b))/
3251 c
3252 c\=notempty
3253
3254 /(?>(*ACCEPT)b)c/
3255 c
3256 \= Expect no match
3257 c\=notempty
3258
3259 /(?:(?>(a)))+a%/allaftertext
3260 %aa%
3261
3262 /(a)b|ac/allaftertext
3263 ac\=ovector=1
3264
3265 /(a)(b)x|abc/allaftertext
3266 abc\=ovector=2
3267
3268 /(a)bc|(a)(b)\2/
3269 abc\=ovector=1
3270 abc\=ovector=2
3271 aba\=ovector=1
3272 aba\=ovector=2
3273 aba\=ovector=3
3274 aba\=ovector=4
3275
3276 /(?(DEFINE)(a(?2)|b)(b(?1)|a))(?:(?1)|(?2))/I
3277
3278 /(a(?2)|b)(b(?1)|a)(?:(?1)|(?2))/I
3279
3280 /(a(?2)|b)(b(?1)|a)(?1)(?2)/I
3281
3282 /(abc)(?1)/I
3283
3284 /(?:(foo)|(bar)|(baz))X/allcaptures
3285 bazfooX
3286 foobazbarX
3287 barfooX
3288 bazX
3289 foobarbazX
3290 bazfooX\=ovector=0
3291 bazfooX\=ovector=1
3292 bazfooX\=ovector=2
3293 bazfooX\=ovector=3
3294
3295 /(?=abc){3}abc/B
3296
3297 /(?=abc)+abc/B
3298
3299 /(?=abc)++abc/B
3300
3301 /(?=abc){0}xyz/B
3302
3303 /(?=(a))?./B
3304
3305 /(?=(a))??./B
3306
3307 /^(?=(a)){0}b(?1)/B
3308
3309 /(?(DEFINE)(a))?b(?1)/B
3310
3311 /^(?=(?1))?[az]([abc])d/B
3312
3313 /^(?!a){0}\w+/B
3314
3315 /(?<=(abc))?xyz/B
3316
3317 /[:a[:abc]b:]/B
3318
3319 /^(a(*:A)(d|e(*:B))z|aeq)/auto_callout
3320 adz
3321 aez
3322 aeqwerty
3323
3324 /.(*F)/
3325 \= Expect no match
3326 abc\=ph
3327
3328 /\btype\b\W*?\btext\b\W*?\bjavascript\b/I
3329
3330 /\btype\b\W*?\btext\b\W*?\bjavascript\b|\burl\b\W*?\bshell:|<input\b.*?\btype\b\W*?\bimage\b|\bonkeyup\b\W*?\=/I
3331
3332 /a(*SKIP)c|b(*ACCEPT)|/I,aftertext
3333 a
3334
3335 /a(*SKIP)c|b(*ACCEPT)cd(*ACCEPT)|x/I
3336 ax
3337
3338 'a*(*ACCEPT)b'aftertext
3339 abc\=notempty_atstart
3340 bbb\=notempty_atstart
3341 \= Expect no match
3342 \=notempty_atstart
3343
3344 /(*ACCEPT)a/I,aftertext
3345 bax
3346
3347 /z(*ACCEPT)a/I,aftertext
3348 baxzbx
3349
3350 /^(?>a+)(?>(z+))\w/B
3351 aaaazzzzb
3352 \= Expect no match
3353 aazz
3354
3355 /(.)(\1|a(?2))/
3356 bab
3357
3358 /\1|(.)(?R)\1/
3359 cbbbc
3360
3361 /(.)((?(1)c|a)|a(?2))/
3362 \= Expect no match
3363 baa
3364
3365 /(?P<abn>(?P=abn)xxx)/B
3366
3367 /(a\1z)/B
3368
3369 /^a\x41z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
3370 aAz
3371 \= Expect no match
3372 ax41z
3373
3374 /^a[m\x41]z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
3375 aAz
3376
3377 /^a\x1z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
3378 ax1z
3379
3380 /^a\u0041z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
3381 aAz
3382 \= Expect no match
3383 au0041z
3384
3385 /^a[m\u0041]z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
3386 aAz
3387
3388 /^a\u041z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
3389 au041z
3390 \= Expect no match
3391 aAz
3392
3393 /^a\U0041z/alt_bsux,allow_empty_class,match_unset_backref,dupnames
3394 aU0041z
3395 \= Expect no match
3396 aAz
3397
3398 /(?(?=c)c|d)++Y/B
3399
3400 /(?(?=c)c|d)*+Y/B
3401
3402 /a[\NB]c/
3403 aNc
3404
3405 /a[B-\Nc]/
3406
3407 /a[B\Nc]/
3408
3409 /(a)(?2){0,1999}?(b)/
3410
3411 /(a)(?(DEFINE)(b))(?2){0,1999}?(?2)/
3412
3413 # This test, with something more complicated than individual letters, causes
3414 # different behaviour in Perl. Perhaps it disables some optimization; no tag is
3415 # passed back for the failures, whereas in PCRE2 there is a tag.
3416
3417 /(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/x,mark
3418 AABC
3419 XXYZ
3420 \= Expect no match
3421 XAQQ
3422 XAQQXZZ
3423 AXQQQ
3424 AXXQQQ
3425
3426 # Perl doesn't give marks for these, though it does if the alternatives are
3427 # replaced by single letters.
3428
3429 /(b|q)(*:m)f|a(*:n)w/mark
3430 aw
3431 \= Expect no match
3432 abc
3433
3434 /(q|b)(*:m)f|a(*:n)w/mark
3435 aw
3436 \= Expect no match
3437 abc
3438
3439 # After a partial match, the behaviour is as for a failure.
3440
3441 /^a(*:X)bcde/mark
3442 abc\=ps
3443
3444 # These are here because Perl doesn't return a mark, except for the first.
3445
3446 /(?=(*:x))(q|)/aftertext,mark
3447 abc
3448
3449 /(?=(*:x))((*:y)q|)/aftertext,mark
3450 abc
3451
3452 /(?=(*:x))(?:(*:y)q|)/aftertext,mark
3453 abc
3454
3455 /(?=(*:x))(?>(*:y)q|)/aftertext,mark
3456 abc
3457
3458 /(?=a(*:x))(?!a(*:y)c)/aftertext,mark
3459 ab
3460
3461 /(?=a(*:x))(?=a(*:y)c|)/aftertext,mark
3462 ab
3463
3464 /(..)\1/
3465 ab\=ps
3466 aba\=ps
3467 abab\=ps
3468
3469 /(..)\1/i
3470 ab\=ps
3471 abA\=ps
3472 aBAb\=ps
3473
3474 /(..)\1{2,}/
3475 ab\=ps
3476 aba\=ps
3477 abab\=ps
3478 ababa\=ps
3479 ababab\=ps
3480 ababab\=ph
3481 abababa\=ps
3482 abababa\=ph
3483
3484 /(..)\1{2,}/i
3485 ab\=ps
3486 aBa\=ps
3487 aBAb\=ps
3488 AbaBA\=ps
3489 abABAb\=ps
3490 aBAbaB\=ph
3491 abABabA\=ps
3492 abaBABa\=ph
3493
3494 /(..)\1{2,}?x/i
3495 ab\=ps
3496 abA\=ps
3497 aBAb\=ps
3498 abaBA\=ps
3499 abAbaB\=ps
3500 abaBabA\=ps
3501 abAbABaBx\=ps
3502
3503 /^(..)\1/
3504 aba\=ps
3505
3506 /^(..)\1{2,3}x/
3507 aba\=ps
3508 ababa\=ps
3509 ababa\=ph
3510 abababx
3511 ababababx
3512
3513 /^(..)\1{2,3}?x/
3514 aba\=ps
3515 ababa\=ps
3516 ababa\=ph
3517 abababx
3518 ababababx
3519
3520 /^(..)(\1{2,3})ab/
3521 abababab
3522
3523 /^\R/
3524 \r\=ps
3525 \r\=ph
3526
3527 /^\R{2,3}x/
3528 \r\=ps
3529 \r\=ph
3530 \r\r\=ps
3531 \r\r\=ph
3532 \r\r\r\=ps
3533 \r\r\r\=ph
3534 \r\rx
3535 \r\r\rx
3536
3537 /^\R{2,3}?x/
3538 \r\=ps
3539 \r\=ph
3540 \r\r\=ps
3541 \r\r\=ph
3542 \r\r\r\=ps
3543 \r\r\r\=ph
3544 \r\rx
3545 \r\r\rx
3546
3547 /^\R?x/
3548 \r\=ps
3549 \r\=ph
3550 x
3551 \rx
3552
3553 /^\R+x/
3554 \r\=ps
3555 \r\=ph
3556 \r\n\=ps
3557 \r\n\=ph
3558 \rx
3559
3560 /^a$/newline=crlf
3561 a\r\=ps
3562 a\r\=ph
3563
3564 /^a$/m,newline=crlf
3565 a\r\=ps
3566 a\r\=ph
3567
3568 /^(a$|a\r)/newline=crlf
3569 a\r\=ps
3570 a\r\=ph
3571
3572 /^(a$|a\r)/m,newline=crlf
3573 a\r\=ps
3574 a\r\=ph
3575
3576 /./newline=crlf
3577 \r\=ps
3578 \r\=ph
3579
3580 /.{2,3}/newline=crlf
3581 \r\=ps
3582 \r\=ph
3583 \r\r\=ps
3584 \r\r\=ph
3585 \r\r\r\=ps
3586 \r\r\r\=ph
3587
3588 /.{2,3}?/newline=crlf
3589 \r\=ps
3590 \r\=ph
3591 \r\r\=ps
3592 \r\r\=ph
3593 \r\r\r\=ps
3594 \r\r\r\=ph
3595
3596 "AB(C(D))(E(F))?(?(?=\2)(?=\4))"
3597 ABCDGHI\=ovector=01
3598
3599 # These are all run as real matches in test 1; here we are just checking the
3600 # settings of the anchored and startline bits.
3601
3602 /(?>.*?a)(?<=ba)/I
3603
3604 /(?:.*?a)(?<=ba)/I
3605
3606 /.*?a(*PRUNE)b/I
3607
3608 /.*?a(*PRUNE)b/Is
3609
3610 /^a(*PRUNE)b/Is
3611
3612 /.*?a(*SKIP)b/I
3613
3614 /(?>.*?a)b/Is
3615
3616 /(?>.*?a)b/I
3617
3618 /(?>^a)b/Is
3619
3620 /(?>.*?)(?<=(abcd)|(wxyz))/I
3621
3622 /(?>.*)(?<=(abcd)|(wxyz))/I
3623
3624 "(?>.*)foo"I
3625
3626 "(?>.*?)foo"I
3627
3628 /(?>^abc)/Im
3629
3630 /(?>.*abc)/Im
3631
3632 /(?:.*abc)/Im
3633
3634 /(?:(a)+(?C1)bb|aa(?C2)b)/
3635 aab\=callout_capture
3636
3637 /(?:(a)++(?C1)bb|aa(?C2)b)/
3638 aab\=callout_capture
3639
3640 /(?:(?>(a))(?C1)bb|aa(?C2)b)/
3641 aab\=callout_capture
3642
3643 /(?:(?1)(?C1)x|ab(?C2))((a)){0}/
3644 aab\=callout_capture
3645
3646 /(?1)(?C1)((a)(?C2)){0}/
3647 aab\=callout_capture
3648
3649 /(?:(a)+(?C1)bb|aa(?C2)b)++/
3650 aab\=callout_capture
3651 aab\=callout_capture,ovector=1,no_jit
3652
3653 /(ab)x|ab/
3654 ab\=ovector=0
3655 ab\=ovector=1
3656
3657 /(?<=123)(*MARK:xx)abc/mark
3658 xxxx123a\=ph
3659 xxxx123a\=ps
3660
3661 /123\Kabc/startchar
3662 xxxx123a\=ph
3663 xxxx123a\=ps
3664
3665 /^(?(?=a)aa|bb)/auto_callout
3666 bb
3667
3668 /(?C1)^(?C2)(?(?C99)(?=(?C3)a(?C4))(?C5)a(?C6)a(?C7)|(?C8)b(?C9)b(?C10))(?C11)/
3669 bb
3670
3671 # Perl seems to have a bug with this one.
3672
3673 /aaaaa(*COMMIT)(*PRUNE)b|a+c/
3674 aaaaaac
3675
3676 # Here are some that Perl treats differently because of the way it handles
3677 # backtracking verbs.
3678
3679 /(?!a(*COMMIT)b)ac|ad/
3680 ac
3681 ad
3682
3683 /^(?!a(*THEN)b|ac)../
3684 ad
3685 \= Expect no match
3686 ac
3687
3688 /^(?=a(*THEN)b|ac)/
3689 ac
3690
3691 /\A.*?(?:a|b(*THEN)c)/
3692 ba
3693
3694 /\A.*?(?:a|b(*THEN)c)++/
3695 ba
3696
3697 /\A.*?(?:a|b(*THEN)c|d)/
3698 ba
3699
3700 /(?:(a(*MARK:X)a+(*SKIP:X)b)){0}(?:(?1)|aac)/
3701 aac
3702
3703 /\A.*?(a|b(*THEN)c)/
3704 ba
3705
3706 /^(A(*THEN)B|A(*THEN)D)/
3707 AD
3708
3709 /(?!b(*THEN)a)bn|bnn/
3710 bnn
3711
3712 /(?(?=b(*SKIP)a)bn|bnn)/
3713 bnn
3714
3715 /(?=b(*THEN)a|)bn|bnn/
3716 bnn
3717
3718 # This test causes a segfault with Perl 5.18.0
3719
3720 /^(?=(a)){0}b(?1)/
3721 backgammon
3722
3723 /(?|(?<n>f)|(?<n>b))/I,dupnames
3724
3725 /(?<a>abc)(?<a>z)\k<a>()/IB,dupnames
3726
3727 /a*[bcd]/B
3728
3729 /[bcd]*a/B
3730
3731 # A complete set of tests for auto-possessification of character types, but
3732 # omitting \C because it might be disabled (it has its own tests).
3733
3734 /\D+\D \D+\d \D+\S \D+\s \D+\W \D+\w \D+. \D+\R \D+\H \D+\h \D+\V \D+\v \D+\Z \D+\z \D+$/Bx
3735
3736 /\d+\D \d+\d \d+\S \d+\s \d+\W \d+\w \d+. \d+\R \d+\H \d+\h \d+\V \d+\v \d+\Z \d+\z \d+$/Bx
3737
3738 /\S+\D \S+\d \S+\S \S+\s \S+\W \S+\w \S+. \S+\R \S+\H \S+\h \S+\V \S+\v \S+\Z \S+\z \S+$/Bx
3739
3740 /\s+\D \s+\d \s+\S \s+\s \s+\W \s+\w \s+. \s+\R \s+\H \s+\h \s+\V \s+\v \s+\Z \s+\z \s+$/Bx
3741
3742 /\W+\D \W+\d \W+\S \W+\s \W+\W \W+\w \W+. \W+\R \W+\H \W+\h \W+\V \W+\v \W+\Z \W+\z \W+$/Bx
3743
3744 /\w+\D \w+\d \w+\S \w+\s \w+\W \w+\w \w+. \w+\R \w+\H \w+\h \w+\V \w+\v \w+\Z \w+\z \w+$/Bx
3745
3746 /\R+\D \R+\d \R+\S \R+\s \R+\W \R+\w \R+. \R+\R \R+\H \R+\h \R+\V \R+\v \R+\Z \R+\z \R+$/Bx
3747
3748 /\H+\D \H+\d \H+\S \H+\s \H+\W \H+\w \H+. \H+\R \H+\H \H+\h \H+\V \H+\v \H+\Z \H+\z \H+$/Bx
3749
3750 /\h+\D \h+\d \h+\S \h+\s \h+\W \h+\w \h+. \h+\R \h+\H \h+\h \h+\V \h+\v \h+\Z \h+\z \h+$/Bx
3751
3752 /\V+\D \V+\d \V+\S \V+\s \V+\W \V+\w \V+. \V+\R \V+\H \V+\h \V+\V \V+\v \V+\Z \V+\z \V+$/Bx
3753
3754 /\v+\D \v+\d \v+\S \v+\s \v+\W \v+\w \v+. \v+\R \v+\H \v+\h \v+\V \v+\v \v+\Z \v+\z \v+$/Bx
3755
3756 / a+\D a+\d a+\S a+\s a+\W a+\w a+. a+\R a+\H a+\h a+\V a+\v a+\Z a+\z a+$/Bx
3757
3758 /\n+\D \n+\d \n+\S \n+\s \n+\W \n+\w \n+. \n+\R \n+\H \n+\h \n+\V \n+\v \n+\Z \n+\z \n+$/Bx
3759
3760 / .+\D .+\d .+\S .+\s .+\W .+\w .+. .+\R .+\H .+\h .+\V .+\v .+\Z .+\z .+$/Bx
3761
3762 / .+\D .+\d .+\S .+\s .+\W .+\w .+. .+\R .+\H .+\h .+\V .+\v .+\Z .+\z .+$/Bsx
3763
3764 / \D+$ \d+$ \S+$ \s+$ \W+$ \w+$ \R+$ \H+$ \h+$ \V+$ \v+$ a+$ \n+$ .+$ .+$/Bmx
3765
3766 /(?=a+)a(a+)++a/B
3767
3768 /a+(bb|cc)a+(?:bb|cc)a+(?>bb|cc)a+(?:bb|cc)+a+(aa)a+(?:bb|aa)/B
3769
3770 /a+(bb|cc)?#a+(?:bb|cc)??#a+(?:bb|cc)?+#a+(?:bb|cc)*#a+(bb|cc)?a#a+(?:aa)?/B
3771
3772 /a+(?:bb)?a#a+(?:|||)#a+(?:|b)a#a+(?:|||)?a/B
3773
3774 /[ab]*/B
3775 aaaa
3776
3777 /[ab]*?/B
3778 aaaa
3779
3780 /[ab]?/B
3781 aaaa
3782
3783 /[ab]??/B
3784 aaaa
3785
3786 /[ab]+/B
3787 aaaa
3788
3789 /[ab]+?/B
3790 aaaa
3791
3792 /[ab]{2,3}/B
3793 aaaa
3794
3795 /[ab]{2,3}?/B
3796 aaaa
3797
3798 /[ab]{2,}/B
3799 aaaa
3800
3801 /[ab]{2,}?/B
3802 aaaa
3803
3804 /\d+\s{0,5}=\s*\S?=\w{0,4}\W*/B
3805
3806 /[a-d]{5,12}[e-z0-9]*#[^a-z]+[b-y]*a[2-7]?[^0-9a-z]+/B
3807
3808 /[a-z]*\s#[ \t]?\S#[a-c]*\S#[C-G]+?\d#[4-8]*\D#[4-9,]*\D#[!$]{0,5}\w#[M-Xf-l]+\W#[a-c,]?\W/B
3809
3810 /a+(aa|bb)*c#a*(bb|cc)*a#a?(bb|cc)*d#[a-f]*(g|hh)*f/B
3811
3812 /[a-f]*(g|hh|i)*i#[a-x]{4,}(y{0,6})*y#[a-k]+(ll|mm)+n/B
3813
3814 /[a-f]*(?>gg|hh)+#[a-f]*(?>gg|hh)?#[a-f]*(?>gg|hh)*a#[a-f]*(?>gg|hh)*h/B
3815
3816 /[a-c]*d/IB
3817
3818 /[a-c]+d/IB
3819
3820 /[a-c]?d/IB
3821
3822 /[a-c]{4,6}d/IB
3823
3824 /[a-c]{0,6}d/IB
3825
3826 # End of special auto-possessive tests
3827
3828 /^A\o{1239}B/
3829 A\123B
3830
3831 /^A\oB/
3832
3833 /^A\x{zz}B/
3834
3835 /^A\x{12Z/
3836
3837 /^A\x{/
3838
3839 /[ab]++/B,no_auto_possess
3840
3841 /[^ab]*+/B,no_auto_possess
3842
3843 /a{4}+/B,no_auto_possess
3844
3845 /a{4}+/Bi,no_auto_possess
3846
3847 /[a-[:digit:]]+/
3848
3849 /[A-[:digit:]]+/
3850
3851 /[a-[.xxx.]]+/
3852
3853 /[a-[=xxx=]]+/
3854
3855 /[a-[!xxx!]]+/
3856
3857 /[A-[!xxx!]]+/
3858 A]]]
3859
3860 /[a-\d]+/
3861
3862 /(?<0abc>xx)/
3863
3864 /(?&1abc)xx(?<1abc>y)/
3865
3866 /(?<ab-cd>xx)/
3867
3868 /(?'0abc'xx)/
3869
3870 /(?P<0abc>xx)/
3871
3872 /\k<5ghj>/
3873
3874 /\k'5ghj'/
3875
3876 /\k{2fgh}/
3877
3878 /(?P=8yuki)/
3879
3880 /\g{4df}/
3881
3882 /(?&1abc)xx(?<1abc>y)/
3883
3884 /(?P>1abc)xx(?<1abc>y)/
3885
3886 /\g'3gh'/
3887
3888 /\g<5fg>/
3889
3890 /(?(<4gh>)abc)/
3891
3892 /(?('4gh')abc)/
3893
3894 /(?(4gh)abc)/
3895
3896 /(?(R&6yh)abc)/
3897
3898 /(((a\2)|(a*)\g<-1>))*a?/B
3899
3900 # Test the ugly "start or end of word" compatibility syntax.
3901
3902 /[[:<:]]red[[:>:]]/B
3903 little red riding hood
3904 a /red/ thing
3905 red is a colour
3906 put it all on red
3907 \= Expect no match
3908 no reduction
3909 Alfred Winifred
3910
3911 /[a[:<:]] should give error/
3912
3913 /(?=ab\K)/aftertext
3914 abcd\=startchar
3915
3916 /abcd/newline=lf,firstline
3917 \= Expect no match
3918 xx\nxabcd
3919
3920 # Test stack guard external calls.
3921
3922 /(((a)))/stackguard=1
3923
3924 /(((a)))/stackguard=2
3925
3926 /(((a)))/stackguard=3
3927
3928 /(((((a)))))/
3929
3930 # End stack guard tests
3931
3932 /^\w+(?>\s*)(?<=\w)/B
3933
3934 /\othing/
3935
3936 /\o{}/
3937
3938 /\o{whatever}/
3939
3940 /\xthing/
3941
3942 /\x{}/
3943
3944 /\x{whatever}/
3945
3946 /A\8B/
3947
3948 /A\9B/
3949
3950 # This one is here because Perl fails to match "12" for this pattern when the $
3951 # is present.
3952
3953 /^(?(?=abc)\w{3}:|\d\d)$/
3954 abc:
3955 12
3956 \= Expect no match
3957 123
3958 xyz
3959
3960 # Perl gets this one wrong, giving "a" as the after text for ca and failing to
3961 # match for cd.
3962
3963 /(?(?=ab)ab)/aftertext
3964 abxxx
3965 ca
3966 cd
3967
3968 # This should test both paths for processing OP_RECURSE.
3969
3970 /(?(R)a+|(?R)b)/
3971 aaaabcde
3972 aaaabcde\=ovector=100
3973
3974 /a*?b*?/
3975 ab
3976
3977 /(*NOTEMPTY)a*?b*?/
3978 ab
3979 ba
3980 cb
3981
3982 /(*NOTEMPTY_ATSTART)a*?b*?/aftertext
3983 ab
3984 cdab
3985
3986 /(?(VERSION>=10.0)yes|no)/I
3987 yesno
3988
3989 /(?(VERSION=8)yes){3}/BI,aftertext
3990 yesno
3991
3992 /(?(VERSION=8)yes|no){3}/I
3993 yesnononoyes
3994 \= Expect no match
3995 yesno
3996
3997 /(?:(?<VERSION>abc)|xyz)(?(VERSION)yes|no)/I
3998 abcyes
3999 xyzno
4000 \= Expect no match
4001 abcno
4002 xyzyes
4003
4004 /(?(VERSION<10)yes|no)/
4005
4006 /(?(VERSION>10)yes|no)/
4007
4008 /(?(VERSION>=10.0.0)yes|no)/
4009
4010 /(?(VERSION=10.101)yes|no)/
4011
4012 /abcd/I
4013
4014 /abcd/I,no_start_optimize
4015
4016 /(|ab)*?d/I
4017 abd
4018 xyd
4019
4020 /(|ab)*?d/I,no_start_optimize
4021 abd
4022 xyd
4023
4024 /\k<A>*(?<A>aa)(?<A>bb)/match_unset_backref,dupnames
4025 aabb
4026
4027 /(((((a)))))/parens_nest_limit=2
4028
4029 /abc/replace=XYZ
4030 123123
4031 123abc123
4032 123abc123abc123
4033 123123\=zero_terminate
4034 123abc123\=zero_terminate
4035 123abc123abc123\=zero_terminate
4036
4037 /abc/g,replace=XYZ
4038 123abc123
4039 123abc123abc123
4040
4041 /abc/replace=X$$Z
4042 123abc123
4043
4044 /abc/g,replace=X$$Z
4045 123abc123abc123
4046
4047 /a(b)c(d)e/replace=X$1Y${2}Z
4048 "abcde"
4049
4050 /a(b)c(d)e/replace=X$1Y${2}Z,global
4051 "abcde-abcde"
4052
4053 /a(?<ONE>b)c(?<TWO>d)e/replace=X$ONE+${TWO}Z
4054 "abcde"
4055
4056 /a(?<ONE>b)c(?<TWO>d)e/g,replace=X$ONE+${TWO}Z
4057 "abcde-abcde-"
4058
4059 /abc/replace=a$++
4060 123abc
4061
4062 /abc/replace=a$bad
4063 123abc
4064
4065 /abc/replace=a${A234567890123456789_123456789012}z
4066 123abc
4067
4068 /abc/replace=a${A23456789012345678901234567890123}z
4069 123abc
4070
4071 /abc/replace=a${bcd
4072 123abc
4073
4074 /abc/replace=a${b+d}z
4075 123abc
4076
4077 /abc/replace=[10]XYZ
4078 123abc123
4079
4080 /abc/replace=[9]XYZ
4081 123abc123
4082
4083 /abc/replace=xyz
4084 1abc2\=partial_hard
4085
4086 /abc/replace=xyz
4087 123abc456
4088 123abc456\=replace=pqr
4089 123abc456abc789
4090 123abc456abc789\=g
4091
4092 /(?<=abc)(|def)/g,replace=<$0>
4093 123abcxyzabcdef789abcpqr
4094
4095 /./replace=$0
4096 a
4097
4098 /(.)(.)/replace=$2+$1
4099 abc
4100
4101 /(?<A>.)(?<B>.)/replace=$B+$A
4102 abc
4103
4104 /(.)(.)/g,replace=$2$1
4105 abcdefgh
4106
4107 /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=${*MARK}
4108 apple lemon blackberry
4109 apple strudel
4110 fruitless
4111
4112 /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/replace=${*MARK} sauce,
4113 apple lemon blackberry
4114
4115 /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=<$*MARK>
4116 apple lemon blackberry
4117 apple strudel
4118 fruitless
4119
4120 /(*:pear)apple/g,replace=${*MARKING}
4121 apple lemon blackberry
4122
4123 /(*:pear)apple/g,replace=${*MARK-time
4124 apple lemon blackberry
4125
4126 /(*:pear)apple/g,replace=${*mark}
4127 apple lemon blackberry
4128
4129 /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=<$*MARKET>
4130 apple lemon blackberry
4131
4132 /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=[22]${*MARK}
4133 apple lemon blackberry
4134 apple lemon blackberry\=substitute_overflow_length
4135
4136 /(*:pear)apple|(*:orange)lemon|(*:strawberry)blackberry/g,replace=[23]${*MARK}
4137 apple lemon blackberry
4138
4139 /abc/
4140 123abc123\=replace=[9]XYZ
4141 123abc123\=substitute_overflow_length,replace=[9]XYZ
4142 123abc123\=substitute_overflow_length,replace=[6]XYZ
4143 123abc123\=substitute_overflow_length,replace=[1]XYZ
4144 123abc123\=substitute_overflow_length,replace=[0]XYZ
4145
4146 /a(b)c/
4147 123abc123\=replace=[9]x$1z
4148 123abc123\=substitute_overflow_length,replace=[9]x$1z
4149 123abc123\=substitute_overflow_length,replace=[6]x$1z
4150 123abc123\=substitute_overflow_length,replace=[1]x$1z
4151 123abc123\=substitute_overflow_length,replace=[0]x$1z
4152
4153 "((?=(?(?=(?(?=(?(?=()))))))))"
4154 a
4155
4156 "(?(?=)==)(((((((((?=)))))))))"
4157 \= Expect no match
4158 a
4159
4160 /(a)(b)|(c)/
4161 XcX\=ovector=2,get=1,get=2,get=3,get=4,getall
4162
4163 /x(?=ab\K)/
4164 xab\=get=0
4165 xab\=copy=0
4166 xab\=getall
4167
4168 /(?<A>a)|(?<A>b)/dupnames
4169 a\=ovector=1,copy=A,get=A,get=2
4170 a\=ovector=2,copy=A,get=A,get=2
4171 b\=ovector=2,copy=A,get=A,get=2
4172
4173 /a(b)c(d)/
4174 abc\=ph,copy=0,copy=1,getall
4175
4176 /^abc/info
4177
4178 /^abc/info,no_dotstar_anchor
4179
4180 /.*\d/info,auto_callout
4181 \= Expect no match
4182 aaa
4183
4184 /.*\d/info,no_dotstar_anchor,auto_callout
4185 \= Expect no match
4186 aaa
4187
4188 /.*\d/dotall,info
4189
4190 /.*\d/dotall,no_dotstar_anchor,info
4191
4192 /(*NO_DOTSTAR_ANCHOR)(?s).*\d/info
4193
4194 '^(?:(a)|b)(?(1)A|B)'
4195 aA123\=ovector=1
4196 aA123\=ovector=2
4197
4198 '^(?:(?<AA>a)|b)(?(<AA>)A|B)'
4199 aA123\=ovector=1
4200 aA123\=ovector=2
4201
4202 '^(?<AA>)(?:(?<AA>a)|b)(?(<AA>)A|B)'dupnames
4203 aA123\=ovector=1
4204 aA123\=ovector=2
4205 aA123\=ovector=3
4206
4207 '^(?:(?<AA>X)|)(?:(?<AA>a)|b)\k{AA}'dupnames
4208 aa123\=ovector=1
4209 aa123\=ovector=2
4210 aa123\=ovector=3
4211
4212 /(?<N111>(?J)(?<N111>1(111111)11|)1|1|)(?(<N111>)1)/
4213
4214 /(?<N>(?J)(?<N>))(?-J)\k<N>/
4215
4216 # Quantifiers are not allowed on condition assertions, but are otherwise
4217 # OK in conditions.
4218
4219 /(?(?=0)?)+/
4220
4221 /(?(?=0)(?=00)?00765)/
4222 00765
4223
4224 /(?(?=0)(?=00)?00765|(?!3).56)/
4225 00765
4226 456
4227 \= Expect no match
4228 356
4229
4230 '^(a)*+(\w)'
4231 g
4232 g\=ovector=1
4233
4234 '^(?:a)*+(\w)'
4235 g
4236 g\=ovector=1
4237
4238 # These two pattern showeds up compile-time bugs
4239
4240 "((?2){0,1999}())?"
4241
4242 /((?+1)(\1))/B
4243
4244 # Callouts with string arguments
4245
4246 /a(?C"/
4247
4248 /a(?C"a/
4249
4250 /a(?C"a"/
4251
4252 /a(?C"a"bcde(?C"b")xyz/
4253
4254 /a(?C"a)b""c")/B
4255
4256 /ab(?C" any text with spaces ")cde/B
4257 abcde
4258 12abcde
4259
4260 /^a(b)c(?C1)def/
4261 abcdef
4262
4263 /^a(b)c(?C"AB")def/
4264 abcdef
4265
4266 /^a(b)c(?C1)def/
4267 abcdef\=callout_capture
4268
4269 /^a(b)c(?C{AB})def/B
4270 abcdef\=callout_capture
4271
4272 /(?C`a``b`)(?C'a''b')(?C"a""b")(?C^a^^b^)(?C%a%%b%)(?C#a##b#)(?C$a$$b$)(?C{a}}b})/B,callout_info
4273
4274 /(?:a(?C`code`)){3}/B
4275
4276 /^(?(?C25)(?=abc)abcd|xyz)/B,callout_info
4277 abcdefg
4278 xyz123
4279
4280 /^(?(?C$abc$)(?=abc)abcd|xyz)/B
4281 abcdefg
4282 xyz123
4283
4284 /^ab(?C'first')cd(?C"second")ef/
4285 abcdefg
4286
4287 /(?:a(?C`code`)){3}X/
4288 aaaXY
4289
4290 # Binary zero in callout string
4291 # a ( ? C ' x z ' ) b
4292 / 61 28 3f 43 27 78 00 7a 27 29 62/hex,callout_info
4293 abcdefgh
4294
4295 /(?(?!)^)/
4296
4297 /(?(?!)a|b)/
4298 bbb
4299 \= Expect no match
4300 aaa
4301
4302 # JIT gives a different error message for the infinite recursion
4303
4304 "(*NO_JIT)((?2)+)((?1)){"
4305 abcd{
4306
4307 # Perl fails to diagnose the absence of an assertion
4308
4309 "(?(?<E>.*!.*)?)"
4310
4311 "X((?2)()*+){2}+"B
4312
4313 "X((?2)()*+){2}"B
4314
4315 /(?<=\bABQ(3(?-7)))/
4316
4317 /(?<=\bABQ(3(?+7)))/
4318
4319 ";(?<=()((?3))((?2)))"
4320
4321 # Perl loops on this (PCRE2 used to!)
4322
4323 /(?<=\Ka)/g,aftertext
4324 aaaaa
4325
4326 /(?<=\Ka)/altglobal,aftertext
4327 aaaaa
4328
4329 /((?2){73}(?2))((?1))/info
4330
4331 /abc/
4332 \= Expect no match
4333 \[9x!xxx(]{9999}
4334
4335 /(abc)*/
4336 \[abc]{5}
4337
4338 /^/gm
4339 \n\n\n
4340
4341 /^/gm,alt_circumflex
4342 \n\n\n
4343
4344 /((((((((x))))))))\81/
4345 xx1
4346
4347 /((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((x))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))\80/
4348 xx
4349
4350 /\80/
4351
4352 /A\8B\9C/
4353 A8B9C
4354
4355 /(?x:((?'a')) # comment (with parentheses) and | vertical
4356 (?-x:#not a comment (?'b')) # this is a comment ()
4357 (?'c')) # not a comment (?'d')/info
4358
4359 /(?|(?'a')(2)(?'b')|(?'a')(?'a')(3))/I,dupnames
4360 A23B
4361 B32A
4362
4363 # These are some patterns that used to cause buffer overflows or other errors
4364 # while compiling.
4365
4366 /.((?2)(?R)|\1|$)()/B
4367
4368 /.((?3)(?R)()(?2)|\1|$)()/B
4369
4370 /(\9*+(?2);\3++()2|)++{/
4371
4372 /\V\x85\9*+((?2)\3++()2)*:2/
4373
4374 /(((?(R)){0,2}) (?'x'((?'R')((?'R')))))/dupnames
4375
4376 /(((?(X)){0,2}) (?'x'((?'X')((?'X')))))/dupnames
4377
4378 /(((?(R)){0,2}) (?'x'((?'X')((?'R')))))/
4379
4380 "(?J)(?'d'(?'d'\g{d}))"
4381
4382 "(?=!((?2)(?))({8(?<=(?1){29}8bbbb\x16\xd\xc6^($(\xa9H4){4}h}?1)B))\x15')"
4383
4384 /A(?'')Z/
4385
4386 "(?J:(?|(?'R')(\k'R')|((?'R'))))"
4387
4388 /(?<=|(\,\$(?73591620449005828816)\xa8.{7}){6}\x09)/
4389
4390 /^(?:(?(1)x|)+)+$()/B
4391
4392 /[[:>:]](?<)/
4393
4394 /((?x)(*:0))#(?'/
4395
4396 /(?C$[$)(?<]/
4397
4398 /(?C$)$)(?<]/
4399
4400 /(?(R))*+/B
4401 abcd
4402
4403 /((?x)(?#))#(?'/
4404
4405 /((?x)(?#))#(?'abc')/I
4406
4407 /[[:\\](?<[::]/
4408
4409 /[[:\\](?'abc')[a:]/I
4410
4411 "[[[.\xe8Nq\xffq\xff\xe0\x2|||::Nq\xffq\xff\xe0\x6\x2|||::[[[:[::::::[[[[[::::::::[:[[[:[:::[[[[[[[[[[[[:::::::::::::::::[[.\xe8Nq\xffq\xff\xe0\x2|||::Nq\xffq\xff\xe0\x6\x2|||::[[[:[::::::[[[[[::::::::[:[[[:[:::[[[[[[[[[[[[[[:::E[[[:[:[[:[:::[[:::E[[[:[:[[:'[:::::E[[[:[::::::[[[:[[[[[[[::E[[[:[::::::[[[:[[[[[[[[:[[::[::::[[:::::::[[:[[[[[[[:[[::[:[[:[~"
4412
4413 /()(?(R)0)*+/B
4414
4415 /(?R-:(?</
4416
4417 /(?R-:(?<)/
4418
4419 /(?(?C{\Q})(?!(?'/
4420
4421 /(?(?C{\Q})(?!(?'abc')))/I
4422
4423 /(?1){3918}(((((0(\k'R'))))(?J)(?'R'(?'R'\3){99})))/I
4424
4425 /(?|(aaa)|(b))\g{1}/I
4426
4427 /(?|(aaa)|(b))(?1)/I
4428
4429 /(?|(aaa)|(b))/I
4430
4431 /(?|(?'a'aaa)|(?'a'b))\k'a'/I
4432
4433 /(?|(?'a'aaa)|(?'a'b))(?'a'cccc)\k'a'/I,dupnames
4434
4435 /ab{3cd/
4436 ab{3cd
4437
4438 /ab{3,cd/
4439 ab{3,cd
4440
4441 /ab{3,4a}cd/
4442 ab{3,4a}cd
4443
4444 /{4,5a}bc/
4445 {4,5a}bc
4446
4447 /\x0{ab}/
4448 \0{ab}
4449
4450 /^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/
4451 ababababbbabZXXXX
4452
4453 /.*?a(*PRUNE)b/
4454 aab
4455
4456 /.*?a(*PRUNE)b/s
4457 aab
4458
4459 /^a(*PRUNE)b/s
4460 \= Expect no match
4461 aab
4462
4463 /.*?a(*SKIP)b/
4464 aab
4465
4466 /(?(8000000000/
4467
4468 /((?(R8000000000)))/
4469
4470 /0(?0)|(1)(*THEN)(*SKIP:0)(*FAIL)/
4471 \= Expect no match
4472 01
4473
4474 /(?(1)()\983040\2)/
4475
4476 /(*LIMIT_MATCH=)abc/
4477
4478 /(*CRLF)(*LIMIT_MATCH=)abc/
4479
4480 /(?:ab)?(?:ab)(?:ab)/
4481 abab
4482 ababab
4483 \= Expect no match
4484 aba
4485
4486 /((*MARK:A))++a(*SKIP:B)b/
4487 \= Expect no match
4488 aacb
4489
4490 /(*MARK:a\zb)z/alt_verbnames
4491
4492 /(*:ab\t(d\)c)xxx/
4493
4494 /(*:ab\t(d\)c)xxx/alt_verbnames,mark
4495 cxxxz
4496
4497 /(*:A\Qxx)x\EB)x/alt_verbnames,mark
4498 x
4499
4500 /(*:A\ExxxB)x/alt_verbnames,mark
4501 x
4502
4503 /(*: A \ and #comment
4504 \ B)x/x,alt_verbnames,mark
4505 x
4506
4507 /(*: A \ and #comment
4508 \ B)x/alt_verbnames,mark
4509 x
4510
4511 /(*: A \ and #comment
4512 \ B)x/x,mark
4513 x
4514
4515 /(*: A \ and #comment
4516 \ B)x/mark
4517 x
4518
4519 /(*:A
4520 B)x/alt_verbnames,mark
4521 x
4522
4523 /(*:abc\Qpqr)/alt_verbnames
4524
4525 /abc/use_offset_limit
4526 1234abcde\=offset_limit=100
4527 1234abcde\=offset_limit=9
4528 1234abcde\=offset_limit=4
4529 1234abcde\=offset_limit=4,offset=4
4530 \= Expect no match
4531 1234abcde\=offset_limit=4,offset=5
4532 1234abcde\=offset_limit=3
4533
4534 /(?<=abc)/use_offset_limit
4535 1234abc\=offset_limit=7
4536 \= Expect no match
4537 1234abc\=offset_limit=6
4538
4539 /A/g,replace=-,use_offset_limit
4540 XAXAXAXAXA\=offset_limit=4
4541
4542 /abc/
4543 \= Expect error
4544 1234abcde\=offset_limit=4
4545
4546 /^\w/m,use_offset_limit
4547 \n..\naa\=offset_limit=3
4548 \n..\naa\=offset_limit=4
4549
4550 /abcd/null_context
4551 abcd\=null_context
4552 \= Expect error
4553 abcd\=null_context,find_limits
4554 abcd\=allusedtext,startchar
4555
4556 /abcd/replace=w\rx\x82y\o{333}z(\Q12\$34$$\x34\E5$$),substitute_extended
4557 abcd
4558
4559 /a(bc)(DE)/replace=a\u$1\U$1\E$1\l$2\L$2\Eab\Uab\LYZ\EDone,substitute_extended
4560 abcDE
4561
4562 /abcd/replace=xy\kz,substitute_extended
4563 abcd
4564
4565 /a(?:(b)|(c))/substitute_extended,replace=X${1:+1:-1}X${2:+2:-2}
4566 ab
4567 ac
4568 ab\=replace=${1:+$1\:$1:$2}
4569 ac\=replace=${1:+$1\:$1:$2}
4570
4571 /a(?:(b)|(c))/substitute_extended,replace=X${1:-1:-1}X${2:-2:-2}
4572 ab
4573 ac
4574
4575 /(a)/substitute_extended,replace=>${1:+\Q$1:{}$$\E+\U$1}<
4576 a
4577
4578 /X(b)Y/substitute_extended
4579 XbY\=replace=x${1:+$1\U$1}y
4580 XbY\=replace=\Ux${1:+$1$1}y
4581
4582 /a/substitute_extended,replace=${*MARK:+a:b}
4583 a
4584
4585 /(abcd)/replace=${1:+xy\kz},substitute_extended
4586 abcd
4587
4588 /(abcd)/
4589 abcd\=replace=${1:+xy\kz},substitute_extended
4590
4591 /abcd/substitute_extended,replace=>$1<
4592 abcd
4593
4594 /abcd/substitute_extended,replace=>xxx${xyz}<<<
4595 abcd
4596
4597 /(?J)(?:(?<A>a)|(?<A>b))/replace=<$A>
4598 [a]
4599 [b]
4600 \= Expect error
4601 (a)\=ovector=1
4602
4603 /(a)|(b)/replace=<$1>
4604 \= Expect error
4605 b
4606
4607 /(aa)(BB)/substitute_extended,replace=\U$1\L$2\E$1..\U$1\l$2$1
4608 aaBB
4609
4610 /^(o(\1{72}{\"{\\{00000059079}\d*){74}}){19}/I
4611
4612 /((p(?'K/
4613
4614 /((p(?'K/no_auto_capture
4615
4616 /abc/replace=A$3123456789Z
4617 abc
4618
4619 /(?<!a{65535}a{5})x/I
4620
4621 /(?<!a{65535})x/I
4622
4623 /(?=a\K)/replace=z
4624 BaCaD
4625
4626 /(?'abcdefghijklmnopqrstuvwxyzABCDEFG'toolong)/
4627
4628 /(?'abcdefghijklmnopqrstuvwxyzABCDEF'justright)/
4629
4630 # These two use zero-termination
4631 /abcd/max_pattern_length=3
4632
4633 /abc/max_pattern_length=3
4634
4635 # These two, being hex, pass the length
4636 /abcdefab/hex,max_pattern_length=3
4637
4638 /abcdef/hex,max_pattern_length=3
4639
4640 # These patterns used to take a long time to compile
4641
4642 "(.*)
4643 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
4644 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
4645 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))"xI
4646
4647 "(?<=a()
4648 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
4649 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
4650 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
4651 a)"xI
4652
4653 "(?|()|())(.*)
4654 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
4655 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
4656 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))"xI
4657
4658 "(?|()|())(?<=a()
4659 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
4660 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
4661 ((?-2)(?-2))((?-2)(?-2))((?-2)(?-2))
4662 a)"xI
4663
4664 # Test the use of malloc for caching group information when there are more
4665 # groups than fit into the on-stack workspace.
4666
4667 /\[()]{1024}/I,expand
4668
4669 # Test minlength capped at 65535
4670
4671 /(A{65000})\1{65000}/I
4672
4673 # Test group scans when numbers are not unique
4674
4675 /(?|()+|(a)+)/BI
4676
4677 /(?|(a)+|()+)/BI
4678
4679 /(?|()|(a))/BI
4680
4681 /(?|(a)|())/BI
4682
4683 # Test CRLF handling in empty string substitutions
4684
4685 /^$/gm,newline=anycrlf,replace=-
4686 X\r\n\r\nY
4687
4688 /^$/gm,newline=crlf,replace=-
4689 X\r\n\r\nY
4690
4691 /^$/gm,newline=any,replace=-
4692 X\r\n\r\nY
4693
4694 "(*ANYCRLF)(?m)^(.*[^0-9\r\n].*|)$"g,replace=NaN
4695 15\r\nfoo\r\n20\r\nbar\r\nbaz\r\n\r\n20
4696
4697 /a[[:punct:]b]/bincode
4698
4699 /a[b[:punct:]]/bincode
4700
4701 /L(?#(|++<!(2)?/B
4702
4703 /L(?#(|++<!(2)?/B,no_auto_possess
4704
4705 /L(?#(|++<!(2)?/B,auto_callout
4706
4707 /L(?#(|++<!(2)?/B,no_auto_possess,auto_callout
4708
4709 /(A*)\E+/B,auto_callout
4710
4711 /()\Q\E*]/B,auto_callout
4712 a[bc]d
4713
4714 /\x8a+f|;T?(*:;.'?`(\xeap ){![^()!y*''C*(?';]{1;(\x08)/B,alt_verbnames,dupnames,extended
4715
4716 # Tests for NULL characters in comments and verb "names" and callouts
4717
4718 # /A#B\x00C\x0aZ/
4719 /41 23 42 00 43 0a 5a/Bx,hex
4720
4721 # /A+#B\x00C\x0a+/
4722 /41 2b 23 42 00 43 0a 2b/Bx,hex
4723
4724 # /A(*:B\x00W#X\00Y\x0aC)Z/
4725 /41 28 2a 3a 42 00 57 23 58 00 59 0a 43 29 5a/Bx,hex,alt_verbnames
4726
4727 # /A(*:B\x00W#X\00Y\x0aC)Z/
4728 /41 28 2a 3a 42 00 57 23 58 00 59 0a 43 29 5a/Bx,hex
4729
4730 # /A(?C{X\x00Y})B/
4731 /41 28 3f 43 7b 58 00 59 7d 29 42/B,hex
4732
4733 # /A(?#X\x00Y)B/
4734 /41 28 3f 23 7b 00 7d 29 42/B,hex
4735
4736 # Tests for leading comment in extended patterns
4737
4738 / (?-x):?/extended
4739
4740 / (?-x):?/extended
4741
4742 /0b 28 3f 2d 78 29 3a/hex,extended
4743
4744 /#comment
4745 (?-x):?/extended
4746
4747 /(8(*:6^\x09x\xa6l\)6!|\xd0:[^:|)\x09d\Z\d{85*m(?'(?<1!)*\W[*\xff]!!h\w]*\xbe;/alt_bsux,alt_verbnames,allow_empty_class,dollar_endonly,extended,multiline,never_utf,no_dotstar_anchor,no_start_optimize
4748
4749 /a|(b)c/replace=>$1<,substitute_unset_empty
4750 cat
4751 xbcom
4752
4753 /a|(b)c/
4754 cat\=replace=>$1<
4755 cat\=replace=>$1<,substitute_unset_empty
4756 xbcom\=replace=>$1<,substitute_unset_empty
4757
4758 /a|(b)c/substitute_extended
4759 cat\=replace=>${2:-xx}<
4760 cat\=replace=>${2:-xx}<,substitute_unknown_unset
4761 cat\=replace=>${X:-xx}<,substitute_unknown_unset
4762
4763 /a|(?'X'b)c/replace=>$X<,substitute_unset_empty
4764 cat
4765 xbcom
4766
4767 /a|(?'X'b)c/replace=>$Y<,substitute_unset_empty
4768 cat
4769 cat\=substitute_unknown_unset
4770 cat\=substitute_unknown_unset,-substitute_unset_empty
4771
4772 /a|(b)c/replace=>$2<,substitute_unset_empty
4773 cat
4774 cat\=substitute_unknown_unset
4775 cat\=substitute_unknown_unset,-substitute_unset_empty
4776
4777 /()()()/use_offset_limit
4778 \=ovector=11000000000
4779 \=callout_fail=11000000000
4780 \=callout_fail=1:11000000000
4781 \=callout_data=11000000000
4782 \=callout_data=-11000000000
4783 \=offset_limit=1100000000000000000000
4784 \=copy=11000000000
4785
4786 /(*MARK:A\x00b)/mark
4787 abc
4788
4789 /(*MARK:A\x00b)/mark,alt_verbnames
4790 abc
4791
4792 /"(*MARK:A" 00 "b)"/mark,hex
4793 abc
4794
4795 /"(*MARK:A" 00 "b)"/mark,hex,alt_verbnames
4796 abc
4797
4798 /efg/hex
4799
4800 /eff/hex
4801
4802 /effg/hex
4803
4804 /(?J)(?'a'))(?'a')/
4805
4806 /(?<=((?C)0))/
4807 9010
4808 \= Expect no match
4809 abc
4810
4811 /aaa/
4812 \[abc]{10000000000000000000000000000}
4813 \[a]{3}
4814
4815 /\[AB]{6000000000000000000000}/expand
4816
4817 # Hex uses pattern length, not zero-terminated. This tests for overrunning
4818 # the given length of a pattern.
4819
4820 /'(*U'/hex
4821
4822 /'(*'/hex
4823
4824 /'('/hex
4825
4826 //hex
4827
4828 # These tests are here because Perl never allows a back reference in a
4829 # lookbehind. PCRE2 supports some limited cases.
4830
4831 /([ab])...(?<=\1)z/
4832 a11az
4833 b11bz
4834 \= Expect no match
4835 b11az
4836
4837 /(?|([ab]))...(?<=\1)z/
4838
4839 /([ab])(\1)...(?<=\2)z/
4840 aa11az
4841
4842 /(a\2)(b\1)(?<=\2)/
4843
4844 /(?<A>[ab])...(?<=\k'A')z/
4845 a11az
4846 b11bz
4847 \= Expect no match
4848 b11az
4849
4850 /(?<A>[ab])...(?<=\k'A')(?<A>)z/dupnames
4851
4852 # Perl does not support \g+n
4853
4854 /((\g+1X)?([ab]))+/
4855 aaXbbXa
4856
4857 /ab(?C1)c/auto_callout
4858 abc
4859
4860 /'ab(?C1)c'/hex,auto_callout
4861 abc
4862
4863 # Perl accepts these, but gives a warning. We can't warn, so give an error.
4864
4865 /[a-[:digit:]]+/
4866 a-a9-a
4867
4868 /[A-[:digit:]]+/
4869 A-A9-A
4870
4871 /[a-\d]+/
4872 a-a9-a
4873
4874 /(?<RA>abc)(?(R)xyz)/B
4875
4876 /(?<R>abc)(?(R)xyz)/B
4877
4878 /(?=.*[A-Z])/I
4879
4880 /()(?<=(?0))/
4881
4882 /(?<!|!(?<!))/
4883
4884 /(?<!|!|!||||||(?<!)||(?<!)!|!||(?<!)!|!(?<!)!|!|!|!||||!!|<!)!|!||||!|/
4885
4886 /{2,2{2,2/use_length
4887
4888 /.>*?\g'0/use_length
4889
4890 /.>*?\g'0/
4891
4892 /{̈́̈́{'{22{2{{2{'{22{{22{2{'{22{2{{2{{222{{2{'{22{2{22{2{'{22{2{{2{'{22{2{22{2{'{'{22{2{22{2{'{22{2{{2{'{22{2{22{2{'{222{2Ą̈́̈́{'{22{2{{2{'{22{{11{2{'{22{2{{2{{'{22{2{{2{'{22{{22{1{'{22{2{{2{{222{{2{'{22{2{22{2{'{/auto_callout
4893
4894 //
4895 \=get=i00000000000000000000000000000000
4896 \=get=i2345678901234567890123456789012,get=i1245678901234567890123456789012
4897
4898 "(?(?C))"
4899
4900 /(?(?(?(?(?(?))))))/
4901
4902 /(?<=(?1))((?s))/anchored
4903
4904 /(*:ab)*/
4905
4906 %(*:(:(svvvvvvvvvv:]*[ Z!*;[]*[^[]*!^[+.+{{2,7}' _\\\\\\\\\\\\\)?.:.. *w////\\\Q\\\\\\\\\\\\\\\T\\\\\+/?/////'+\\\EEE?/////'+/*+/[^K]?]//(w)%never_backslash_c,alt_verbnames,auto_callout
4907
4908 /./newline=crlf
4909 \=ph
4910
4911 /(\x0e00\000000\xc)/replace=\P,substitute_extended
4912 \x0e00\000000\xc
4913
4914 //replace=0
4915 \=offset=7
4916
4917 ".+\QX\E+"B,no_auto_possess
4918
4919 ".+\QX\E+"B,auto_callout,no_auto_possess
4920
4921 # This one is here because Perl gives an 'unmatched )' error which goes away
4922 # if one of the \) sequences is removed - which is weird. PCRE finds it too
4923 # complicated to find a minimum matching length.
4924
4925 "()X|((((((((()))))))((((())))))\2())((((((\2\2)))\2)(\22((((\2\2)2))\2)))(2\ZZZ)+:)Z^|91ZiZZnter(ZZ |91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z+:)Z|91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z((Z*(\2(Z\':))\0)i|||||||||||||||loZ\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \)\0nte!rnal errpr\2\\21r(2\ZZZ)+:)Z!|91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \)\0(2\ZZZ)+:)Z^|91ZiZZnter(ZZ |91Z(ZZ ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \)\0(2\ZZZ)+:)Z^)))int \)\0(2\ZZZ)+:)Z^|91ZiZZnter(ZZernZal ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)2))\2Z)))int \))\ZZ(\r2Z( or#(\Z2(Z\Z(\2\2)2))\2Z)Z(\22Z((\Z2(Z\Z(\2\2)))\2))))((((((\2\2))))))"I
4926
4927 # This checks that new code for handling groups that may match an empty string
4928 # works on a very large number of alternatives. This pattern used to provoke a
4929 # complaint that it was too complicated.
4930
4931 /(?:\[A|B|C|D|E|F|G|H|I|J|]{200}Z)/expand
4932
4933 # This one used to compile rubbish instead of a compile error, and then
4934 # behave unpredictably at match time.
4935
4936 /.+(?(?C'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'))?!XXXX.=X/
4937 .+(?(?C'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'))?!XXXX.=X
4938
4939 /[:[:alnum:]-[[a:lnum:]+/
4940
4941 /((?(?C'')\QX\E(?!((?(?C'')(?!X=X));=)r*X=X));=)/
4942
4943 /((?(?C'')\Q\E(?!((?(?C'')(?!X=X));=)r*X=X));=)/
4944
4945 /abcd/auto_callout
4946 abcd\=callout_error=255:2
4947
4948 /()(\g+65534)/
4949
4950 /()(\g+65533)/
4951
4952 /\x00\x00\x00(\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\2*\x00k\d+\x00‎\x00\x00\x00\x00\x00\2*\x00\x00\1*.){36}int^\x00\x00\x00(\1{50779}?)J\w2/I
4953
4954 /(a)(b)\2\1\1\1\1/I
4955
4956 /(?<a>a)(?<b>b)\g{b}\g{a}\g{a}\g{a}\g{a}(?<a>xx)(?<b>zz)/I,dupnames
4957
4958 //
4959 \=ovector=7777777777
4960
4961 /(?1)(A(*COMMIT)|B)D/
4962 BAXBAD\=no_jit
4963
4964 "(?1){2}(a)"B
4965
4966 "(?1){2,4}(a)"B
4967
4968 # This test differs from Perl for the first subject. Perl ends up with
4969 # $1 set to 'B'; PCRE2 has it unset (which I think is right).
4970
4971 /^(?:
4972 (?:A| (?:B|B(*ACCEPT)) (?<=(.)) D)
4973 (Z)
4974 )+$/x
4975 AZB
4976 AZBDZ
4977
4978 # These four are temporarily here instead of test 1 while waiting for a JIT
4979 # update. They require backtracking into recursions.
4980
4981 /^(.|(.)(?1)\2)$/
4982 a
4983 aba
4984 abcba
4985 ababa
4986 abcdcba
4987
4988 /^((.)(?1)\2|.?)$/
4989 a
4990 aba
4991 abba
4992 abcba
4993 ababa
4994 abccba
4995 abcdcba
4996 abcddcba
4997
4998 /^(.)(\1|a(?2))/
4999 bab
5000
5001 /^(.|(.)(?1)?\2)$/
5002 abcba
5003
5004 # The first of these, when run by Perl, give the mark 'aa', which is wrong.
5005
5006 '(?>a(*:aa))b|ac' mark
5007 ac
5008
5009 '(?:a(*:aa))b|ac' mark
5010 ac
5011
5012 /(R?){65}/
5013 (R?){65}
5014
5015 /\[(a)]{60}/expand
5016 aaaa
5017
5018 /(?<!\1((?U)1((?U))))(*F)/never_backslash_c,alt_bsux,anchored,extended
5019
5020 /\g{3/
5021
5022 # End of testinput2

  ViewVC Help
Powered by ViewVC 1.1.5