| 2 |
of PCRE's API, error diagnostics, and the compiled code of some patterns. |
of PCRE's API, error diagnostics, and the compiled code of some patterns. |
| 3 |
It also checks the non-Perl syntax the PCRE supports (Python, .NET, |
It also checks the non-Perl syntax the PCRE supports (Python, .NET, |
| 4 |
Oniguruma). Finally, there are some tests where PCRE and Perl differ, |
Oniguruma). Finally, there are some tests where PCRE and Perl differ, |
| 5 |
either because PCRE can't be compatible, or there is potential Perl |
either because PCRE can't be compatible, or there is a possible Perl |
| 6 |
bug. --/ |
bug. --/ |
| 7 |
|
|
| 8 |
/-- Originally, the Perl 5.10 things were in here too, but now I have separated |
/-- Originally, the Perl >= 5.10 things were in here too, but now I have |
| 9 |
many (most?) of them out into test 11. However, there may still be some |
separated many (most?) of them out into test 11. However, there may still |
| 10 |
that were overlooked. --/ |
be some that were overlooked. --/ |
| 11 |
|
|
| 12 |
/(a)b|/I |
/(a)b|/I |
| 13 |
Capturing subpattern count = 1 |
Capturing subpattern count = 1 |
| 103 |
/(?X)[\B]/ |
/(?X)[\B]/ |
| 104 |
Failed: invalid escape sequence in character class at offset 6 |
Failed: invalid escape sequence in character class at offset 6 |
| 105 |
|
|
| 106 |
|
/(?X)[\R]/ |
| 107 |
|
Failed: invalid escape sequence in character class at offset 6 |
| 108 |
|
|
| 109 |
|
/(?X)[\X]/ |
| 110 |
|
Failed: invalid escape sequence in character class at offset 6 |
| 111 |
|
|
| 112 |
|
/[\B]/BZ |
| 113 |
|
------------------------------------------------------------------ |
| 114 |
|
Bra |
| 115 |
|
B |
| 116 |
|
Ket |
| 117 |
|
End |
| 118 |
|
------------------------------------------------------------------ |
| 119 |
|
|
| 120 |
|
/[\R]/BZ |
| 121 |
|
------------------------------------------------------------------ |
| 122 |
|
Bra |
| 123 |
|
R |
| 124 |
|
Ket |
| 125 |
|
End |
| 126 |
|
------------------------------------------------------------------ |
| 127 |
|
|
| 128 |
|
/[\X]/BZ |
| 129 |
|
------------------------------------------------------------------ |
| 130 |
|
Bra |
| 131 |
|
X |
| 132 |
|
Ket |
| 133 |
|
End |
| 134 |
|
------------------------------------------------------------------ |
| 135 |
|
|
| 136 |
/[z-a]/ |
/[z-a]/ |
| 137 |
Failed: range out of order in character class at offset 3 |
Failed: range out of order in character class at offset 3 |
| 138 |
|
|
| 887 |
a |
a |
| 888 |
No match |
No match |
| 889 |
|
|
| 890 |
/This one is here because I think Perl 5.005_02 gets the setting of $1 wrong/I |
/This one is here because Perl behaves differently; see also the following/I |
| 891 |
Capturing subpattern count = 0 |
Capturing subpattern count = 0 |
| 892 |
No options |
No options |
| 893 |
First char = 'T' |
First char = 'T' |
| 899 |
Options: anchored |
Options: anchored |
| 900 |
No first char |
No first char |
| 901 |
No need char |
No need char |
| 902 |
|
aaaa |
| 903 |
|
No match |
| 904 |
aaaaaa |
aaaaaa |
| 905 |
0: aaaaaa |
No match |
| 906 |
1: aa |
|
| 907 |
|
/Perl does not fail these two for the final subjects. Neither did PCRE until/ |
| 908 |
|
/release 8.01. The problem is in backtracking into a subpattern that contains/ |
| 909 |
|
No match |
| 910 |
|
/a recursive reference to itself. PCRE has now made these into atomic patterns./ |
| 911 |
|
No match |
| 912 |
|
|
| 913 |
|
/^(xa|=?\1a){2}$/ |
| 914 |
|
xa=xaa |
| 915 |
|
0: xa=xaa |
| 916 |
|
1: =xaa |
| 917 |
|
** Failers |
| 918 |
|
No match |
| 919 |
|
xa=xaaa |
| 920 |
|
No match |
| 921 |
|
|
| 922 |
|
/^(xa|=?\1a)+$/ |
| 923 |
|
xa=xaa |
| 924 |
|
0: xa=xaa |
| 925 |
|
1: =xaa |
| 926 |
|
** Failers |
| 927 |
|
No match |
| 928 |
|
xa=xaaa |
| 929 |
|
No match |
| 930 |
|
|
| 931 |
/These are syntax tests from Perl 5.005/I |
/These are syntax tests from Perl 5.005/I |
| 932 |
Capturing subpattern count = 0 |
Capturing subpattern count = 0 |
| 3228 |
Failed: POSIX named classes are supported only within a class at offset 0 |
Failed: POSIX named classes are supported only within a class at offset 0 |
| 3229 |
|
|
| 3230 |
/\l/I |
/\l/I |
| 3231 |
Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1 |
Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1 |
| 3232 |
|
|
| 3233 |
/\L/I |
/\L/I |
| 3234 |
Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1 |
Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1 |
| 3235 |
|
|
| 3236 |
/\N{name}/I |
/\N{name}/I |
| 3237 |
Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1 |
Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1 |
| 3238 |
|
|
| 3239 |
/\u/I |
/\u/I |
| 3240 |
Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1 |
Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1 |
| 3241 |
|
|
| 3242 |
/\U/I |
/\U/I |
| 3243 |
Failed: PCRE does not support \L, \l, \N, \U, or \u at offset 1 |
Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1 |
| 3244 |
|
|
| 3245 |
/[/I |
/[/I |
| 3246 |
Failed: missing terminating ] for character class at offset 1 |
Failed: missing terminating ] for character class at offset 1 |
| 8697 |
+13 ^ ^ (*FAIL) |
+13 ^ ^ (*FAIL) |
| 8698 |
No match |
No match |
| 8699 |
|
|
|
/a(*PRUNE:XXX)b/ |
|
|
Failed: (*VERB) with an argument is not supported at offset 8 |
|
|
|
|
| 8700 |
/a(*MARK)b/ |
/a(*MARK)b/ |
| 8701 |
Failed: (*VERB) not recognized at offset 7 |
Failed: (*MARK) must have an argument at offset 7 |
| 8702 |
|
|
| 8703 |
/(?i:A{1,}\6666666666)/ |
/(?i:A{1,}\6666666666)/ |
| 8704 |
Failed: number is too big at offset 19 |
Failed: number is too big at offset 19 |
| 8787 |
No match |
No match |
| 8788 |
a\x85b |
a\x85b |
| 8789 |
No match |
No match |
| 8790 |
|
|
| 8791 |
|
/(*ANY).*/g |
| 8792 |
|
abc\r\ndef |
| 8793 |
|
0: abc |
| 8794 |
|
0: |
| 8795 |
|
0: def |
| 8796 |
|
0: |
| 8797 |
|
|
| 8798 |
|
/(*ANYCRLF).*/g |
| 8799 |
|
abc\r\ndef |
| 8800 |
|
0: abc |
| 8801 |
|
0: |
| 8802 |
|
0: def |
| 8803 |
|
0: |
| 8804 |
|
|
| 8805 |
|
/(*CRLF).*/g |
| 8806 |
|
abc\r\ndef |
| 8807 |
|
0: abc |
| 8808 |
|
0: |
| 8809 |
|
0: def |
| 8810 |
|
0: |
| 8811 |
|
|
| 8812 |
/a\Rb/I<bsr_anycrlf> |
/a\Rb/I<bsr_anycrlf> |
| 8813 |
Capturing subpattern count = 0 |
Capturing subpattern count = 0 |
| 10445 |
abcdde |
abcdde |
| 10446 |
No match |
No match |
| 10447 |
|
|
| 10448 |
|
/abcd*/ |
| 10449 |
|
xxxxabcd\P |
| 10450 |
|
0: abcd |
| 10451 |
|
xxxxabcd\P\P |
| 10452 |
|
Partial match: abcd |
| 10453 |
|
|
| 10454 |
|
/abcd*/i |
| 10455 |
|
xxxxabcd\P |
| 10456 |
|
0: abcd |
| 10457 |
|
xxxxabcd\P\P |
| 10458 |
|
Partial match: abcd |
| 10459 |
|
XXXXABCD\P |
| 10460 |
|
0: ABCD |
| 10461 |
|
XXXXABCD\P\P |
| 10462 |
|
Partial match: ABCD |
| 10463 |
|
|
| 10464 |
|
/abc\d*/ |
| 10465 |
|
xxxxabc1\P |
| 10466 |
|
0: abc1 |
| 10467 |
|
xxxxabc1\P\P |
| 10468 |
|
Partial match: abc1 |
| 10469 |
|
|
| 10470 |
|
/(a)bc\1*/ |
| 10471 |
|
xxxxabca\P |
| 10472 |
|
0: abca |
| 10473 |
|
1: a |
| 10474 |
|
xxxxabca\P\P |
| 10475 |
|
Partial match: abca |
| 10476 |
|
|
| 10477 |
|
/abc[de]*/ |
| 10478 |
|
xxxxabcde\P |
| 10479 |
|
0: abcde |
| 10480 |
|
xxxxabcde\P\P |
| 10481 |
|
Partial match: abcde |
| 10482 |
|
|
| 10483 |
|
/-- This is not in the Perl >= 5.10 test because Perl seems currently to be |
| 10484 |
|
broken and not behaving as specified in that it *does* bumpalong after |
| 10485 |
|
hitting (*COMMIT). --/ |
| 10486 |
|
|
| 10487 |
|
/(?1)(A(*COMMIT)|B)D/ |
| 10488 |
|
ABD |
| 10489 |
|
0: ABD |
| 10490 |
|
1: B |
| 10491 |
|
XABD |
| 10492 |
|
0: ABD |
| 10493 |
|
1: B |
| 10494 |
|
BAD |
| 10495 |
|
0: BAD |
| 10496 |
|
1: A |
| 10497 |
|
ABXABD |
| 10498 |
|
0: ABD |
| 10499 |
|
1: B |
| 10500 |
|
** Failers |
| 10501 |
|
No match |
| 10502 |
|
ABX |
| 10503 |
|
No match |
| 10504 |
|
BAXBAD |
| 10505 |
|
No match |
| 10506 |
|
|
| 10507 |
|
/(\3)(\1)(a)/<JS> |
| 10508 |
|
cat |
| 10509 |
|
0: a |
| 10510 |
|
1: |
| 10511 |
|
2: |
| 10512 |
|
3: a |
| 10513 |
|
|
| 10514 |
|
/(\3)(\1)(a)/SI<JS> |
| 10515 |
|
Capturing subpattern count = 3 |
| 10516 |
|
Max back reference = 3 |
| 10517 |
|
Options: |
| 10518 |
|
No first char |
| 10519 |
|
Need char = 'a' |
| 10520 |
|
Subject length lower bound = 1 |
| 10521 |
|
No set of starting bytes |
| 10522 |
|
cat |
| 10523 |
|
0: a |
| 10524 |
|
1: |
| 10525 |
|
2: |
| 10526 |
|
3: a |
| 10527 |
|
|
| 10528 |
|
/(\3)(\1)(a)/SI |
| 10529 |
|
Capturing subpattern count = 3 |
| 10530 |
|
Max back reference = 3 |
| 10531 |
|
No options |
| 10532 |
|
No first char |
| 10533 |
|
Need char = 'a' |
| 10534 |
|
Subject length lower bound = 3 |
| 10535 |
|
No set of starting bytes |
| 10536 |
|
cat |
| 10537 |
|
No match |
| 10538 |
|
|
| 10539 |
|
/i(?(DEFINE)(?<s>a))/SI |
| 10540 |
|
Capturing subpattern count = 1 |
| 10541 |
|
Named capturing subpatterns: |
| 10542 |
|
s 1 |
| 10543 |
|
No options |
| 10544 |
|
First char = 'i' |
| 10545 |
|
No need char |
| 10546 |
|
Subject length lower bound = 1 |
| 10547 |
|
No set of starting bytes |
| 10548 |
|
i |
| 10549 |
|
0: i |
| 10550 |
|
|
| 10551 |
|
/()i(?(1)a)/SI |
| 10552 |
|
Capturing subpattern count = 1 |
| 10553 |
|
No options |
| 10554 |
|
No first char |
| 10555 |
|
Need char = 'i' |
| 10556 |
|
Subject length lower bound = 1 |
| 10557 |
|
Starting byte set: i |
| 10558 |
|
ia |
| 10559 |
|
0: ia |
| 10560 |
|
1: |
| 10561 |
|
|
| 10562 |
|
/(?i)a(?-i)b|c/BZ |
| 10563 |
|
------------------------------------------------------------------ |
| 10564 |
|
Bra |
| 10565 |
|
NC a |
| 10566 |
|
00 Opt |
| 10567 |
|
b |
| 10568 |
|
Alt |
| 10569 |
|
00 Opt |
| 10570 |
|
c |
| 10571 |
|
Ket |
| 10572 |
|
End |
| 10573 |
|
------------------------------------------------------------------ |
| 10574 |
|
XabX |
| 10575 |
|
0: ab |
| 10576 |
|
XAbX |
| 10577 |
|
0: Ab |
| 10578 |
|
CcC |
| 10579 |
|
0: c |
| 10580 |
|
** Failers |
| 10581 |
|
No match |
| 10582 |
|
XABX |
| 10583 |
|
No match |
| 10584 |
|
|
| 10585 |
|
/(?i)a(?s)b|c/BZ |
| 10586 |
|
------------------------------------------------------------------ |
| 10587 |
|
Bra |
| 10588 |
|
NC a |
| 10589 |
|
05 Opt |
| 10590 |
|
NC b |
| 10591 |
|
Alt |
| 10592 |
|
05 Opt |
| 10593 |
|
NC c |
| 10594 |
|
Ket |
| 10595 |
|
End |
| 10596 |
|
------------------------------------------------------------------ |
| 10597 |
|
|
| 10598 |
|
/(?i)a(?s-i)b|c/BZ |
| 10599 |
|
------------------------------------------------------------------ |
| 10600 |
|
Bra |
| 10601 |
|
NC a |
| 10602 |
|
04 Opt |
| 10603 |
|
b |
| 10604 |
|
Alt |
| 10605 |
|
04 Opt |
| 10606 |
|
c |
| 10607 |
|
Ket |
| 10608 |
|
End |
| 10609 |
|
------------------------------------------------------------------ |
| 10610 |
|
|
| 10611 |
|
/^(ab(c\1)d|x){2}$/BZ |
| 10612 |
|
------------------------------------------------------------------ |
| 10613 |
|
Bra |
| 10614 |
|
^ |
| 10615 |
|
Once |
| 10616 |
|
CBra 1 |
| 10617 |
|
ab |
| 10618 |
|
CBra 2 |
| 10619 |
|
c |
| 10620 |
|
\1 |
| 10621 |
|
Ket |
| 10622 |
|
d |
| 10623 |
|
Alt |
| 10624 |
|
x |
| 10625 |
|
Ket |
| 10626 |
|
Ket |
| 10627 |
|
Once |
| 10628 |
|
CBra 1 |
| 10629 |
|
ab |
| 10630 |
|
CBra 2 |
| 10631 |
|
c |
| 10632 |
|
\1 |
| 10633 |
|
Ket |
| 10634 |
|
d |
| 10635 |
|
Alt |
| 10636 |
|
x |
| 10637 |
|
Ket |
| 10638 |
|
Ket |
| 10639 |
|
$ |
| 10640 |
|
Ket |
| 10641 |
|
End |
| 10642 |
|
------------------------------------------------------------------ |
| 10643 |
|
xabcxd |
| 10644 |
|
0: xabcxd |
| 10645 |
|
1: abcxd |
| 10646 |
|
2: cx |
| 10647 |
|
|
| 10648 |
|
/^(?&t)*+(?(DEFINE)(?<t>.))$/BZ |
| 10649 |
|
------------------------------------------------------------------ |
| 10650 |
|
Bra |
| 10651 |
|
^ |
| 10652 |
|
Once |
| 10653 |
|
Brazero |
| 10654 |
|
Once |
| 10655 |
|
Recurse |
| 10656 |
|
KetRmax |
| 10657 |
|
Ket |
| 10658 |
|
Cond |
| 10659 |
|
Cond def |
| 10660 |
|
CBra 1 |
| 10661 |
|
Any |
| 10662 |
|
Ket |
| 10663 |
|
Ket |
| 10664 |
|
$ |
| 10665 |
|
Ket |
| 10666 |
|
End |
| 10667 |
|
------------------------------------------------------------------ |
| 10668 |
|
|
| 10669 |
|
/^(?&t)*(?(DEFINE)(?<t>.))$/BZ |
| 10670 |
|
------------------------------------------------------------------ |
| 10671 |
|
Bra |
| 10672 |
|
^ |
| 10673 |
|
Brazero |
| 10674 |
|
Once |
| 10675 |
|
Recurse |
| 10676 |
|
KetRmax |
| 10677 |
|
Cond |
| 10678 |
|
Cond def |
| 10679 |
|
CBra 1 |
| 10680 |
|
Any |
| 10681 |
|
Ket |
| 10682 |
|
Ket |
| 10683 |
|
$ |
| 10684 |
|
Ket |
| 10685 |
|
End |
| 10686 |
|
------------------------------------------------------------------ |
| 10687 |
|
|
| 10688 |
|
/ -- The first four of these are not in the Perl >= 5.10 test because Perl |
| 10689 |
|
documents that the use of \K in assertions is "not well defined". The |
| 10690 |
|
last is here because Perl gives the match as "b" rather than "ab". I |
| 10691 |
|
believe this to be a Perl bug. --/ |
| 10692 |
|
|
| 10693 |
|
/(?=a\Kb)ab/ |
| 10694 |
|
ab |
| 10695 |
|
0: b |
| 10696 |
|
|
| 10697 |
|
/(?!a\Kb)ac/ |
| 10698 |
|
ac |
| 10699 |
|
0: ac |
| 10700 |
|
|
| 10701 |
|
/^abc(?<=b\Kc)d/ |
| 10702 |
|
abcd |
| 10703 |
|
0: cd |
| 10704 |
|
|
| 10705 |
|
/^abc(?<!b\Kq)d/ |
| 10706 |
|
abcd |
| 10707 |
|
0: abcd |
| 10708 |
|
|
| 10709 |
|
/(?>a\Kb)z|(ab)/ |
| 10710 |
|
ab |
| 10711 |
|
0: ab |
| 10712 |
|
1: ab |
| 10713 |
|
|
| 10714 |
|
/----------------------/ |
| 10715 |
|
|
| 10716 |
|
/(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/ |
| 10717 |
|
Failed: recursive call could loop indefinitely at offset 31 |
| 10718 |
|
|
| 10719 |
|
/abc(*MARK:)pqr/ |
| 10720 |
|
Failed: (*MARK) must have an argument at offset 10 |
| 10721 |
|
|
| 10722 |
|
/abc(*:)pqr/ |
| 10723 |
|
Failed: (*MARK) must have an argument at offset 6 |
| 10724 |
|
|
| 10725 |
|
/abc(*FAIL:123)xyz/ |
| 10726 |
|
Failed: an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT) at offset 13 |
| 10727 |
|
|
| 10728 |
|
/--- This should, and does, fail. In Perl, it does not, which I think is a |
| 10729 |
|
bug because replacing the B in the pattern by (B|D) does make it fail. ---/ |
| 10730 |
|
|
| 10731 |
|
/A(*COMMIT)B/+K |
| 10732 |
|
ACABX |
| 10733 |
|
No match |
| 10734 |
|
|
| 10735 |
|
/--- These should be different, but in Perl 5.11 are not, which I think |
| 10736 |
|
is a bug in Perl. ---/ |
| 10737 |
|
|
| 10738 |
|
/A(*THEN)B|A(*THEN)C/K |
| 10739 |
|
AC |
| 10740 |
|
0: AC |
| 10741 |
|
|
| 10742 |
|
/A(*PRUNE)B|A(*PRUNE)C/K |
| 10743 |
|
AC |
| 10744 |
|
No match |
| 10745 |
|
|
| 10746 |
|
/--- A whole lot of tests of verbs with arguments are here rather than in test |
| 10747 |
|
11 because Perl doesn't seem to follow its specification entirely |
| 10748 |
|
correctly. ---/ |
| 10749 |
|
|
| 10750 |
|
/--- Perl 5.11 sets $REGERROR on the AC failure case here; PCRE does not. It is |
| 10751 |
|
not clear how Perl defines "involved in the failure of the match". ---/ |
| 10752 |
|
|
| 10753 |
|
/^(A(*THEN:A)B|C(*THEN:B)D)/K |
| 10754 |
|
AB |
| 10755 |
|
0: AB |
| 10756 |
|
1: AB |
| 10757 |
|
CD |
| 10758 |
|
0: CD |
| 10759 |
|
1: CD |
| 10760 |
|
** Failers |
| 10761 |
|
No match |
| 10762 |
|
AC |
| 10763 |
|
No match |
| 10764 |
|
CB |
| 10765 |
|
No match, mark = B |
| 10766 |
|
|
| 10767 |
|
/--- Check the use of names for success and failure. PCRE doesn't show these |
| 10768 |
|
names for success, though Perl does, contrary to its spec. ---/ |
| 10769 |
|
|
| 10770 |
|
/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K |
| 10771 |
|
AB |
| 10772 |
|
0: AB |
| 10773 |
|
1: AB |
| 10774 |
|
CD |
| 10775 |
|
0: CD |
| 10776 |
|
1: CD |
| 10777 |
|
** Failers |
| 10778 |
|
No match |
| 10779 |
|
AC |
| 10780 |
|
No match, mark = A |
| 10781 |
|
CB |
| 10782 |
|
No match, mark = B |
| 10783 |
|
|
| 10784 |
|
/--- An empty name does not pass back an empty string. It is the same as if no |
| 10785 |
|
name were given. ---/ |
| 10786 |
|
|
| 10787 |
|
/^(A(*PRUNE:)B|C(*PRUNE:B)D)/K |
| 10788 |
|
AB |
| 10789 |
|
0: AB |
| 10790 |
|
1: AB |
| 10791 |
|
CD |
| 10792 |
|
0: CD |
| 10793 |
|
1: CD |
| 10794 |
|
|
| 10795 |
|
/--- PRUNE goes to next bumpalong; COMMIT does not. ---/ |
| 10796 |
|
|
| 10797 |
|
/A(*PRUNE:A)B/K |
| 10798 |
|
ACAB |
| 10799 |
|
0: AB |
| 10800 |
|
|
| 10801 |
|
/(*MARK:A)(*PRUNE:B)(C|X)/K |
| 10802 |
|
C |
| 10803 |
|
0: C |
| 10804 |
|
1: C |
| 10805 |
|
MK: A |
| 10806 |
|
D |
| 10807 |
|
No match, mark = B |
| 10808 |
|
|
| 10809 |
|
/(*MARK:A)(*THEN:B)(C|X)/K |
| 10810 |
|
C |
| 10811 |
|
0: C |
| 10812 |
|
1: C |
| 10813 |
|
MK: A |
| 10814 |
|
D |
| 10815 |
|
No match, mark = B |
| 10816 |
|
|
| 10817 |
|
/--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/ |
| 10818 |
|
|
| 10819 |
|
/A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK |
| 10820 |
|
AAAC |
| 10821 |
|
No match |
| 10822 |
|
|
| 10823 |
|
/--- Same --/ |
| 10824 |
|
|
| 10825 |
|
/A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK |
| 10826 |
|
AAAC |
| 10827 |
|
No match |
| 10828 |
|
|
| 10829 |
|
/--- This should fail; the SKIP advances by one, but when we get to AC, the |
| 10830 |
|
PRUNE kills it. ---/ |
| 10831 |
|
|
| 10832 |
|
/A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK |
| 10833 |
|
AAAC |
| 10834 |
|
No match |
| 10835 |
|
|
| 10836 |
|
/A(*:A)A+(*SKIP)(B|Z) | AC/xK |
| 10837 |
|
AAAC |
| 10838 |
|
No match |
| 10839 |
|
|
| 10840 |
|
/--- This should fail, as a null name is the same as no name ---/ |
| 10841 |
|
|
| 10842 |
|
/A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK |
| 10843 |
|
AAAC |
| 10844 |
|
No match |
| 10845 |
|
|
| 10846 |
|
/--- This fails in PCRE, and I think that is in accordance with Perl's |
| 10847 |
|
documentation, though in Perl it succeeds. ---/ |
| 10848 |
|
|
| 10849 |
|
/A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK |
| 10850 |
|
AAAC |
| 10851 |
|
No match |
| 10852 |
|
|
| 10853 |
|
/--- Mark names can be duplicated ---/ |
| 10854 |
|
|
| 10855 |
|
/A(*:A)B|X(*:A)Y/K |
| 10856 |
|
AABC |
| 10857 |
|
0: AB |
| 10858 |
|
MK: A |
| 10859 |
|
XXYZ |
| 10860 |
|
0: XY |
| 10861 |
|
MK: A |
| 10862 |
|
|
| 10863 |
|
/^A(*:A)B|^X(*:A)Y/K |
| 10864 |
|
** Failers |
| 10865 |
|
No match |
| 10866 |
|
XAQQ |
| 10867 |
|
No match, mark = A |
| 10868 |
|
|
| 10869 |
|
/--- A check on what happens after hitting a mark and them bumping along to |
| 10870 |
|
something that does not even start. Perl reports tags after the failures here, |
| 10871 |
|
though it does not when the individual letters are made into something |
| 10872 |
|
more complicated. ---/ |
| 10873 |
|
|
| 10874 |
|
/A(*:A)B|XX(*:B)Y/K |
| 10875 |
|
AABC |
| 10876 |
|
0: AB |
| 10877 |
|
MK: A |
| 10878 |
|
XXYZ |
| 10879 |
|
0: XXY |
| 10880 |
|
MK: B |
| 10881 |
|
** Failers |
| 10882 |
|
No match |
| 10883 |
|
XAQQ |
| 10884 |
|
No match |
| 10885 |
|
XAQQXZZ |
| 10886 |
|
No match |
| 10887 |
|
AXQQQ |
| 10888 |
|
No match |
| 10889 |
|
AXXQQQ |
| 10890 |
|
No match |
| 10891 |
|
|
| 10892 |
|
/--- COMMIT at the start of a pattern should be the same as an anchor. Perl |
| 10893 |
|
optimizations defeat this. So does the PCRE optimization unless we disable it |
| 10894 |
|
with \Y. ---/ |
| 10895 |
|
|
| 10896 |
|
/(*COMMIT)ABC/ |
| 10897 |
|
ABCDEFG |
| 10898 |
|
0: ABC |
| 10899 |
|
** Failers |
| 10900 |
|
No match |
| 10901 |
|
DEFGABC\Y |
| 10902 |
|
No match |
| 10903 |
|
|
| 10904 |
|
/--- Repeat some tests with added studying. ---/ |
| 10905 |
|
|
| 10906 |
|
/A(*COMMIT)B/+KS |
| 10907 |
|
ACABX |
| 10908 |
|
No match |
| 10909 |
|
|
| 10910 |
|
/A(*THEN)B|A(*THEN)C/KS |
| 10911 |
|
AC |
| 10912 |
|
0: AC |
| 10913 |
|
|
| 10914 |
|
/A(*PRUNE)B|A(*PRUNE)C/KS |
| 10915 |
|
AC |
| 10916 |
|
No match |
| 10917 |
|
|
| 10918 |
|
/^(A(*THEN:A)B|C(*THEN:B)D)/KS |
| 10919 |
|
AB |
| 10920 |
|
0: AB |
| 10921 |
|
1: AB |
| 10922 |
|
CD |
| 10923 |
|
0: CD |
| 10924 |
|
1: CD |
| 10925 |
|
** Failers |
| 10926 |
|
No match |
| 10927 |
|
AC |
| 10928 |
|
No match |
| 10929 |
|
CB |
| 10930 |
|
No match, mark = B |
| 10931 |
|
|
| 10932 |
|
/^(A(*PRUNE:A)B|C(*PRUNE:B)D)/KS |
| 10933 |
|
AB |
| 10934 |
|
0: AB |
| 10935 |
|
1: AB |
| 10936 |
|
CD |
| 10937 |
|
0: CD |
| 10938 |
|
1: CD |
| 10939 |
|
** Failers |
| 10940 |
|
No match |
| 10941 |
|
AC |
| 10942 |
|
No match, mark = A |
| 10943 |
|
CB |
| 10944 |
|
No match, mark = B |
| 10945 |
|
|
| 10946 |
|
/^(A(*PRUNE:)B|C(*PRUNE:B)D)/KS |
| 10947 |
|
AB |
| 10948 |
|
0: AB |
| 10949 |
|
1: AB |
| 10950 |
|
CD |
| 10951 |
|
0: CD |
| 10952 |
|
1: CD |
| 10953 |
|
|
| 10954 |
|
/A(*PRUNE:A)B/KS |
| 10955 |
|
ACAB |
| 10956 |
|
0: AB |
| 10957 |
|
|
| 10958 |
|
/(*MARK:A)(*PRUNE:B)(C|X)/KS |
| 10959 |
|
C |
| 10960 |
|
0: C |
| 10961 |
|
1: C |
| 10962 |
|
MK: A |
| 10963 |
|
D |
| 10964 |
|
No match |
| 10965 |
|
|
| 10966 |
|
/(*MARK:A)(*THEN:B)(C|X)/KS |
| 10967 |
|
C |
| 10968 |
|
0: C |
| 10969 |
|
1: C |
| 10970 |
|
MK: A |
| 10971 |
|
D |
| 10972 |
|
No match |
| 10973 |
|
|
| 10974 |
|
/A(*MARK:A)A+(*SKIP)(B|Z) | AC/xKS |
| 10975 |
|
AAAC |
| 10976 |
|
No match |
| 10977 |
|
|
| 10978 |
|
/A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xKS |
| 10979 |
|
AAAC |
| 10980 |
|
No match |
| 10981 |
|
|
| 10982 |
|
/A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xKS |
| 10983 |
|
AAAC |
| 10984 |
|
No match |
| 10985 |
|
|
| 10986 |
|
/A(*:A)A+(*SKIP)(B|Z) | AC/xKS |
| 10987 |
|
AAAC |
| 10988 |
|
No match |
| 10989 |
|
|
| 10990 |
|
/A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xKS |
| 10991 |
|
AAAC |
| 10992 |
|
No match |
| 10993 |
|
|
| 10994 |
|
/A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xKS |
| 10995 |
|
AAAC |
| 10996 |
|
No match |
| 10997 |
|
|
| 10998 |
|
/A(*:A)B|XX(*:B)Y/KS |
| 10999 |
|
AABC |
| 11000 |
|
0: AB |
| 11001 |
|
MK: A |
| 11002 |
|
XXYZ |
| 11003 |
|
0: XXY |
| 11004 |
|
MK: B |
| 11005 |
|
** Failers |
| 11006 |
|
No match |
| 11007 |
|
XAQQ |
| 11008 |
|
No match |
| 11009 |
|
XAQQXZZ |
| 11010 |
|
No match |
| 11011 |
|
AXQQQ |
| 11012 |
|
No match |
| 11013 |
|
AXXQQQ |
| 11014 |
|
No match |
| 11015 |
|
|
| 11016 |
|
/(*COMMIT)ABC/ |
| 11017 |
|
ABCDEFG |
| 11018 |
|
0: ABC |
| 11019 |
|
** Failers |
| 11020 |
|
No match |
| 11021 |
|
DEFGABC\Y |
| 11022 |
|
No match |
| 11023 |
|
|
| 11024 |
|
/^(ab (c+(*THEN)cd) | xyz)/x |
| 11025 |
|
abcccd |
| 11026 |
|
No match |
| 11027 |
|
|
| 11028 |
|
/^(ab (c+(*PRUNE)cd) | xyz)/x |
| 11029 |
|
abcccd |
| 11030 |
|
No match |
| 11031 |
|
|
| 11032 |
|
/^(ab (c+(*FAIL)cd) | xyz)/x |
| 11033 |
|
abcccd |
| 11034 |
|
No match |
| 11035 |
|
|
| 11036 |
|
/--- Perl 5.11 gets some of these wrong ---/ |
| 11037 |
|
|
| 11038 |
|
/(?>.(*ACCEPT))*?5/ |
| 11039 |
|
abcde |
| 11040 |
|
0: a |
| 11041 |
|
|
| 11042 |
|
/(.(*ACCEPT))*?5/ |
| 11043 |
|
abcde |
| 11044 |
|
0: a |
| 11045 |
|
1: a |
| 11046 |
|
|
| 11047 |
|
/(.(*ACCEPT))5/ |
| 11048 |
|
abcde |
| 11049 |
|
0: a |
| 11050 |
|
1: a |
| 11051 |
|
|
| 11052 |
|
/(.(*ACCEPT))*5/ |
| 11053 |
|
abcde |
| 11054 |
|
0: a |
| 11055 |
|
1: a |
| 11056 |
|
|
| 11057 |
|
/A\NB./BZ |
| 11058 |
|
------------------------------------------------------------------ |
| 11059 |
|
Bra |
| 11060 |
|
A |
| 11061 |
|
Any |
| 11062 |
|
B |
| 11063 |
|
Any |
| 11064 |
|
Ket |
| 11065 |
|
End |
| 11066 |
|
------------------------------------------------------------------ |
| 11067 |
|
ACBD |
| 11068 |
|
0: ACBD |
| 11069 |
|
*** Failers |
| 11070 |
|
No match |
| 11071 |
|
A\nB |
| 11072 |
|
No match |
| 11073 |
|
ACB\n |
| 11074 |
|
No match |
| 11075 |
|
|
| 11076 |
|
/A\NB./sBZ |
| 11077 |
|
------------------------------------------------------------------ |
| 11078 |
|
Bra |
| 11079 |
|
A |
| 11080 |
|
Any |
| 11081 |
|
B |
| 11082 |
|
AllAny |
| 11083 |
|
Ket |
| 11084 |
|
End |
| 11085 |
|
------------------------------------------------------------------ |
| 11086 |
|
ACBD |
| 11087 |
|
0: ACBD |
| 11088 |
|
ACB\n |
| 11089 |
|
0: ACB\x0a |
| 11090 |
|
*** Failers |
| 11091 |
|
No match |
| 11092 |
|
A\nB |
| 11093 |
|
No match |
| 11094 |
|
|
| 11095 |
|
/A\NB/<crlf> |
| 11096 |
|
A\nB |
| 11097 |
|
0: A\x0aB |
| 11098 |
|
A\rB |
| 11099 |
|
0: A\x0dB |
| 11100 |
|
** Failers |
| 11101 |
|
No match |
| 11102 |
|
A\r\nB |
| 11103 |
|
No match |
| 11104 |
|
|
| 11105 |
|
/\R+b/BZ |
| 11106 |
|
------------------------------------------------------------------ |
| 11107 |
|
Bra |
| 11108 |
|
\R++ |
| 11109 |
|
b |
| 11110 |
|
Ket |
| 11111 |
|
End |
| 11112 |
|
------------------------------------------------------------------ |
| 11113 |
|
|
| 11114 |
|
/\R+\n/BZ |
| 11115 |
|
------------------------------------------------------------------ |
| 11116 |
|
Bra |
| 11117 |
|
\R+ |
| 11118 |
|
\x0a |
| 11119 |
|
Ket |
| 11120 |
|
End |
| 11121 |
|
------------------------------------------------------------------ |
| 11122 |
|
|
| 11123 |
|
/\R+\d/BZ |
| 11124 |
|
------------------------------------------------------------------ |
| 11125 |
|
Bra |
| 11126 |
|
\R++ |
| 11127 |
|
\d |
| 11128 |
|
Ket |
| 11129 |
|
End |
| 11130 |
|
------------------------------------------------------------------ |
| 11131 |
|
|
| 11132 |
|
/\d*\R/BZ |
| 11133 |
|
------------------------------------------------------------------ |
| 11134 |
|
Bra |
| 11135 |
|
\d*+ |
| 11136 |
|
\R |
| 11137 |
|
Ket |
| 11138 |
|
End |
| 11139 |
|
------------------------------------------------------------------ |
| 11140 |
|
|
| 11141 |
|
/\s*\R/BZ |
| 11142 |
|
------------------------------------------------------------------ |
| 11143 |
|
Bra |
| 11144 |
|
\s*+ |
| 11145 |
|
\R |
| 11146 |
|
Ket |
| 11147 |
|
End |
| 11148 |
|
------------------------------------------------------------------ |
| 11149 |
|
|
| 11150 |
|
/-- Perl treats this one differently, not failing the second string. I believe |
| 11151 |
|
that is a bug in Perl. --/ |
| 11152 |
|
|
| 11153 |
|
/^((abc|abcx)(*THEN)y|abcd)/ |
| 11154 |
|
abcd |
| 11155 |
|
0: abcd |
| 11156 |
|
1: abcd |
| 11157 |
|
*** Failers |
| 11158 |
|
No match |
| 11159 |
|
abcxy |
| 11160 |
|
No match |
| 11161 |
|
|
| 11162 |
|
/(?<=abc)def/ |
| 11163 |
|
abc\P\P |
| 11164 |
|
Partial match: abc |
| 11165 |
|
|
| 11166 |
|
/abc$/ |
| 11167 |
|
abc |
| 11168 |
|
0: abc |
| 11169 |
|
abc\P |
| 11170 |
|
0: abc |
| 11171 |
|
abc\P\P |
| 11172 |
|
Partial match: abc |
| 11173 |
|
|
| 11174 |
|
/abc$/m |
| 11175 |
|
abc |
| 11176 |
|
0: abc |
| 11177 |
|
abc\n |
| 11178 |
|
0: abc |
| 11179 |
|
abc\P\P |
| 11180 |
|
Partial match: abc |
| 11181 |
|
abc\n\P\P |
| 11182 |
|
0: abc |
| 11183 |
|
abc\P |
| 11184 |
|
0: abc |
| 11185 |
|
abc\n\P |
| 11186 |
|
0: abc |
| 11187 |
|
|
| 11188 |
|
/abc\z/ |
| 11189 |
|
abc |
| 11190 |
|
0: abc |
| 11191 |
|
abc\P |
| 11192 |
|
0: abc |
| 11193 |
|
abc\P\P |
| 11194 |
|
Partial match: abc |
| 11195 |
|
|
| 11196 |
|
/abc\Z/ |
| 11197 |
|
abc |
| 11198 |
|
0: abc |
| 11199 |
|
abc\P |
| 11200 |
|
0: abc |
| 11201 |
|
abc\P\P |
| 11202 |
|
Partial match: abc |
| 11203 |
|
|
| 11204 |
|
/abc\b/ |
| 11205 |
|
abc |
| 11206 |
|
0: abc |
| 11207 |
|
abc\P |
| 11208 |
|
0: abc |
| 11209 |
|
abc\P\P |
| 11210 |
|
Partial match: abc |
| 11211 |
|
|
| 11212 |
|
/abc\B/ |
| 11213 |
|
abc |
| 11214 |
|
No match |
| 11215 |
|
abc\P |
| 11216 |
|
Partial match: abc |
| 11217 |
|
abc\P\P |
| 11218 |
|
Partial match: abc |
| 11219 |
|
|
| 11220 |
|
/.+/ |
| 11221 |
|
abc\>0 |
| 11222 |
|
0: abc |
| 11223 |
|
abc\>1 |
| 11224 |
|
0: bc |
| 11225 |
|
abc\>2 |
| 11226 |
|
0: c |
| 11227 |
|
abc\>3 |
| 11228 |
|
No match |
| 11229 |
|
abc\>4 |
| 11230 |
|
Error -24 |
| 11231 |
|
abc\>-4 |
| 11232 |
|
Error -24 |
| 11233 |
|
|
| 11234 |
|
/^\cģ/ |
| 11235 |
|
Failed: \c must be followed by an ASCII character at offset 3 |
| 11236 |
|
|
| 11237 |
/-- End of testinput2 --/ |
/-- End of testinput2 --/ |