Annotation of embedaddon/pcre/testdata/testoutput11, revision 1.1.1.1
1.1 misho 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: /--- COMMIT at the start of a pattern should act like an anchor. Again,
892: however, we need the complication for Perl. ---/
893:
894: /(*COMMIT)(A|P)(B|P)(C|P)/
895: ABCDEFG
896: 0: ABC
897: 1: A
898: 2: B
899: 3: C
900: ** Failers
901: No match
902: DEFGABC
903: No match
904:
905: /--- COMMIT inside an atomic group can't stop backtracking over the group. ---/
906:
907: /(\w+)(?>b(*COMMIT))\w{2}/
908: abbb
909: 0: abbb
910: 1: a
911:
912: /(\w+)b(*COMMIT)\w{2}/
913: abbb
914: No match
915:
916: /--- Check opening parens in comment when seeking forward reference. ---/
917:
918: /(?&t)(?#()(?(DEFINE)(?<t>a))/
919: bac
920: 0: a
921:
922: /--- COMMIT should override THEN ---/
923:
924: /(?>(*COMMIT)(?>yes|no)(*THEN)(*F))?/
925: yes
926: No match
927:
928: /(?>(*COMMIT)(yes|no)(*THEN)(*F))?/
929: yes
930: No match
931:
932: /b?(*SKIP)c/
933: bc
934: 0: bc
935: abc
936: 0: bc
937:
938: /(*SKIP)bc/
939: a
940: No match
941:
942: /(*SKIP)b/
943: a
944: No match
945:
946: /(?P<abn>(?P=abn)xxx|)+/
947: xxx
948: 0:
949: 1:
950:
951: /(?i:([^b]))(?1)/
952: aa
953: 0: aa
954: 1: a
955: aA
956: 0: aA
957: 1: a
958: ** Failers
959: 0: **
960: 1: *
961: ab
962: No match
963: aB
964: No match
965: Ba
966: No match
967: ba
968: No match
969:
970: /^(?&t)*+(?(DEFINE)(?<t>a))\w$/
971: aaaaaaX
972: 0: aaaaaaX
973: ** Failers
974: No match
975: aaaaaa
976: No match
977:
978: /^(?&t)*(?(DEFINE)(?<t>a))\w$/
979: aaaaaaX
980: 0: aaaaaaX
981: aaaaaa
982: 0: aaaaaa
983:
984: /^(a)*+(\w)/
985: aaaaX
986: 0: aaaaX
987: 1: a
988: 2: X
989: YZ
990: 0: Y
991: 1: <unset>
992: 2: Y
993: ** Failers
994: No match
995: aaaa
996: No match
997:
998: /^(?:a)*+(\w)/
999: aaaaX
1000: 0: aaaaX
1001: 1: X
1002: YZ
1003: 0: Y
1004: 1: Y
1005: ** Failers
1006: No match
1007: aaaa
1008: No match
1009:
1010: /^(a)++(\w)/
1011: aaaaX
1012: 0: aaaaX
1013: 1: a
1014: 2: X
1015: ** Failers
1016: No match
1017: aaaa
1018: No match
1019: YZ
1020: No match
1021:
1022: /^(?:a)++(\w)/
1023: aaaaX
1024: 0: aaaaX
1025: 1: X
1026: ** Failers
1027: No match
1028: aaaa
1029: No match
1030: YZ
1031: No match
1032:
1033: /^(a)?+(\w)/
1034: aaaaX
1035: 0: aa
1036: 1: a
1037: 2: a
1038: YZ
1039: 0: Y
1040: 1: <unset>
1041: 2: Y
1042:
1043: /^(?:a)?+(\w)/
1044: aaaaX
1045: 0: aa
1046: 1: a
1047: YZ
1048: 0: Y
1049: 1: Y
1050:
1051: /^(a){2,}+(\w)/
1052: aaaaX
1053: 0: aaaaX
1054: 1: a
1055: 2: X
1056: ** Failers
1057: No match
1058: aaa
1059: No match
1060: YZ
1061: No match
1062:
1063: /^(?:a){2,}+(\w)/
1064: aaaaX
1065: 0: aaaaX
1066: 1: X
1067: ** Failers
1068: No match
1069: aaa
1070: No match
1071: YZ
1072: No match
1073:
1074: /(a|)*(?1)b/
1075: b
1076: 0: b
1077: 1:
1078: ab
1079: 0: ab
1080: 1:
1081: aab
1082: 0: aab
1083: 1:
1084:
1085: /(a)++(?1)b/
1086: ** Failers
1087: No match
1088: ab
1089: No match
1090: aab
1091: No match
1092:
1093: /(a)*+(?1)b/
1094: ** Failers
1095: No match
1096: ab
1097: No match
1098: aab
1099: No match
1100:
1101: /(?1)(?:(b)){0}/
1102: b
1103: 0: b
1104:
1105: /(foo ( \( ((?:(?> [^()]+ )|(?2))*) \) ) )/x
1106: foo(bar(baz)+baz(bop))
1107: 0: foo(bar(baz)+baz(bop))
1108: 1: foo(bar(baz)+baz(bop))
1109: 2: (bar(baz)+baz(bop))
1110: 3: bar(baz)+baz(bop)
1111:
1112: /(A (A|B(*ACCEPT)|C) D)(E)/x
1113: AB
1114: 0: AB
1115: 1: AB
1116: 2: B
1117:
1118: /\A.*?(?:a|b(*THEN)c)/
1119: ba
1120: 0: ba
1121:
1122: /\A.*?(?:a|bc)/
1123: ba
1124: 0: ba
1125:
1126: /\A.*?(a|b(*THEN)c)/
1127: ba
1128: 0: ba
1129: 1: a
1130:
1131: /\A.*?(a|bc)/
1132: ba
1133: 0: ba
1134: 1: a
1135:
1136: /\A.*?(?:a|b(*THEN)c)++/
1137: ba
1138: 0: ba
1139:
1140: /\A.*?(?:a|bc)++/
1141: ba
1142: 0: ba
1143:
1144: /\A.*?(a|b(*THEN)c)++/
1145: ba
1146: 0: ba
1147: 1: a
1148:
1149: /\A.*?(a|bc)++/
1150: ba
1151: 0: ba
1152: 1: a
1153:
1154: /\A.*?(?:a|b(*THEN)c|d)/
1155: ba
1156: 0: ba
1157:
1158: /\A.*?(?:a|bc|d)/
1159: ba
1160: 0: ba
1161:
1162: /(?:(b))++/
1163: beetle
1164: 0: b
1165: 1: b
1166:
1167: /(?(?=(a(*ACCEPT)z))a)/
1168: a
1169: 0: a
1170: 1: a
1171:
1172: /^(a)(?1)+ab/
1173: aaaab
1174: 0: aaaab
1175: 1: a
1176:
1177: /^(a)(?1)++ab/
1178: aaaab
1179: No match
1180:
1181: /^(?=a(*:M))aZ/K
1182: aZbc
1183: 0: aZ
1184: MK: M
1185:
1186: /^(?!(*:M)b)aZ/K
1187: aZbc
1188: 0: aZ
1189:
1190: /(?(DEFINE)(a))?b(?1)/
1191: backgammon
1192: 0: ba
1193:
1194: /^\N+/
1195: abc\ndef
1196: 0: abc
1197:
1198: /^\N{1,}/
1199: abc\ndef
1200: 0: abc
1201:
1202: /(?(R)a+|(?R)b)/
1203: aaaabcde
1204: 0: aaaab
1205:
1206: /(?(R)a+|((?R))b)/
1207: aaaabcde
1208: 0: aaaab
1209: 1: aaaa
1210:
1211: /((?(R)a+|(?1)b))/
1212: aaaabcde
1213: 0: aaaab
1214: 1: aaaab
1215:
1216: /((?(R1)a+|(?1)b))/
1217: aaaabcde
1218: 0: aaaab
1219: 1: aaaab
1220:
1221: /a(*:any
1222: name)/K
1223: abc
1224: 0: a
1225: MK: any
1226: name
1227:
1228: /(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))/
1229: a
1230: 0: a
1231: ba
1232: 0: a
1233: bba
1234: 0: a
1235:
1236: /--- Checking revised (*THEN) handling ---/
1237:
1238: /--- Capture ---/
1239:
1240: /^.*? (a(*THEN)b) c/x
1241: aabc
1242: No match
1243:
1244: /^.*? (a(*THEN)b|(*F)) c/x
1245: aabc
1246: 0: aabc
1247: 1: ab
1248:
1249: /^.*? ( (a(*THEN)b) | (*F) ) c/x
1250: aabc
1251: 0: aabc
1252: 1: ab
1253: 2: ab
1254:
1255: /^.*? ( (a(*THEN)b) ) c/x
1256: aabc
1257: No match
1258:
1259: /--- Non-capture ---/
1260:
1261: /^.*? (?:a(*THEN)b) c/x
1262: aabc
1263: No match
1264:
1265: /^.*? (?:a(*THEN)b|(*F)) c/x
1266: aabc
1267: 0: aabc
1268:
1269: /^.*? (?: (?:a(*THEN)b) | (*F) ) c/x
1270: aabc
1271: 0: aabc
1272:
1273: /^.*? (?: (?:a(*THEN)b) ) c/x
1274: aabc
1275: No match
1276:
1277: /--- Atomic ---/
1278:
1279: /^.*? (?>a(*THEN)b) c/x
1280: aabc
1281: No match
1282:
1283: /^.*? (?>a(*THEN)b|(*F)) c/x
1284: aabc
1285: 0: aabc
1286:
1287: /^.*? (?> (?>a(*THEN)b) | (*F) ) c/x
1288: aabc
1289: 0: aabc
1290:
1291: /^.*? (?> (?>a(*THEN)b) ) c/x
1292: aabc
1293: No match
1294:
1295: /--- Possessive capture ---/
1296:
1297: /^.*? (a(*THEN)b)++ c/x
1298: aabc
1299: No match
1300:
1301: /^.*? (a(*THEN)b|(*F))++ c/x
1302: aabc
1303: 0: aabc
1304: 1: ab
1305:
1306: /^.*? ( (a(*THEN)b)++ | (*F) )++ c/x
1307: aabc
1308: 0: aabc
1309: 1: ab
1310: 2: ab
1311:
1312: /^.*? ( (a(*THEN)b)++ )++ c/x
1313: aabc
1314: No match
1315:
1316: /--- Possessive non-capture ---/
1317:
1318: /^.*? (?:a(*THEN)b)++ c/x
1319: aabc
1320: No match
1321:
1322: /^.*? (?:a(*THEN)b|(*F))++ c/x
1323: aabc
1324: 0: aabc
1325:
1326: /^.*? (?: (?:a(*THEN)b)++ | (*F) )++ c/x
1327: aabc
1328: 0: aabc
1329:
1330: /^.*? (?: (?:a(*THEN)b)++ )++ c/x
1331: aabc
1332: No match
1333:
1334: /--- Condition assertion ---/
1335:
1336: /^(?(?=a(*THEN)b)ab|ac)/
1337: ac
1338: 0: ac
1339:
1340: /--- Condition ---/
1341:
1342: /^.*?(?(?=a)a|b(*THEN)c)/
1343: ba
1344: No match
1345:
1346: /^.*?(?:(?(?=a)a|b(*THEN)c)|d)/
1347: ba
1348: 0: ba
1349:
1350: /^.*?(?(?=a)a(*THEN)b|c)/
1351: ac
1352: No match
1353:
1354: /--- Assertion ---/
1355:
1356: /^.*(?=a(*THEN)b)/
1357: aabc
1358: 0: a
1359:
1360: /------------------------------/
1361:
1362: /(?>a(*:m))/imsxSK
1363: a
1364: 0: a
1365: MK: m
1366:
1367: /(?>(a)(*:m))/imsxSK
1368: a
1369: 0: a
1370: 1: a
1371: MK: m
1372:
1373: /(?<=a(*ACCEPT)b)c/
1374: xacd
1375: 0: c
1376:
1377: /(?<=(a(*ACCEPT)b))c/
1378: xacd
1379: 0: c
1380: 1: a
1381:
1382: /(?<=(a(*COMMIT)b))c/
1383: xabcd
1384: 0: c
1385: 1: ab
1386: ** Failers
1387: No match
1388: xacd
1389: No match
1390:
1391: /(?<!a(*FAIL)b)c/
1392: xcd
1393: 0: c
1394: acd
1395: 0: c
1396:
1397: /(?<=a(*:N)b)c/K
1398: xabcd
1399: 0: c
1400: MK: N
1401:
1402: /(?<=a(*PRUNE)b)c/
1403: xabcd
1404: 0: c
1405:
1406: /(?<=a(*SKIP)b)c/
1407: xabcd
1408: 0: c
1409:
1410: /(?<=a(*THEN)b)c/
1411: xabcd
1412: 0: c
1413:
1414: /(a)(?2){2}(.)/
1415: abcd
1416: 0: abcd
1417: 1: a
1418: 2: d
1419:
1420: /(*MARK:A)(*PRUNE:B)(C|X)/KS
1421: C
1422: 0: C
1423: 1: C
1424: MK: B
1425: D
1426: No match, mark = B
1427:
1428: /(*MARK:A)(*PRUNE:B)(C|X)/KSS
1429: C
1430: 0: C
1431: 1: C
1432: MK: B
1433: D
1434: No match, mark = B
1435:
1436: /(*MARK:A)(*THEN:B)(C|X)/KS
1437: C
1438: 0: C
1439: 1: C
1440: MK: B
1441: D
1442: No match, mark = B
1443:
1444: /(*MARK:A)(*THEN:B)(C|X)/KSY
1445: C
1446: 0: C
1447: 1: C
1448: MK: B
1449: D
1450: No match, mark = B
1451:
1452: /(*MARK:A)(*THEN:B)(C|X)/KSS
1453: C
1454: 0: C
1455: 1: C
1456: MK: B
1457: D
1458: No match, mark = B
1459:
1460: /--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/
1461:
1462: /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK
1463: AAAC
1464: No match, mark = A
1465:
1466: /--- Same --/
1467:
1468: /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK
1469: AAAC
1470: No match, mark = B
1471:
1472: /A(*:A)A+(*SKIP)(B|Z) | AC/xK
1473: AAAC
1474: No match, mark = A
1475:
1476: /--- This should fail, as a null name is the same as no name ---/
1477:
1478: /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK
1479: AAAC
1480: No match, mark = A
1481:
1482: /--- A check on what happens after hitting a mark and them bumping along to
1483: something that does not even start. Perl reports tags after the failures here,
1484: though it does not when the individual letters are made into something
1485: more complicated. ---/
1486:
1487: /A(*:A)B|XX(*:B)Y/K
1488: AABC
1489: 0: AB
1490: MK: A
1491: XXYZ
1492: 0: XXY
1493: MK: B
1494: ** Failers
1495: No match
1496: XAQQ
1497: No match, mark = A
1498: XAQQXZZ
1499: No match, mark = A
1500: AXQQQ
1501: No match, mark = A
1502: AXXQQQ
1503: No match, mark = B
1504:
1505: /^(A(*THEN:A)B|C(*THEN:B)D)/K
1506: AB
1507: 0: AB
1508: 1: AB
1509: MK: A
1510: CD
1511: 0: CD
1512: 1: CD
1513: MK: B
1514: ** Failers
1515: No match
1516: AC
1517: No match, mark = A
1518: CB
1519: No match, mark = B
1520:
1521: /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
1522: AB
1523: 0: AB
1524: 1: AB
1525: MK: A
1526: CD
1527: 0: CD
1528: 1: CD
1529: MK: B
1530: ** Failers
1531: No match
1532: AC
1533: No match, mark = A
1534: CB
1535: No match, mark = B
1536:
1537: /--- An empty name does not pass back an empty string. It is the same as if no
1538: name were given. ---/
1539:
1540: /^(A(*PRUNE:)B|C(*PRUNE:B)D)/K
1541: AB
1542: 0: AB
1543: 1: AB
1544: CD
1545: 0: CD
1546: 1: CD
1547: MK: B
1548:
1549: /--- PRUNE goes to next bumpalong; COMMIT does not. ---/
1550:
1551: /A(*PRUNE:A)B/K
1552: ACAB
1553: 0: AB
1554: MK: A
1555:
1556: /--- Mark names can be duplicated ---/
1557:
1558: /A(*:A)B|X(*:A)Y/K
1559: AABC
1560: 0: AB
1561: MK: A
1562: XXYZ
1563: 0: XY
1564: MK: A
1565:
1566: /b(*:m)f|a(*:n)w/K
1567: aw
1568: 0: aw
1569: MK: n
1570: ** Failers
1571: No match, mark = n
1572: abc
1573: No match, mark = m
1574:
1575: /b(*:m)f|aw/K
1576: abaw
1577: 0: aw
1578: ** Failers
1579: No match
1580: abc
1581: No match, mark = m
1582: abax
1583: No match, mark = m
1584:
1585: /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK
1586: AAAC
1587: 0: AAC
1588:
1589: /a(*PRUNE:X)bc|qq/KY
1590: ** Failers
1591: No match, mark = X
1592: axy
1593: No match, mark = X
1594:
1595: /a(*THEN:X)bc|qq/KY
1596: ** Failers
1597: No match, mark = X
1598: axy
1599: No match, mark = X
1600:
1601: /(?=a(*MARK:A)b)..x/K
1602: abxy
1603: 0: abx
1604: MK: A
1605: ** Failers
1606: No match
1607: abpq
1608: No match
1609:
1610: /(?=a(*MARK:A)b)..(*:Y)x/K
1611: abxy
1612: 0: abx
1613: MK: Y
1614: ** Failers
1615: No match
1616: abpq
1617: No match
1618:
1619: /(?=a(*PRUNE:A)b)..x/K
1620: abxy
1621: 0: abx
1622: MK: A
1623: ** Failers
1624: No match
1625: abpq
1626: No match
1627:
1628: /(?=a(*PRUNE:A)b)..(*:Y)x/K
1629: abxy
1630: 0: abx
1631: MK: Y
1632: ** Failers
1633: No match
1634: abpq
1635: No match
1636:
1637: /(?=a(*THEN:A)b)..x/K
1638: abxy
1639: 0: abx
1640: MK: A
1641: ** Failers
1642: No match
1643: abpq
1644: No match
1645:
1646: /(?=a(*THEN:A)b)..(*:Y)x/K
1647: abxy
1648: 0: abx
1649: MK: Y
1650: ** Failers
1651: No match
1652: abpq
1653: No match
1654:
1655: /-- End of testinput11 --/
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>