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

Diff of /code/trunk/testdata/testoutput2

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 457 by ph10, Sat Oct 3 16:24:08 2009 UTC revision 598 by ph10, Sat May 7 15:37:31 2011 UTC
# Line 2  Line 2 
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
# Line 103  Failed: missing terminating ] for charac Line 103  Failed: missing terminating ] for charac
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    
# Line 857  No match Line 887  No match
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'
# Line 869  Max back reference = 1 Line 899  Max back reference = 1
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
# Line 3173  Failed: POSIX collating elements are not Line 3228  Failed: POSIX collating elements are not
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
# Line 7469  No match Line 7524  No match
7524          ^          ^
7525          CBra 1          CBra 1
7526          Cond          Cond
7527        2 Cond ref        2 Cond nref
7528          y          y
7529          Ket          Ket
7530          [()]          [()]
# Line 8642  No match Line 8697  No match
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
# Line 8735  No match Line 8787  No match
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
# Line 9221  No match Line 9294  No match
9294   +0        ^     x   +0        ^     x
9295   +0         ^    x   +0         ^    x
9296  No match  No match
9297    
9298    /(*NO_START_OPT)xyz/C
9299      abcxyz
9300    --->abcxyz
9301    +15 ^          x
9302    +15  ^         x
9303    +15   ^        x
9304    +15    ^       x
9305    +16    ^^      y
9306    +17    ^ ^     z
9307    +18    ^  ^
9308     0: xyz
9309    
9310    /xyz/CY
9311      abcxyz
9312    --->abcxyz
9313     +0 ^          x
9314     +0  ^         x
9315     +0   ^        x
9316     +0    ^       x
9317     +1    ^^      y
9318     +2    ^ ^     z
9319     +3    ^  ^
9320     0: xyz
9321    
9322  /^"((?(?=[a])[^"])|b)*"$/C  /^"((?(?=[a])[^"])|b)*"$/C
9323      "ab"      "ab"
# Line 10240  No need char Line 10337  No need char
10337  /(?|(?<a>A)|(?<b>B))/  /(?|(?<a>A)|(?<b>B))/
10338  Failed: different names for subpatterns of the same number are not allowed at offset 15  Failed: different names for subpatterns of the same number are not allowed at offset 15
10339    
10340    /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |
10341        b(?<quote> (?<apostrophe>')|(?<realquote>")) )
10342        (?('quote')[a-z]+|[0-9]+)/JIx
10343    Capturing subpattern count = 6
10344    Named capturing subpatterns:
10345      apostrophe   2
10346      apostrophe   5
10347      quote        1
10348      quote        4
10349      realquote    3
10350      realquote    6
10351    Options: extended dupnames
10352    No first char
10353    No need char
10354        a"aaaaa
10355     0: a"aaaaa
10356     1: "
10357     2: <unset>
10358     3: "
10359        b"aaaaa
10360     0: b"aaaaa
10361     1: <unset>
10362     2: <unset>
10363     3: <unset>
10364     4: "
10365     5: <unset>
10366     6: "
10367        ** Failers
10368    No match
10369        b"11111
10370    No match
10371        a"11111
10372    No match
10373    
10374    /^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/JDZx
10375    ------------------------------------------------------------------
10376            Bra
10377            ^
10378            Bra
10379            CBra 1
10380            a
10381            Ket
10382            CBra 2
10383            b
10384            Ket
10385            CBra 3
10386            c
10387            Ket
10388            CBra 4
10389            d
10390            Ket
10391            Alt
10392            CBra 1
10393            e
10394            Ket
10395            Ket
10396            Cond
10397          4 Cond nref
10398            X
10399            Alt
10400            Y
10401            Ket
10402            Ket
10403            End
10404    ------------------------------------------------------------------
10405    Capturing subpattern count = 4
10406    Named capturing subpatterns:
10407      D   4
10408      D   1
10409    Options: anchored extended dupnames
10410    No first char
10411    No need char
10412        abcdX
10413     0: abcdX
10414     1: a
10415     2: b
10416     3: c
10417     4: d
10418        eX
10419     0: eX
10420     1: e
10421        ** Failers
10422    No match
10423        abcdY
10424    No match
10425        ey
10426    No match
10427    
10428    /(?<A>a) (b)(c)  (?<A>d  (?(R&A)$ | (?4)) )/JDZx
10429    ------------------------------------------------------------------
10430            Bra
10431            CBra 1
10432            a
10433            Ket
10434            CBra 2
10435            b
10436            Ket
10437            CBra 3
10438            c
10439            Ket
10440            CBra 4
10441            d
10442            Cond
10443            Cond nrecurse 1
10444            $
10445            Alt
10446            Once
10447            Recurse
10448            Ket
10449            Ket
10450            Ket
10451            Ket
10452            End
10453    ------------------------------------------------------------------
10454    Capturing subpattern count = 4
10455    Named capturing subpatterns:
10456      A   1
10457      A   4
10458    Options: extended dupnames
10459    First char = 'a'
10460    Need char = 'd'
10461        abcdd
10462     0: abcdd
10463     1: a
10464     2: b
10465     3: c
10466     4: dd
10467        ** Failers
10468    No match
10469        abcdde
10470    No match
10471    
10472    /abcd*/
10473        xxxxabcd\P
10474     0: abcd
10475        xxxxabcd\P\P
10476    Partial match: abcd
10477    
10478    /abcd*/i
10479        xxxxabcd\P
10480     0: abcd
10481        xxxxabcd\P\P
10482    Partial match: abcd
10483        XXXXABCD\P
10484     0: ABCD
10485        XXXXABCD\P\P
10486    Partial match: ABCD
10487    
10488    /abc\d*/
10489        xxxxabc1\P
10490     0: abc1
10491        xxxxabc1\P\P
10492    Partial match: abc1
10493    
10494    /(a)bc\1*/
10495        xxxxabca\P
10496     0: abca
10497     1: a
10498        xxxxabca\P\P
10499    Partial match: abca
10500    
10501    /abc[de]*/
10502        xxxxabcde\P
10503     0: abcde
10504        xxxxabcde\P\P
10505    Partial match: abcde
10506    
10507    /-- This is not in the Perl >= 5.10 test because Perl seems currently to be
10508        broken and not behaving as specified in that it *does* bumpalong after
10509        hitting (*COMMIT). --/
10510    
10511    /(?1)(A(*COMMIT)|B)D/
10512        ABD
10513     0: ABD
10514     1: B
10515        XABD
10516     0: ABD
10517     1: B
10518        BAD
10519     0: BAD
10520     1: A
10521        ABXABD
10522     0: ABD
10523     1: B
10524        ** Failers
10525    No match
10526        ABX
10527    No match
10528        BAXBAD
10529    No match
10530    
10531    /(\3)(\1)(a)/<JS>
10532        cat
10533     0: a
10534     1:
10535     2:
10536     3: a
10537    
10538    /(\3)(\1)(a)/SI<JS>
10539    Capturing subpattern count = 3
10540    Max back reference = 3
10541    Options:
10542    No first char
10543    Need char = 'a'
10544    Subject length lower bound = 1
10545    No set of starting bytes
10546        cat
10547     0: a
10548     1:
10549     2:
10550     3: a
10551    
10552    /(\3)(\1)(a)/SI
10553    Capturing subpattern count = 3
10554    Max back reference = 3
10555    No options
10556    No first char
10557    Need char = 'a'
10558    Subject length lower bound = 3
10559    No set of starting bytes
10560        cat
10561    No match
10562    
10563    /i(?(DEFINE)(?<s>a))/SI
10564    Capturing subpattern count = 1
10565    Named capturing subpatterns:
10566      s   1
10567    No options
10568    First char = 'i'
10569    No need char
10570    Subject length lower bound = 1
10571    No set of starting bytes
10572        i
10573     0: i
10574    
10575    /()i(?(1)a)/SI
10576    Capturing subpattern count = 1
10577    No options
10578    No first char
10579    Need char = 'i'
10580    Subject length lower bound = 1
10581    Starting byte set: i
10582        ia
10583     0: ia
10584     1:
10585    
10586    /(?i)a(?-i)b|c/BZ
10587    ------------------------------------------------------------------
10588            Bra
10589         NC a
10590         00 Opt
10591            b
10592            Alt
10593         00 Opt
10594            c
10595            Ket
10596            End
10597    ------------------------------------------------------------------
10598        XabX
10599     0: ab
10600        XAbX
10601     0: Ab
10602        CcC
10603     0: c
10604        ** Failers
10605    No match
10606        XABX
10607    No match
10608    
10609    /(?i)a(?s)b|c/BZ
10610    ------------------------------------------------------------------
10611            Bra
10612         NC a
10613         05 Opt
10614         NC b
10615            Alt
10616         05 Opt
10617         NC c
10618            Ket
10619            End
10620    ------------------------------------------------------------------
10621    
10622    /(?i)a(?s-i)b|c/BZ
10623    ------------------------------------------------------------------
10624            Bra
10625         NC a
10626         04 Opt
10627            b
10628            Alt
10629         04 Opt
10630            c
10631            Ket
10632            End
10633    ------------------------------------------------------------------
10634    
10635    /^(ab(c\1)d|x){2}$/BZ
10636    ------------------------------------------------------------------
10637            Bra
10638            ^
10639            Once
10640            CBra 1
10641            ab
10642            CBra 2
10643            c
10644            \1
10645            Ket
10646            d
10647            Alt
10648            x
10649            Ket
10650            Ket
10651            Once
10652            CBra 1
10653            ab
10654            CBra 2
10655            c
10656            \1
10657            Ket
10658            d
10659            Alt
10660            x
10661            Ket
10662            Ket
10663            $
10664            Ket
10665            End
10666    ------------------------------------------------------------------
10667        xabcxd
10668     0: xabcxd
10669     1: abcxd
10670     2: cx
10671    
10672    /^(?&t)*+(?(DEFINE)(?<t>.))$/BZ
10673    ------------------------------------------------------------------
10674            Bra
10675            ^
10676            Once
10677            Brazero
10678            Once
10679            Recurse
10680            KetRmax
10681            Ket
10682            Cond
10683            Cond def
10684            CBra 1
10685            Any
10686            Ket
10687            Ket
10688            $
10689            Ket
10690            End
10691    ------------------------------------------------------------------
10692    
10693    /^(?&t)*(?(DEFINE)(?<t>.))$/BZ
10694    ------------------------------------------------------------------
10695            Bra
10696            ^
10697            Brazero
10698            Once
10699            Recurse
10700            KetRmax
10701            Cond
10702            Cond def
10703            CBra 1
10704            Any
10705            Ket
10706            Ket
10707            $
10708            Ket
10709            End
10710    ------------------------------------------------------------------
10711    
10712    / -- The first four of these are not in the Perl >= 5.10 test because Perl
10713         documents that the use of \K in assertions is "not well defined". The
10714         last is here because Perl gives the match as "b" rather than "ab". I
10715         believe this to be a Perl bug. --/
10716    
10717    /(?=a\Kb)ab/
10718        ab
10719     0: b
10720    
10721    /(?!a\Kb)ac/
10722        ac
10723     0: ac
10724    
10725    /^abc(?<=b\Kc)d/
10726        abcd
10727     0: cd
10728    
10729    /^abc(?<!b\Kq)d/
10730        abcd
10731     0: abcd
10732    
10733    /(?>a\Kb)z|(ab)/
10734        ab
10735     0: ab
10736     1: ab
10737    
10738    /----------------------/
10739    
10740    /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
10741    Failed: recursive call could loop indefinitely at offset 31
10742    
10743    /abc(*MARK:)pqr/
10744    Failed: (*MARK) must have an argument at offset 10
10745    
10746    /abc(*:)pqr/
10747    Failed: (*MARK) must have an argument at offset 6
10748    
10749    /abc(*FAIL:123)xyz/
10750    Failed: an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT) at offset 13
10751    
10752    /--- This should, and does, fail. In Perl, it does not, which I think is a
10753         bug because replacing the B in the pattern by (B|D) does make it fail. ---/
10754    
10755    /A(*COMMIT)B/+K
10756        ACABX
10757    No match
10758    
10759    /--- These should be different, but in Perl 5.11 are not, which I think
10760         is a bug in Perl. ---/
10761    
10762    /A(*THEN)B|A(*THEN)C/K
10763        AC
10764     0: AC
10765    
10766    /A(*PRUNE)B|A(*PRUNE)C/K
10767        AC
10768    No match
10769    
10770    /--- A whole lot of tests of verbs with arguments are here rather than in test
10771         11 because Perl doesn't seem to follow its specification entirely
10772         correctly. ---/
10773    
10774    /--- Perl 5.11 sets $REGERROR on the AC failure case here; PCRE does not. It is
10775         not clear how Perl defines "involved in the failure of the match". ---/
10776    
10777    /^(A(*THEN:A)B|C(*THEN:B)D)/K
10778        AB
10779     0: AB
10780     1: AB
10781        CD
10782     0: CD
10783     1: CD
10784        ** Failers
10785    No match
10786        AC
10787    No match
10788        CB
10789    No match, mark = B
10790    
10791    /--- Check the use of names for success and failure. PCRE doesn't show these
10792    names for success, though Perl does, contrary to its spec. ---/
10793    
10794    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
10795        AB
10796     0: AB
10797     1: AB
10798        CD
10799     0: CD
10800     1: CD
10801        ** Failers
10802    No match
10803        AC
10804    No match, mark = A
10805        CB
10806    No match, mark = B
10807    
10808    /--- An empty name does not pass back an empty string. It is the same as if no
10809    name were given. ---/
10810    
10811    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/K
10812        AB
10813     0: AB
10814     1: AB
10815        CD
10816     0: CD
10817     1: CD
10818    
10819    /--- PRUNE goes to next bumpalong; COMMIT does not. ---/
10820    
10821    /A(*PRUNE:A)B/K
10822        ACAB
10823     0: AB
10824    
10825    /(*MARK:A)(*PRUNE:B)(C|X)/K
10826        C
10827     0: C
10828     1: C
10829    MK: A
10830        D
10831    No match, mark = B
10832    
10833    /(*MARK:A)(*THEN:B)(C|X)/K
10834        C
10835     0: C
10836     1: C
10837    MK: A
10838        D
10839    No match, mark = B
10840    
10841    /--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/
10842    
10843    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK
10844        AAAC
10845    No match
10846    
10847    /--- Same --/
10848    
10849    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK
10850        AAAC
10851    No match
10852    
10853    /--- This should fail; the SKIP advances by one, but when we get to AC, the
10854         PRUNE kills it. ---/
10855    
10856    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
10857        AAAC
10858    No match
10859    
10860    /A(*:A)A+(*SKIP)(B|Z) | AC/xK
10861        AAAC
10862    No match
10863    
10864    /--- This should fail, as a null name is the same as no name ---/
10865    
10866    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK
10867        AAAC
10868    No match
10869    
10870    /--- This fails in PCRE, and I think that is in accordance with Perl's
10871         documentation, though in Perl it succeeds. ---/
10872    
10873    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK
10874        AAAC
10875    No match
10876    
10877    /--- Mark names can be duplicated ---/
10878    
10879    /A(*:A)B|X(*:A)Y/K
10880        AABC
10881     0: AB
10882    MK: A
10883        XXYZ
10884     0: XY
10885    MK: A
10886    
10887    /^A(*:A)B|^X(*:A)Y/K
10888        ** Failers
10889    No match
10890        XAQQ
10891    No match, mark = A
10892    
10893    /--- A check on what happens after hitting a mark and them bumping along to
10894    something that does not even start. Perl reports tags after the failures here,
10895    though it does not when the individual letters are made into something
10896    more complicated. ---/
10897    
10898    /A(*:A)B|XX(*:B)Y/K
10899        AABC
10900     0: AB
10901    MK: A
10902        XXYZ
10903     0: XXY
10904    MK: B
10905        ** Failers
10906    No match
10907        XAQQ
10908    No match
10909        XAQQXZZ
10910    No match
10911        AXQQQ
10912    No match
10913        AXXQQQ
10914    No match
10915    
10916    /--- COMMIT at the start of a pattern should be the same as an anchor. Perl
10917    optimizations defeat this. So does the PCRE optimization unless we disable it
10918    with \Y. ---/
10919    
10920    /(*COMMIT)ABC/
10921        ABCDEFG
10922     0: ABC
10923        ** Failers
10924    No match
10925        DEFGABC\Y
10926    No match
10927    
10928    /--- Repeat some tests with added studying. ---/
10929    
10930    /A(*COMMIT)B/+KS
10931        ACABX
10932    No match
10933    
10934    /A(*THEN)B|A(*THEN)C/KS
10935        AC
10936     0: AC
10937    
10938    /A(*PRUNE)B|A(*PRUNE)C/KS
10939        AC
10940    No match
10941    
10942    /^(A(*THEN:A)B|C(*THEN:B)D)/KS
10943        AB
10944     0: AB
10945     1: AB
10946        CD
10947     0: CD
10948     1: CD
10949        ** Failers
10950    No match
10951        AC
10952    No match
10953        CB
10954    No match, mark = B
10955    
10956    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/KS
10957        AB
10958     0: AB
10959     1: AB
10960        CD
10961     0: CD
10962     1: CD
10963        ** Failers
10964    No match
10965        AC
10966    No match, mark = A
10967        CB
10968    No match, mark = B
10969    
10970    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/KS
10971        AB
10972     0: AB
10973     1: AB
10974        CD
10975     0: CD
10976     1: CD
10977    
10978    /A(*PRUNE:A)B/KS
10979        ACAB
10980     0: AB
10981    
10982    /(*MARK:A)(*PRUNE:B)(C|X)/KS
10983        C
10984     0: C
10985     1: C
10986    MK: A
10987        D
10988    No match
10989    
10990    /(*MARK:A)(*THEN:B)(C|X)/KS
10991        C
10992     0: C
10993     1: C
10994    MK: A
10995        D
10996    No match
10997    
10998    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xKS
10999        AAAC
11000    No match
11001    
11002    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xKS
11003        AAAC
11004    No match
11005    
11006    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xKS
11007        AAAC
11008    No match
11009    
11010    /A(*:A)A+(*SKIP)(B|Z) | AC/xKS
11011        AAAC
11012    No match
11013    
11014    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xKS
11015        AAAC
11016    No match
11017    
11018    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xKS
11019        AAAC
11020    No match
11021    
11022    /A(*:A)B|XX(*:B)Y/KS
11023        AABC
11024     0: AB
11025    MK: A
11026        XXYZ
11027     0: XXY
11028    MK: B
11029        ** Failers
11030    No match
11031        XAQQ
11032    No match
11033        XAQQXZZ
11034    No match
11035        AXQQQ
11036    No match
11037        AXXQQQ
11038    No match
11039    
11040    /(*COMMIT)ABC/
11041        ABCDEFG
11042     0: ABC
11043        ** Failers
11044    No match
11045        DEFGABC\Y
11046    No match
11047    
11048    /^(ab (c+(*THEN)cd) | xyz)/x
11049        abcccd
11050    No match
11051    
11052    /^(ab (c+(*PRUNE)cd) | xyz)/x
11053        abcccd
11054    No match
11055    
11056    /^(ab (c+(*FAIL)cd) | xyz)/x
11057        abcccd
11058    No match
11059    
11060    /--- Perl 5.11 gets some of these wrong ---/
11061    
11062    /(?>.(*ACCEPT))*?5/
11063        abcde
11064     0: a
11065    
11066    /(.(*ACCEPT))*?5/
11067        abcde
11068     0: a
11069     1: a
11070    
11071    /(.(*ACCEPT))5/
11072        abcde
11073     0: a
11074     1: a
11075    
11076    /(.(*ACCEPT))*5/
11077        abcde
11078     0: a
11079     1: a
11080    
11081    /A\NB./BZ
11082    ------------------------------------------------------------------
11083            Bra
11084            A
11085            Any
11086            B
11087            Any
11088            Ket
11089            End
11090    ------------------------------------------------------------------
11091        ACBD
11092     0: ACBD
11093        *** Failers
11094    No match
11095        A\nB
11096    No match
11097        ACB\n
11098    No match
11099    
11100    /A\NB./sBZ
11101    ------------------------------------------------------------------
11102            Bra
11103            A
11104            Any
11105            B
11106            AllAny
11107            Ket
11108            End
11109    ------------------------------------------------------------------
11110        ACBD
11111     0: ACBD
11112        ACB\n
11113     0: ACB\x0a
11114        *** Failers
11115    No match
11116        A\nB
11117    No match
11118    
11119    /A\NB/<crlf>
11120        A\nB
11121     0: A\x0aB
11122        A\rB
11123     0: A\x0dB
11124        ** Failers
11125    No match
11126        A\r\nB
11127    No match
11128    
11129    /\R+b/BZ
11130    ------------------------------------------------------------------
11131            Bra
11132            \R++
11133            b
11134            Ket
11135            End
11136    ------------------------------------------------------------------
11137    
11138    /\R+\n/BZ
11139    ------------------------------------------------------------------
11140            Bra
11141            \R+
11142            \x0a
11143            Ket
11144            End
11145    ------------------------------------------------------------------
11146    
11147    /\R+\d/BZ
11148    ------------------------------------------------------------------
11149            Bra
11150            \R++
11151            \d
11152            Ket
11153            End
11154    ------------------------------------------------------------------
11155    
11156    /\d*\R/BZ
11157    ------------------------------------------------------------------
11158            Bra
11159            \d*+
11160            \R
11161            Ket
11162            End
11163    ------------------------------------------------------------------
11164    
11165    /\s*\R/BZ
11166    ------------------------------------------------------------------
11167            Bra
11168            \s*+
11169            \R
11170            Ket
11171            End
11172    ------------------------------------------------------------------
11173    
11174    /-- Perl treats this one differently, not failing the second string. I believe
11175        that is a bug in Perl. --/
11176    
11177    /^((abc|abcx)(*THEN)y|abcd)/
11178        abcd
11179     0: abcd
11180     1: abcd
11181        *** Failers
11182    No match
11183        abcxy
11184    No match
11185    
11186    /(?<=abc)def/
11187        abc\P\P
11188    Partial match: abc
11189    
11190    /abc$/
11191        abc
11192     0: abc
11193        abc\P
11194     0: abc
11195        abc\P\P
11196    Partial match: abc
11197    
11198    /abc$/m
11199        abc
11200     0: abc
11201        abc\n
11202     0: abc
11203        abc\P\P
11204    Partial match: abc
11205        abc\n\P\P
11206     0: abc
11207        abc\P
11208     0: abc
11209        abc\n\P
11210     0: abc
11211    
11212    /abc\z/
11213        abc
11214     0: abc
11215        abc\P
11216     0: abc
11217        abc\P\P
11218    Partial match: abc
11219    
11220    /abc\Z/
11221        abc
11222     0: abc
11223        abc\P
11224     0: abc
11225        abc\P\P
11226    Partial match: abc
11227    
11228    /abc\b/
11229        abc
11230     0: abc
11231        abc\P
11232     0: abc
11233        abc\P\P
11234    Partial match: abc
11235    
11236    /abc\B/
11237        abc
11238    No match
11239        abc\P
11240    Partial match: abc
11241        abc\P\P
11242    Partial match: abc
11243    
11244    /.+/
11245        abc\>0
11246     0: abc
11247        abc\>1
11248     0: bc
11249        abc\>2
11250     0: c
11251        abc\>3
11252    No match
11253        abc\>4
11254    Error -24 (bad offset value)
11255        abc\>-4
11256    Error -24 (bad offset value)
11257    
11258    /^\cģ/
11259    Failed: \c must be followed by an ASCII character at offset 3
11260    
11261    /(?P<abn>(?P=abn)xxx)/BZ
11262    ------------------------------------------------------------------
11263            Bra
11264            Once
11265            CBra 1
11266            \1
11267            xxx
11268            Ket
11269            Ket
11270            Ket
11271            End
11272    ------------------------------------------------------------------
11273    
11274    /(a\1z)/BZ
11275    ------------------------------------------------------------------
11276            Bra
11277            Once
11278            CBra 1
11279            a
11280            \1
11281            z
11282            Ket
11283            Ket
11284            Ket
11285            End
11286    ------------------------------------------------------------------
11287    
11288    /(?P<abn>(?P=abn)(?<badstufxxx)/BZ
11289    Failed: syntax error in subpattern name (missing terminator) at offset 29
11290    
11291    /(?P<abn>(?P=axn)xxx)/BZ
11292    Failed: reference to non-existent subpattern at offset 15
11293    
11294    /(?P<abn>(?P=axn)xxx)(?<axn>yy)/BZ
11295    ------------------------------------------------------------------
11296            Bra
11297            CBra 1
11298            \2
11299            xxx
11300            Ket
11301            CBra 2
11302            yy
11303            Ket
11304            Ket
11305            End
11306    ------------------------------------------------------------------
11307    
11308  /-- End of testinput2 --/  /-- End of testinput2 --/

Legend:
Removed from v.457  
changed lines
  Added in v.598

  ViewVC Help
Powered by ViewVC 1.1.5