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

Contents of /code/trunk/testdata/testoutput11

Parent Directory Parent Directory | Revision Log Revision Log


Revision 762 - (show annotations) (download)
Tue Nov 22 13:36:51 2011 UTC (2 years, 9 months ago) by ph10
File size: 17604 byte(s)
Fix repeated forward reference needed character bug.

1 /-- These tests are for the Perl >= 5.10 features that PCRE supports. --/
2
3 /\H\h\V\v/
4 X X\x0a
5 0: X X\x0a
6 X\x09X\x0b
7 0: X\x09X\x0b
8 ** Failers
9 No match
10 \xa0 X\x0a
11 No match
12
13 /\H*\h+\V?\v{3,4}/
14 \x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a
15 0: \x09 \xa0X\x0a\x0b\x0c\x0d
16 \x09\x20\xa0\x0a\x0b\x0c\x0d\x0a
17 0: \x09 \xa0\x0a\x0b\x0c\x0d
18 \x09\x20\xa0\x0a\x0b\x0c
19 0: \x09 \xa0\x0a\x0b\x0c
20 ** Failers
21 No match
22 \x09\x20\xa0\x0a\x0b
23 No match
24
25 /\H{3,4}/
26 XY ABCDE
27 0: ABCD
28 XY PQR ST
29 0: PQR
30
31 /.\h{3,4}./
32 XY AB PQRS
33 0: B P
34
35 /\h*X\h?\H+Y\H?Z/
36 >XNNNYZ
37 0: XNNNYZ
38 > X NYQZ
39 0: X NYQZ
40 ** Failers
41 No match
42 >XYZ
43 No match
44 > X NY Z
45 No match
46
47 /\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/
48 >XY\x0aZ\x0aA\x0bNN\x0c
49 0: XY\x0aZ\x0aA\x0bNN\x0c
50 >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c
51 0: \x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c
52
53 /(foo)\Kbar/
54 foobar
55 0: bar
56 1: foo
57
58 /(foo)(\Kbar|baz)/
59 foobar
60 0: bar
61 1: foo
62 2: bar
63 foobaz
64 0: foobaz
65 1: foo
66 2: baz
67
68 /(foo\Kbar)baz/
69 foobarbaz
70 0: barbaz
71 1: foobar
72
73 /abc\K|def\K/g+
74 Xabcdefghi
75 0:
76 0+ defghi
77 0:
78 0+ ghi
79
80 /ab\Kc|de\Kf/g+
81 Xabcdefghi
82 0: c
83 0+ defghi
84 0: f
85 0+ ghi
86
87 /(?=C)/g+
88 ABCDECBA
89 0:
90 0+ CDECBA
91 0:
92 0+ CBA
93
94 /^abc\K/+
95 abcdef
96 0:
97 0+ def
98 ** Failers
99 No match
100 defabcxyz
101 No match
102
103 /^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/
104 ababababbbabZXXXX
105 0: ababababbbabZ
106 1: ab
107 2: b
108
109 /(?<A>tom|bon)-\g{A}/
110 tom-tom
111 0: tom-tom
112 1: tom
113 bon-bon
114 0: bon-bon
115 1: bon
116
117 /(^(a|b\g{-1}))/
118 bacxxx
119 No match
120
121 /(?|(abc)|(xyz))\1/
122 abcabc
123 0: abcabc
124 1: abc
125 xyzxyz
126 0: xyzxyz
127 1: xyz
128 ** Failers
129 No match
130 abcxyz
131 No match
132 xyzabc
133 No match
134
135 /(?|(abc)|(xyz))(?1)/
136 abcabc
137 0: abcabc
138 1: abc
139 xyzabc
140 0: xyzabc
141 1: xyz
142 ** Failers
143 No match
144 xyzxyz
145 No match
146
147 /^X(?5)(a)(?|(b)|(q))(c)(d)(Y)/
148 XYabcdY
149 0: XYabcdY
150 1: a
151 2: b
152 3: c
153 4: d
154 5: Y
155
156 /^X(?7)(a)(?|(b|(r)(s))|(q))(c)(d)(Y)/
157 XYabcdY
158 0: XYabcdY
159 1: a
160 2: b
161 3: <unset>
162 4: <unset>
163 5: c
164 6: d
165 7: Y
166
167 /^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)/
168 XYabcdY
169 0: XYabcdY
170 1: a
171 2: b
172 3: <unset>
173 4: <unset>
174 5: c
175 6: d
176 7: Y
177
178 /(?'abc'\w+):\k<abc>{2}/
179 a:aaxyz
180 0: a:aa
181 1: a
182 ab:ababxyz
183 0: ab:abab
184 1: ab
185 ** Failers
186 No match
187 a:axyz
188 No match
189 ab:abxyz
190 No match
191
192 /(?'abc'\w+):\g{abc}{2}/
193 a:aaxyz
194 0: a:aa
195 1: a
196 ab:ababxyz
197 0: ab:abab
198 1: ab
199 ** Failers
200 No match
201 a:axyz
202 No match
203 ab:abxyz
204 No match
205
206 /^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)/x
207 abd
208 0: abd
209 1: a
210 ce
211 0: ce
212
213 /^(a.)\g-1Z/
214 aXaXZ
215 0: aXaXZ
216 1: aX
217
218 /^(a.)\g{-1}Z/
219 aXaXZ
220 0: aXaXZ
221 1: aX
222
223 /^(?(DEFINE) (?<A> a) (?<B> b) ) (?&A) (?&B) /x
224 abcd
225 0: ab
226
227 /(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT))
228 (?(DEFINE)
229 (?<NAME_PAT>[a-z]+)
230 (?<ADDRESS_PAT>\d+)
231 )/x
232 metcalfe 33
233 0: metcalfe 33
234 1: metcalfe
235 2: 33
236
237 /(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))\b(?&byte)(\.(?&byte)){3}/
238 1.2.3.4
239 0: 1.2.3.4
240 1: <unset>
241 2: .4
242 131.111.10.206
243 0: 131.111.10.206
244 1: <unset>
245 2: .206
246 10.0.0.0
247 0: 10.0.0.0
248 1: <unset>
249 2: .0
250 ** Failers
251 No match
252 10.6
253 No match
254 455.3.4.5
255 No match
256
257 /\b(?&byte)(\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))/
258 1.2.3.4
259 0: 1.2.3.4
260 1: .4
261 131.111.10.206
262 0: 131.111.10.206
263 1: .206
264 10.0.0.0
265 0: 10.0.0.0
266 1: .0
267 ** Failers
268 No match
269 10.6
270 No match
271 455.3.4.5
272 No match
273
274 /^(\w++|\s++)*$/
275 now is the time for all good men to come to the aid of the party
276 0: now is the time for all good men to come to the aid of the party
277 1: party
278 *** Failers
279 No match
280 this is not a line with only words and spaces!
281 No match
282
283 /(\d++)(\w)/
284 12345a
285 0: 12345a
286 1: 12345
287 2: a
288 *** Failers
289 No match
290 12345+
291 No match
292
293 /a++b/
294 aaab
295 0: aaab
296
297 /(a++b)/
298 aaab
299 0: aaab
300 1: aaab
301
302 /(a++)b/
303 aaab
304 0: aaab
305 1: aaa
306
307 /([^()]++|\([^()]*\))+/
308 ((abc(ade)ufh()()x
309 0: abc(ade)ufh()()x
310 1: x
311
312 /\(([^()]++|\([^()]+\))+\)/
313 (abc)
314 0: (abc)
315 1: abc
316 (abc(def)xyz)
317 0: (abc(def)xyz)
318 1: xyz
319 *** Failers
320 No match
321 ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
322 No match
323
324 /^([^()]|\((?1)*\))*$/
325 abc
326 0: abc
327 1: c
328 a(b)c
329 0: a(b)c
330 1: c
331 a(b(c))d
332 0: a(b(c))d
333 1: d
334 *** Failers)
335 No match
336 a(b(c)d
337 No match
338
339 /^>abc>([^()]|\((?1)*\))*<xyz<$/
340 >abc>123<xyz<
341 0: >abc>123<xyz<
342 1: 3
343 >abc>1(2)3<xyz<
344 0: >abc>1(2)3<xyz<
345 1: 3
346 >abc>(1(2)3)<xyz<
347 0: >abc>(1(2)3)<xyz<
348 1: (1(2)3)
349
350 /^(?:((.)(?1)\2|)|((.)(?3)\4|.))$/i
351 1221
352 0: 1221
353 1: 1221
354 2: 1
355 Satanoscillatemymetallicsonatas
356 0: Satanoscillatemymetallicsonatas
357 1: <unset>
358 2: <unset>
359 3: Satanoscillatemymetallicsonatas
360 4: S
361 AmanaplanacanalPanama
362 0: AmanaplanacanalPanama
363 1: <unset>
364 2: <unset>
365 3: AmanaplanacanalPanama
366 4: A
367 AblewasIereIsawElba
368 0: AblewasIereIsawElba
369 1: <unset>
370 2: <unset>
371 3: AblewasIereIsawElba
372 4: A
373 *** Failers
374 No match
375 Thequickbrownfox
376 No match
377
378 /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/
379 12
380 0: 12
381 1: 12
382 (((2+2)*-3)-7)
383 0: (((2+2)*-3)-7)
384 1: (((2+2)*-3)-7)
385 2: -
386 -12
387 0: -12
388 1: -12
389 *** Failers
390 No match
391 ((2+2)*-3)-7)
392 No match
393
394 /^(x(y|(?1){2})z)/
395 xyz
396 0: xyz
397 1: xyz
398 2: y
399 xxyzxyzz
400 0: xxyzxyzz
401 1: xxyzxyzz
402 2: xyzxyz
403 *** Failers
404 No match
405 xxyzz
406 No match
407 xxyzxyzxyzz
408 No match
409
410 /((< (?: (?(R) \d++ | [^<>]*+) | (?2)) * >))/x
411 <>
412 0: <>
413 1: <>
414 2: <>
415 <abcd>
416 0: <abcd>
417 1: <abcd>
418 2: <abcd>
419 <abc <123> hij>
420 0: <abc <123> hij>
421 1: <abc <123> hij>
422 2: <abc <123> hij>
423 <abc <def> hij>
424 0: <def>
425 1: <def>
426 2: <def>
427 <abc<>def>
428 0: <abc<>def>
429 1: <abc<>def>
430 2: <abc<>def>
431 <abc<>
432 0: <>
433 1: <>
434 2: <>
435 *** Failers
436 No match
437 <abc
438 No match
439
440 /^a+(*FAIL)/
441 aaaaaa
442 No match
443
444 /a+b?c+(*FAIL)/
445 aaabccc
446 No match
447
448 /a+b?(*PRUNE)c+(*FAIL)/
449 aaabccc
450 No match
451
452 /a+b?(*COMMIT)c+(*FAIL)/
453 aaabccc
454 No match
455
456 /a+b?(*SKIP)c+(*FAIL)/
457 aaabcccaaabccc
458 No match
459
460 /^(?:aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/
461 aaaxxxxxx
462 0: aaaxxxxxx
463 aaa++++++
464 0: aaa
465 bbbxxxxx
466 0: bbbxxxxx
467 bbb+++++
468 0: bbb
469 cccxxxx
470 0: cccxxxx
471 ccc++++
472 0: ccc
473 dddddddd
474 0: ddd
475
476 /^(aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/
477 aaaxxxxxx
478 0: aaaxxxxxx
479 1: aaaxxxxxx
480 aaa++++++
481 0: aaa
482 1: aaa
483 bbbxxxxx
484 0: bbbxxxxx
485 1: bbbxxxxx
486 bbb+++++
487 0: bbb
488 1: bbb
489 cccxxxx
490 0: cccxxxx
491 1: cccxxxx
492 ccc++++
493 0: ccc
494 1: ccc
495 dddddddd
496 0: ddd
497 1: ddd
498
499 /a+b?(*THEN)c+(*FAIL)/
500 aaabccc
501 No match
502
503 /(A (A|B(*ACCEPT)|C) D)(E)/x
504 AB
505 0: AB
506 1: AB
507 2: B
508 ABX
509 0: AB
510 1: AB
511 2: B
512 AADE
513 0: AADE
514 1: AAD
515 2: A
516 3: E
517 ACDE
518 0: ACDE
519 1: ACD
520 2: C
521 3: E
522 ** Failers
523 No match
524 AD
525 No match
526
527 /^\W*+(?:((.)\W*+(?1)\W*+\2|)|((.)\W*+(?3)\W*+\4|\W*+.\W*+))\W*+$/i
528 1221
529 0: 1221
530 1: 1221
531 2: 1
532 Satan, oscillate my metallic sonatas!
533 0: Satan, oscillate my metallic sonatas!
534 1: <unset>
535 2: <unset>
536 3: Satan, oscillate my metallic sonatas
537 4: S
538 A man, a plan, a canal: Panama!
539 0: A man, a plan, a canal: Panama!
540 1: <unset>
541 2: <unset>
542 3: A man, a plan, a canal: Panama
543 4: A
544 Able was I ere I saw Elba.
545 0: Able was I ere I saw Elba.
546 1: <unset>
547 2: <unset>
548 3: Able was I ere I saw Elba
549 4: A
550 *** Failers
551 No match
552 The quick brown fox
553 No match
554
555 /^((.)(?1)\2|.)$/
556 a
557 0: a
558 1: a
559 aba
560 0: aba
561 1: aba
562 2: a
563 aabaa
564 0: aabaa
565 1: aabaa
566 2: a
567 abcdcba
568 0: abcdcba
569 1: abcdcba
570 2: a
571 pqaabaaqp
572 0: pqaabaaqp
573 1: pqaabaaqp
574 2: p
575 ablewasiereisawelba
576 0: ablewasiereisawelba
577 1: ablewasiereisawelba
578 2: a
579 rhubarb
580 No match
581 the quick brown fox
582 No match
583
584 /(a)(?<=b(?1))/
585 baz
586 0: a
587 1: a
588 ** Failers
589 No match
590 caz
591 No match
592
593 /(?<=b(?1))(a)/
594 zbaaz
595 0: a
596 1: a
597 ** Failers
598 No match
599 aaa
600 No match
601
602 /(?<X>a)(?<=b(?&X))/
603 baz
604 0: a
605 1: a
606
607 /^(?|(abc)|(def))\1/
608 abcabc
609 0: abcabc
610 1: abc
611 defdef
612 0: defdef
613 1: def
614 ** Failers
615 No match
616 abcdef
617 No match
618 defabc
619 No match
620
621 /^(?|(abc)|(def))(?1)/
622 abcabc
623 0: abcabc
624 1: abc
625 defabc
626 0: defabc
627 1: def
628 ** Failers
629 No match
630 defdef
631 No match
632 abcdef
633 No match
634
635 /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |b(?<quote> (?<apostrophe>')|(?<realquote>")) ) (?('quote')[a-z]+|[0-9]+)/xJ
636 a\"aaaaa
637 0: a"aaaaa
638 1: "
639 2: <unset>
640 3: "
641 b\"aaaaa
642 0: b"aaaaa
643 1: <unset>
644 2: <unset>
645 3: <unset>
646 4: "
647 5: <unset>
648 6: "
649 ** Failers
650 No match
651 b\"11111
652 No match
653
654 /(?:(?1)|B)(A(*F)|C)/
655 ABCD
656 0: BC
657 1: C
658 CCD
659 0: CC
660 1: C
661 ** Failers
662 No match
663 CAD
664 No match
665
666 /^(?:(?1)|B)(A(*F)|C)/
667 CCD
668 0: CC
669 1: C
670 BCD
671 0: BC
672 1: C
673 ** Failers
674 No match
675 ABCD
676 No match
677 CAD
678 No match
679 BAD
680 No match
681
682 /(?:(?1)|B)(A(*ACCEPT)XX|C)D/
683 AAD
684 0: AA
685 1: A
686 ACD
687 0: ACD
688 1: C
689 BAD
690 0: BA
691 1: A
692 BCD
693 0: BCD
694 1: C
695 BAX
696 0: BA
697 1: A
698 ** Failers
699 No match
700 ACX
701 No match
702 ABC
703 No match
704
705 /(?(DEFINE)(A))B(?1)C/
706 BAC
707 0: BAC
708
709 /(?(DEFINE)((A)\2))B(?1)C/
710 BAAC
711 0: BAAC
712
713 /(?<pn> \( ( [^()]++ | (?&pn) )* \) )/x
714 (ab(cd)ef)
715 0: (ab(cd)ef)
716 1: (ab(cd)ef)
717 2: ef
718
719 /^(?!a(*SKIP)b)/
720 ac
721 0:
722
723 /^(?=a(*SKIP)b|ac)/
724 ** Failers
725 No match
726 ac
727 No match
728
729 /^(?=a(*THEN)b|ac)/
730 ac
731 0:
732
733 /^(?=a(*PRUNE)b)/
734 ab
735 0:
736 ** Failers
737 No match
738 ac
739 No match
740
741 /^(?=a(*ACCEPT)b)/
742 ac
743 0:
744
745 /^(?(?!a(*SKIP)b))/
746 ac
747 0:
748
749 /(?>a\Kb)/
750 ab
751 0: b
752
753 /((?>a\Kb))/
754 ab
755 0: b
756 1: ab
757
758 /(a\Kb)/
759 ab
760 0: b
761 1: ab
762
763 /^a\Kcz|ac/
764 ac
765 0: ac
766
767 /(?>a\Kbz|ab)/
768 ab
769 0: ab
770
771 /^(?&t)(?(DEFINE)(?<t>a\Kb))$/
772 ab
773 0: b
774
775 /^([^()]|\((?1)*\))*$/
776 a(b)c
777 0: a(b)c
778 1: c
779 a(b(c)d)e
780 0: a(b(c)d)e
781 1: e
782
783 /(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))/
784 0
785 0: 0
786 1: 0
787 00
788 0: 00
789 1: 00
790 2: 0
791 0000
792 0: 0000
793 1: 0000
794 2: 0
795
796 /(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))/
797 0
798 0: 0
799 1: 0
800 2: 0
801 00
802 0: 0
803 1: 0
804 2: 0
805 0000
806 0: 0
807 1: 0
808 2: 0
809
810 /--- This one does fail, as expected, in Perl. It needs the complex item at the
811 end of the pattern. A single letter instead of (B|D) makes it not fail,
812 which I think is a Perl bug. --- /
813
814 /A(*COMMIT)(B|D)/
815 ACABX
816 No match
817
818 /--- Check the use of names for failure ---/
819
820 /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
821 ** Failers
822 No match
823 AC
824 No match, mark = A
825 CB
826 No match, mark = B
827
828 /--- Force no study, otherwise mark is not seen. The studied version is in
829 test 2 because it isn't Perl-compatible. ---/
830
831 /(*MARK:A)(*SKIP:B)(C|X)/KSS
832 C
833 0: C
834 1: C
835 MK: A
836 D
837 No match, mark = A
838
839 /^(A(*THEN:A)B|C(*THEN:B)D)/K
840 ** Failers
841 No match
842 CB
843 No match, mark = B
844
845 /^(?:A(*THEN:A)B|C(*THEN:B)D)/K
846 CB
847 No match, mark = B
848
849 /^(?>A(*THEN:A)B|C(*THEN:B)D)/K
850 CB
851 No match, mark = B
852
853 /--- This should succeed, as the skip causes bump to offset 1 (the mark). Note
854 that we have to have something complicated such as (B|Z) at the end because,
855 for Perl, a simple character somehow causes an unwanted optimization to mess
856 with the handling of backtracking verbs. ---/
857
858 /A(*MARK:A)A+(*SKIP:A)(B|Z) | AC/xK
859 AAAC
860 0: AC
861
862 /--- Test skipping over a non-matching mark. ---/
863
864 /A(*MARK:A)A+(*MARK:B)(*SKIP:A)(B|Z) | AC/xK
865 AAAC
866 0: AC
867
868 /--- Check shorthand for MARK ---/
869
870 /A(*:A)A+(*SKIP:A)(B|Z) | AC/xK
871 AAAC
872 0: AC
873
874 /--- Don't loop! Force no study, otherwise mark is not seen. ---/
875
876 /(*:A)A+(*SKIP:A)(B|Z)/KSS
877 AAAC
878 No match, mark = A
879
880 /--- This should succeed, as a non-existent skip name disables the skip ---/
881
882 /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/xK
883 AAAC
884 0: AC
885
886 /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC(*:B)/xK
887 AAAC
888 0: AC
889 MK: B
890
891 /--- We use something more complicated than individual letters here, because
892 that causes different behaviour in Perl. Perhaps it disables some optimization;
893 anyway, the result now matches PCRE in that no tag is passed back for the
894 failures. ---/
895
896 /(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/xK
897 AABC
898 0: AB
899 1: A
900 2: B
901 MK: A
902 XXYZ
903 0: XXY
904 1: <unset>
905 2: <unset>
906 3: X
907 4: X
908 5: Y
909 MK: B
910 ** Failers
911 No match
912 XAQQ
913 No match
914 XAQQXZZ
915 No match
916 AXQQQ
917 No match
918 AXXQQQ
919 No match
920
921 /--- COMMIT at the start of a pattern should act like an anchor. Again,
922 however, we need the complication for Perl. ---/
923
924 /(*COMMIT)(A|P)(B|P)(C|P)/
925 ABCDEFG
926 0: ABC
927 1: A
928 2: B
929 3: C
930 ** Failers
931 No match
932 DEFGABC
933 No match
934
935 /--- COMMIT inside an atomic group can't stop backtracking over the group. ---/
936
937 /(\w+)(?>b(*COMMIT))\w{2}/
938 abbb
939 0: abbb
940 1: a
941
942 /(\w+)b(*COMMIT)\w{2}/
943 abbb
944 No match
945
946 /--- Check opening parens in comment when seeking forward reference. ---/
947
948 /(?&t)(?#()(?(DEFINE)(?<t>a))/
949 bac
950 0: a
951
952 /--- COMMIT should override THEN ---/
953
954 /(?>(*COMMIT)(?>yes|no)(*THEN)(*F))?/
955 yes
956 No match
957
958 /(?>(*COMMIT)(yes|no)(*THEN)(*F))?/
959 yes
960 No match
961
962 /b?(*SKIP)c/
963 bc
964 0: bc
965 abc
966 0: bc
967
968 /(*SKIP)bc/
969 a
970 No match
971
972 /(*SKIP)b/
973 a
974 No match
975
976 /(?P<abn>(?P=abn)xxx|)+/
977 xxx
978 0:
979 1:
980
981 /(?i:([^b]))(?1)/
982 aa
983 0: aa
984 1: a
985 aA
986 0: aA
987 1: a
988 ** Failers
989 0: **
990 1: *
991 ab
992 No match
993 aB
994 No match
995 Ba
996 No match
997 ba
998 No match
999
1000 /^(?&t)*+(?(DEFINE)(?<t>a))\w$/
1001 aaaaaaX
1002 0: aaaaaaX
1003 ** Failers
1004 No match
1005 aaaaaa
1006 No match
1007
1008 /^(?&t)*(?(DEFINE)(?<t>a))\w$/
1009 aaaaaaX
1010 0: aaaaaaX
1011 aaaaaa
1012 0: aaaaaa
1013
1014 /^(a)*+(\w)/
1015 aaaaX
1016 0: aaaaX
1017 1: a
1018 2: X
1019 YZ
1020 0: Y
1021 1: <unset>
1022 2: Y
1023 ** Failers
1024 No match
1025 aaaa
1026 No match
1027
1028 /^(?:a)*+(\w)/
1029 aaaaX
1030 0: aaaaX
1031 1: X
1032 YZ
1033 0: Y
1034 1: Y
1035 ** Failers
1036 No match
1037 aaaa
1038 No match
1039
1040 /^(a)++(\w)/
1041 aaaaX
1042 0: aaaaX
1043 1: a
1044 2: X
1045 ** Failers
1046 No match
1047 aaaa
1048 No match
1049 YZ
1050 No match
1051
1052 /^(?:a)++(\w)/
1053 aaaaX
1054 0: aaaaX
1055 1: X
1056 ** Failers
1057 No match
1058 aaaa
1059 No match
1060 YZ
1061 No match
1062
1063 /^(a)?+(\w)/
1064 aaaaX
1065 0: aa
1066 1: a
1067 2: a
1068 YZ
1069 0: Y
1070 1: <unset>
1071 2: Y
1072
1073 /^(?:a)?+(\w)/
1074 aaaaX
1075 0: aa
1076 1: a
1077 YZ
1078 0: Y
1079 1: Y
1080
1081 /^(a){2,}+(\w)/
1082 aaaaX
1083 0: aaaaX
1084 1: a
1085 2: X
1086 ** Failers
1087 No match
1088 aaa
1089 No match
1090 YZ
1091 No match
1092
1093 /^(?:a){2,}+(\w)/
1094 aaaaX
1095 0: aaaaX
1096 1: X
1097 ** Failers
1098 No match
1099 aaa
1100 No match
1101 YZ
1102 No match
1103
1104 /(a|)*(?1)b/
1105 b
1106 0: b
1107 1:
1108 ab
1109 0: ab
1110 1:
1111 aab
1112 0: aab
1113 1:
1114
1115 /(a)++(?1)b/
1116 ** Failers
1117 No match
1118 ab
1119 No match
1120 aab
1121 No match
1122
1123 /(a)*+(?1)b/
1124 ** Failers
1125 No match
1126 ab
1127 No match
1128 aab
1129 No match
1130
1131 /(?1)(?:(b)){0}/
1132 b
1133 0: b
1134
1135 /(foo ( \( ((?:(?> [^()]+ )|(?2))*) \) ) )/x
1136 foo(bar(baz)+baz(bop))
1137 0: foo(bar(baz)+baz(bop))
1138 1: foo(bar(baz)+baz(bop))
1139 2: (bar(baz)+baz(bop))
1140 3: bar(baz)+baz(bop)
1141
1142 /(A (A|B(*ACCEPT)|C) D)(E)/x
1143 AB
1144 0: AB
1145 1: AB
1146 2: B
1147
1148 /\A.*?(?:a|b(*THEN)c)/
1149 ba
1150 0: ba
1151
1152 /\A.*?(?:a|bc)/
1153 ba
1154 0: ba
1155
1156 /\A.*?(a|b(*THEN)c)/
1157 ba
1158 0: ba
1159 1: a
1160
1161 /\A.*?(a|bc)/
1162 ba
1163 0: ba
1164 1: a
1165
1166 /\A.*?(?:a|b(*THEN)c)++/
1167 ba
1168 0: ba
1169
1170 /\A.*?(?:a|bc)++/
1171 ba
1172 0: ba
1173
1174 /\A.*?(a|b(*THEN)c)++/
1175 ba
1176 0: ba
1177 1: a
1178
1179 /\A.*?(a|bc)++/
1180 ba
1181 0: ba
1182 1: a
1183
1184 /\A.*?(?:a|b(*THEN)c|d)/
1185 ba
1186 0: ba
1187
1188 /\A.*?(?:a|bc|d)/
1189 ba
1190 0: ba
1191
1192 /(?:(b))++/
1193 beetle
1194 0: b
1195 1: b
1196
1197 /(?(?=(a(*ACCEPT)z))a)/
1198 a
1199 0: a
1200 1: a
1201
1202 /^(a)(?1)+ab/
1203 aaaab
1204 0: aaaab
1205 1: a
1206
1207 /^(a)(?1)++ab/
1208 aaaab
1209 No match
1210
1211 /^(?=a(*:M))aZ/K
1212 aZbc
1213 0: aZ
1214 MK: M
1215
1216 /^(?!(*:M)b)aZ/K
1217 aZbc
1218 0: aZ
1219
1220 /(?(DEFINE)(a))?b(?1)/
1221 backgammon
1222 0: ba
1223
1224 /^\N+/
1225 abc\ndef
1226 0: abc
1227
1228 /^\N{1,}/
1229 abc\ndef
1230 0: abc
1231
1232 /(?(R)a+|(?R)b)/
1233 aaaabcde
1234 0: aaaab
1235
1236 /(?(R)a+|((?R))b)/
1237 aaaabcde
1238 0: aaaab
1239 1: aaaa
1240
1241 /((?(R)a+|(?1)b))/
1242 aaaabcde
1243 0: aaaab
1244 1: aaaab
1245
1246 /((?(R1)a+|(?1)b))/
1247 aaaabcde
1248 0: aaaab
1249 1: aaaab
1250
1251 /a(*:any
1252 name)/K
1253 abc
1254 0: a
1255 MK: any
1256 name
1257
1258 /(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))/
1259 a
1260 0: a
1261 ba
1262 0: a
1263 bba
1264 0: a
1265
1266 /--- Checking revised (*THEN) handling ---/
1267
1268 /--- Capture ---/
1269
1270 /^.*? (a(*THEN)b) c/x
1271 aabc
1272 No match
1273
1274 /^.*? (a(*THEN)b|(*F)) c/x
1275 aabc
1276 0: aabc
1277 1: ab
1278
1279 /^.*? ( (a(*THEN)b) | (*F) ) c/x
1280 aabc
1281 0: aabc
1282 1: ab
1283 2: ab
1284
1285 /^.*? ( (a(*THEN)b) ) c/x
1286 aabc
1287 No match
1288
1289 /--- Non-capture ---/
1290
1291 /^.*? (?:a(*THEN)b) c/x
1292 aabc
1293 No match
1294
1295 /^.*? (?:a(*THEN)b|(*F)) c/x
1296 aabc
1297 0: aabc
1298
1299 /^.*? (?: (?:a(*THEN)b) | (*F) ) c/x
1300 aabc
1301 0: aabc
1302
1303 /^.*? (?: (?:a(*THEN)b) ) c/x
1304 aabc
1305 No match
1306
1307 /--- Atomic ---/
1308
1309 /^.*? (?>a(*THEN)b) c/x
1310 aabc
1311 No match
1312
1313 /^.*? (?>a(*THEN)b|(*F)) c/x
1314 aabc
1315 0: aabc
1316
1317 /^.*? (?> (?>a(*THEN)b) | (*F) ) c/x
1318 aabc
1319 0: aabc
1320
1321 /^.*? (?> (?>a(*THEN)b) ) c/x
1322 aabc
1323 No match
1324
1325 /--- Possessive capture ---/
1326
1327 /^.*? (a(*THEN)b)++ c/x
1328 aabc
1329 No match
1330
1331 /^.*? (a(*THEN)b|(*F))++ c/x
1332 aabc
1333 0: aabc
1334 1: ab
1335
1336 /^.*? ( (a(*THEN)b)++ | (*F) )++ c/x
1337 aabc
1338 0: aabc
1339 1: ab
1340 2: ab
1341
1342 /^.*? ( (a(*THEN)b)++ )++ c/x
1343 aabc
1344 No match
1345
1346 /--- Possessive non-capture ---/
1347
1348 /^.*? (?:a(*THEN)b)++ c/x
1349 aabc
1350 No match
1351
1352 /^.*? (?:a(*THEN)b|(*F))++ c/x
1353 aabc
1354 0: aabc
1355
1356 /^.*? (?: (?:a(*THEN)b)++ | (*F) )++ c/x
1357 aabc
1358 0: aabc
1359
1360 /^.*? (?: (?:a(*THEN)b)++ )++ c/x
1361 aabc
1362 No match
1363
1364 /--- Condition assertion ---/
1365
1366 /^(?(?=a(*THEN)b)ab|ac)/
1367 ac
1368 0: ac
1369
1370 /--- Condition ---/
1371
1372 /^.*?(?(?=a)a|b(*THEN)c)/
1373 ba
1374 No match
1375
1376 /^.*?(?:(?(?=a)a|b(*THEN)c)|d)/
1377 ba
1378 0: ba
1379
1380 /^.*?(?(?=a)a(*THEN)b|c)/
1381 ac
1382 No match
1383
1384 /--- Assertion ---/
1385
1386 /^.*(?=a(*THEN)b)/
1387 aabc
1388 0: a
1389
1390 /------------------------------/
1391
1392 /(?>a(*:m))/imsxSK
1393 a
1394 0: a
1395 MK: m
1396
1397 /(?>(a)(*:m))/imsxSK
1398 a
1399 0: a
1400 1: a
1401 MK: m
1402
1403 /(?<=a(*ACCEPT)b)c/
1404 xacd
1405 0: c
1406
1407 /(?<=(a(*ACCEPT)b))c/
1408 xacd
1409 0: c
1410 1: a
1411
1412 /(?<=(a(*COMMIT)b))c/
1413 xabcd
1414 0: c
1415 1: ab
1416 ** Failers
1417 No match
1418 xacd
1419 No match
1420
1421 /(?<!a(*FAIL)b)c/
1422 xcd
1423 0: c
1424 acd
1425 0: c
1426
1427 /(?<=a(*:N)b)c/K
1428 xabcd
1429 0: c
1430 MK: N
1431
1432 /(?<=a(*PRUNE)b)c/
1433 xabcd
1434 0: c
1435
1436 /(?<=a(*SKIP)b)c/
1437 xabcd
1438 0: c
1439
1440 /(?<=a(*THEN)b)c/
1441 xabcd
1442 0: c
1443
1444 /(a)(?2){2}(.)/
1445 abcd
1446 0: abcd
1447 1: a
1448 2: d
1449
1450 /-- End of testinput11 --/

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12