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

Diff of /code/trunk/testdata/testoutput1

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

revision 1271 by ph10, Wed Mar 6 16:50:38 2013 UTC revision 1365 by ph10, Sun Oct 6 18:33:56 2013 UTC
# Line 1  Line 1 
1  /-- This set of tests is for features that are compatible with all versions of  /-- This set of tests is for features that are compatible with all versions of
2      Perl >= 5.10, in non-UTF-8 mode. It should run clean for both the 8-bit and      Perl >= 5.10, in non-UTF-8 mode. It should run clean for the 8-bit, 16-bit,
3      16-bit PCRE libraries. --/      and 32-bit PCRE libraries. --/
4    
5  /the quick brown fox/  /the quick brown fox/
6      the quick brown fox      the quick brown fox
# Line 6006  No match Line 6006  No match
6006    
6007  /[\s]+/  /[\s]+/
6008      > \x09\x0a\x0c\x0d\x0b<      > \x09\x0a\x0c\x0d\x0b<
6009   0:  \x09\x0a\x0c\x0d   0:  \x09\x0a\x0c\x0d\x0b
6010    
6011  /\s+/  /\s+/
6012      > \x09\x0a\x0c\x0d\x0b<      > \x09\x0a\x0c\x0d\x0b<
6013   0:  \x09\x0a\x0c\x0d   0:  \x09\x0a\x0c\x0d\x0b
6014    
6015  /a b/x  /a b/x
6016      ab      ab
6017  No match   0: ab
6018    
6019  /(?!\A)x/m  /(?!\A)x/m
6020    a\nxb\n    a\nxb\n
# Line 6160  No match Line 6160  No match
6160   1: bc   1: bc
6161   2: bc   2: bc
6162    
6163  /-- This tests for an IPv6 address in the form where it can have up to --/  /-- This tests for an IPv6 address in the form where it can have up to
6164  /-- eight components, one and only one of which is empty. This must be --/      eight components, one and only one of which is empty. This must be
6165  No match      an internal component. --/
 /-- an internal component. --/  
 No match  
6166    
6167  /^(?!:)                       # colon disallowed at start  /^(?!:)                       # colon disallowed at start
6168    (?:                         # start of item    (?:                         # start of item
# Line 6906  No match Line 6904  No match
6904      bc      bc
6905   0: b   0: b
6906    
 /^(?=(a)){0}b(?1)/  
     backgammon  
  0: ba  
   
6907  /^(?=(?1))?[az]([abc])d/  /^(?=(?1))?[az]([abc])d/
6908      abd      abd
6909   0: abd   0: abd
# Line 7770  No match Line 7764  No match
7764   1: (ab(cd)ef)   1: (ab(cd)ef)
7765   2: ef   2: ef
7766    
 /^(?!a(*SKIP)b)/  
     ac  
  0:  
   
7767  /^(?=a(*SKIP)b|ac)/  /^(?=a(*SKIP)b|ac)/
7768      ** Failers      ** Failers
7769  No match  No match
7770      ac      ac
7771  No match  No match
7772    
 /^(?=a(*THEN)b|ac)/  
     ac  
  0:  
   
7773  /^(?=a(*PRUNE)b)/  /^(?=a(*PRUNE)b)/
7774      ab      ab
7775   0:   0:
# Line 7796  No match Line 7782  No match
7782      ac      ac
7783   0:   0:
7784    
 /^(?(?!a(*SKIP)b))/  
     ac  
  0:  
   
7785  /(?>a\Kb)/  /(?>a\Kb)/
7786      ab      ab
7787   0: b   0: b
# Line 8169  No match Line 8151  No match
8151   1: AB   1: AB
8152   2: B   2: B
8153    
 /\A.*?(?:a|b(*THEN)c)/  
     ba  
  0: ba  
   
 /\A.*?(?:a|bc)/  
     ba  
  0: ba  
   
 /\A.*?(a|b(*THEN)c)/  
     ba  
  0: ba  
  1: a  
   
8154  /\A.*?(a|bc)/  /\A.*?(a|bc)/
8155      ba      ba
8156   0: ba   0: ba
8157   1: a   1: a
8158    
 /\A.*?(?:a|b(*THEN)c)++/  
     ba  
  0: ba  
   
8159  /\A.*?(?:a|bc)++/  /\A.*?(?:a|bc)++/
8160      ba      ba
8161   0: ba   0: ba
8162    
 /\A.*?(a|b(*THEN)c)++/  
     ba  
  0: ba  
  1: a  
   
8163  /\A.*?(a|bc)++/  /\A.*?(a|bc)++/
8164      ba      ba
8165   0: ba   0: ba
8166   1: a   1: a
8167    
 /\A.*?(?:a|b(*THEN)c|d)/  
     ba  
  0: ba  
   
8168  /\A.*?(?:a|bc|d)/  /\A.*?(?:a|bc|d)/
8169      ba      ba
8170   0: ba   0: ba
# Line 8719  No match Line 8675  No match
8675      aac      aac
8676   0: aac   0: aac
8677    
 /(?!a(*COMMIT)b)ac|cd/  
     ac  
  0: ac  
   
8678  /((?:a?)*)*c/  /((?:a?)*)*c/
8679    aac    aac
8680   0: aac   0: aac
# Line 8803  No match Line 8755  No match
8755      ac      ac
8756   0: ac   0: ac
8757    
8758  /(?:(a(*MARK:X)a+(*SKIP:X)b)){0}(?:(?1)|aac)/  /(?<=(*SKIP)ac)a/
8759      aac      aa
8760    No match
8761    
8762    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/xK
8763        AAAC
8764     0: AC
8765    
8766    /a(*SKIP:m)x|ac(*:n)(*SKIP:n)d|ac/K
8767        acacd
8768     0: acd
8769    MK: n
8770    
8771    /A(*SKIP:m)x|A(*SKIP:n)x|AB/K
8772        AB
8773     0: AB
8774    
8775    /((*SKIP:r)d){0}a(*SKIP:m)x|ac(*:n)|ac/K
8776        acacd
8777     0: ac
8778    MK: n
8779    
8780    /-- Tests that try to figure out how Perl works. My hypothesis is that the
8781        first verb that is backtracked onto is the one that acts. This seems to be
8782        the case almost all the time, but there is one exception that is perhaps a
8783        bug. --/
8784    
8785    /-- This matches "aaaac"; each PRUNE advances one character until the subject
8786        no longer starts with 5 'a's. --/
8787    
8788    /aaaaa(*PRUNE)b|a+c/
8789        aaaaaac
8790     0: aaaac
8791    
8792    /-- Putting SKIP in front of PRUNE makes no difference, as it is never
8793    backtracked onto, whether or not it has a label. --/
8794    
8795    /aaaaa(*SKIP)(*PRUNE)b|a+c/
8796        aaaaaac
8797     0: aaaac
8798    
8799    /aaaaa(*SKIP:N)(*PRUNE)b|a+c/
8800        aaaaaac
8801     0: aaaac
8802    
8803    /aaaa(*:N)a(*SKIP:N)(*PRUNE)b|a+c/
8804        aaaaaac
8805     0: aaaac
8806    
8807    /-- Putting THEN in front makes no difference. */
8808    
8809    /aaaaa(*THEN)(*PRUNE)b|a+c/
8810        aaaaaac
8811     0: aaaac
8812    
8813    /-- However, putting COMMIT in front of the prune changes it to "no match". I
8814        think this is inconsistent and possibly a bug. For the moment, running this
8815        test is moved out of the Perl-compatible file. --/
8816    
8817    /aaaaa(*COMMIT)(*PRUNE)b|a+c/
8818    
8819    
8820    /---- OK, lets play the same game again using SKIP instead of PRUNE. ----/
8821    
8822    /-- This matches "ac" because SKIP forces the next match to start on the
8823        sixth "a". --/
8824    
8825    /aaaaa(*SKIP)b|a+c/
8826        aaaaaac
8827     0: ac
8828    
8829    /-- Putting PRUNE in front makes no difference. --/
8830    
8831    /aaaaa(*PRUNE)(*SKIP)b|a+c/
8832        aaaaaac
8833     0: ac
8834    
8835    /-- Putting THEN in front makes no difference. --/
8836    
8837    /aaaaa(*THEN)(*SKIP)b|a+c/
8838        aaaaaac
8839     0: ac
8840    
8841    /-- In this case, neither does COMMIT. This still matches "ac". --/
8842    
8843    /aaaaa(*COMMIT)(*SKIP)b|a+c/
8844        aaaaaac
8845     0: ac
8846    
8847    /-- This gives "no match", as expected. --/
8848    
8849    /aaaaa(*COMMIT)b|a+c/
8850        aaaaaac
8851    No match
8852    
8853    
8854    /------ Tests using THEN ------/
8855    
8856    /-- This matches "aaaaaac", as expected. --/
8857    
8858    /aaaaa(*THEN)b|a+c/
8859        aaaaaac
8860     0: aaaaaac
8861    
8862    /-- Putting SKIP in front makes no difference. --/
8863    
8864    /aaaaa(*SKIP)(*THEN)b|a+c/
8865        aaaaaac
8866     0: aaaaaac
8867    
8868    /-- Putting PRUNE in front makes no difference. --/
8869    
8870    /aaaaa(*PRUNE)(*THEN)b|a+c/
8871        aaaaaac
8872     0: aaaaaac
8873    
8874    /-- Putting COMMIT in front makes no difference. --/
8875    
8876    /aaaaa(*COMMIT)(*THEN)b|a+c/
8877        aaaaaac
8878     0: aaaaaac
8879    
8880    /-- End of "priority" tests --/
8881    
8882    /aaaaa(*:m)(*PRUNE:m)(*SKIP:m)m|a+/
8883        aaaaaa
8884     0: a
8885    
8886    /aaaaa(*:m)(*MARK:m)(*PRUNE)(*SKIP:m)m|a+/
8887        aaaaaa
8888     0: a
8889    
8890    /aaaaa(*:n)(*PRUNE:m)(*SKIP:m)m|a+/
8891        aaaaaa
8892     0: aaaa
8893    
8894    /aaaaa(*:n)(*MARK:m)(*PRUNE)(*SKIP:m)m|a+/
8895        aaaaaa
8896     0: a
8897    
8898    /a(*MARK:A)aa(*PRUNE:A)a(*SKIP:A)b|a+c/
8899        aaaac
8900     0: aac
8901    
8902    /a(*MARK:A)aa(*MARK:A)a(*SKIP:A)b|a+c/
8903        aaaac
8904     0: ac
8905    
8906    /aaa(*PRUNE:A)a(*SKIP:A)b|a+c/
8907        aaaac
8908   0: aac   0: aac
8909    
8910    /aaa(*MARK:A)a(*SKIP:A)b|a+c/
8911        aaaac
8912     0: ac
8913    
8914    /a(*:m)a(*COMMIT)(*SKIP:m)b|a+c/K
8915        aaaaaac
8916     0: ac
8917    
8918    /.?(a|b(*THEN)c)/
8919        ba
8920     0: ba
8921     1: a
8922    
8923    /(a(*COMMIT)b)c|abd/
8924        abc
8925     0: abc
8926     1: ab
8927        abd
8928    No match
8929    
8930    /(?=a(*COMMIT)b)abc|abd/
8931        abc
8932     0: abc
8933        abd
8934     0: abd
8935    
8936    /(?>a(*COMMIT)b)c|abd/
8937        abc
8938     0: abc
8939        abd
8940     0: abd
8941    
8942    /a(?=b(*COMMIT)c)[^d]|abd/
8943        abd
8944    No match
8945        abc
8946     0: ab
8947    
8948    /a(?=bc).|abd/
8949        abd
8950     0: abd
8951        abc
8952     0: ab
8953    
8954    /a(?>b(*COMMIT)c)d|abd/
8955        abceabd
8956    No match
8957    
8958    /a(?>bc)d|abd/
8959        abceabd
8960     0: abd
8961    
8962    /(?>a(*COMMIT)b)c|abd/
8963        abd
8964     0: abd
8965    
8966    /(?>a(*COMMIT)c)d|abd/
8967        abd
8968    No match
8969    
8970    /((?=a(*COMMIT)b)ab|ac){0}(?:(?1)|a(c))/
8971        ac
8972     0: ac
8973     1: <unset>
8974     2: c
8975    
8976    /-- These tests were formerly in test 2, but changes in PCRE and Perl have
8977        made them compatible. --/
8978    
8979    /^(a)?(?(1)a|b)+$/
8980        *** Failers
8981    No match
8982        a
8983    No match
8984    
8985    /(?=a\Kb)ab/
8986        ab
8987     0: b
8988    
8989    /(?!a\Kb)ac/
8990        ac
8991     0: ac
8992    
8993    /^abc(?<=b\Kc)d/
8994        abcd
8995     0: cd
8996    
8997    /^abc(?<!b\Kq)d/
8998        abcd
8999     0: abcd
9000    
9001    
9002    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
9003        AAAC
9004    No match, mark = A
9005    
9006    /^((abc|abcx)(*THEN)y|abcd)/
9007        abcd
9008     0: abcd
9009     1: abcd
9010        *** Failers
9011    No match
9012        abcxy
9013    No match
9014    
9015    /^((yes|no)(*THEN)(*F))?/
9016      yes
9017    No match
9018    
9019    /(A (.*)   C? (*THEN)  | A D) (*FAIL)/x
9020    AbcdCBefgBhiBqz
9021    No match
9022    
9023    /(A (.*)   C? (*THEN)  | A D) z/x
9024    AbcdCBefgBhiBqz
9025    No match
9026    
9027    /(A (.*)   C? (*THEN)  | A D) \s* (*FAIL)/x
9028    AbcdCBefgBhiBqz
9029    No match
9030    
9031    /(A (.*)   C? (*THEN)  | A D) \s* z/x
9032    AbcdCBefgBhiBqz
9033    No match
9034    
9035    /(A (.*)   (?:C|) (*THEN)  | A D) (*FAIL)/x
9036    AbcdCBefgBhiBqz
9037    No match
9038    
9039    /(A (.*)   (?:C|) (*THEN)  | A D) z/x
9040    AbcdCBefgBhiBqz
9041    No match
9042    
9043    /(A (.*)   C{0,6} (*THEN)  | A D) (*FAIL)/x
9044    AbcdCBefgBhiBqz
9045    No match
9046    
9047    /(A (.*)   C{0,6} (*THEN)  | A D) z/x
9048    AbcdCBefgBhiBqz
9049    No match
9050    
9051    /(A (.*)   (CE){0,6} (*THEN)  | A D) (*FAIL)/x
9052    AbcdCEBefgBhiBqz
9053    No match
9054    
9055    /(A (.*)   (CE){0,6} (*THEN)  | A D) z/x
9056    AbcdCEBefgBhiBqz
9057    No match
9058    
9059    /(A (.*)   (CE*){0,6} (*THEN)  | A D) (*FAIL)/x
9060    AbcdCBefgBhiBqz
9061    No match
9062    
9063    /(A (.*)   (CE*){0,6} (*THEN)  | A D) z/x
9064    AbcdCBefgBhiBqz
9065    No match
9066    
9067    /(?=a(*COMMIT)b|ac)ac|ac/
9068        ac
9069    No match
9070    
9071    /(?=a(*COMMIT)b|(ac)) ac | (a)c/x
9072        ac
9073    No match
9074    
9075    /--------/
9076    
9077    /(?(?!b(*THEN)a)bn|bnn)/
9078       bnn
9079     0: bn
9080    
9081    /(?!b(*SKIP)a)bn|bnn/
9082        bnn
9083     0: bn
9084    
9085    /(?(?!b(*SKIP)a)bn|bnn)/
9086       bnn
9087     0: bn
9088    
9089    /(?!b(*PRUNE)a)bn|bnn/
9090        bnn
9091     0: bn
9092    
9093    /(?(?!b(*PRUNE)a)bn|bnn)/
9094       bnn
9095     0: bn
9096    
9097    /(?!b(*COMMIT)a)bn|bnn/
9098        bnn
9099     0: bn
9100    
9101    /(?(?!b(*COMMIT)a)bn|bnn)/
9102       bnn
9103     0: bn
9104    
9105    /(?=b(*SKIP)a)bn|bnn/
9106        bnn
9107    No match
9108    
9109    /(?=b(*THEN)a)bn|bnn/
9110        bnn
9111     0: bnn
9112    
9113     /^(?!a(*SKIP)b)/
9114         ac
9115     0:
9116    
9117     /^(?!a(*SKIP)b)../
9118         acd
9119     0: ac
9120    
9121    /(?!a(*SKIP)b)../
9122         acd
9123     0: ac
9124    
9125    /^(?(?!a(*SKIP)b))/
9126         ac
9127     0:
9128    
9129    /^(?!a(*PRUNE)b)../
9130         acd
9131     0: ac
9132    
9133    /(?!a(*PRUNE)b)../
9134         acd
9135     0: ac
9136    
9137     /(?!a(*COMMIT)b)ac|cd/
9138         ac
9139     0: ac
9140    
9141    /\A.*?(?:a|bc)/
9142        ba
9143     0: ba
9144    
9145    /^(A(*THEN)B|C(*THEN)D)/
9146        CD
9147     0: CD
9148     1: CD
9149    
9150    /(*:m(m)(?&y)(?(DEFINE)(?<y>b))/K
9151        abc
9152     0: b
9153    MK: m(m
9154    
9155    /(*PRUNE:m(m)(?&y)(?(DEFINE)(?<y>b))/K
9156        abc
9157     0: b
9158    MK: m(m
9159    
9160    /(*SKIP:m(m)(?&y)(?(DEFINE)(?<y>b))/K
9161        abc
9162     0: b
9163    
9164    /(*THEN:m(m)(?&y)(?(DEFINE)(?<y>b))/K
9165        abc
9166     0: b
9167    MK: m(m
9168    
9169    /^\d*\w{4}/
9170        1234
9171     0: 1234
9172        123
9173    No match
9174    
9175    /^[^b]*\w{4}/
9176        aaaa
9177     0: aaaa
9178        aaa
9179    No match
9180    
9181    /^[^b]*\w{4}/i
9182        aaaa
9183     0: aaaa
9184        aaa
9185    No match
9186    
9187    /^a*\w{4}/
9188        aaaa
9189     0: aaaa
9190        aaa
9191    No match
9192    
9193    /^a*\w{4}/i
9194        aaaa
9195     0: aaaa
9196        aaa
9197    No match
9198    
9199    /(?(?=ab)ab)/+
9200        ca
9201     0:
9202     0+ ca
9203        cd
9204     0:
9205     0+ cd
9206    
9207    /(?:(?<n>foo)|(?<n>bar))\k<n>/J
9208        foofoo
9209     0: foofoo
9210     1: foo
9211        barbar
9212     0: barbar
9213     1: <unset>
9214     2: bar
9215    
9216    /(?<n>A)(?:(?<n>foo)|(?<n>bar))\k<n>/J
9217        AfooA
9218     0: AfooA
9219     1: A
9220     2: foo
9221        AbarA
9222     0: AbarA
9223     1: A
9224     2: <unset>
9225     3: bar
9226        ** Failers
9227    No match
9228        Afoofoo
9229    No match
9230        Abarbar
9231    No match
9232    
9233    /^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/
9234        1 IN SOA non-sp1 non-sp2(
9235     0: 1 IN SOA non-sp1 non-sp2(
9236     1: 1
9237     2: non-sp1
9238     3: non-sp2
9239    
9240    /^ (?:(?<A>A)|(?'B'B)(?<A>A)) (?('A')x) (?(<B>)y)$/xJ
9241        Ax
9242     0: Ax
9243     1: A
9244        BAxy
9245     0: BAxy
9246     1: <unset>
9247     2: B
9248     3: A
9249    
9250  /-- End of testinput1 --/  /-- End of testinput1 --/

Legend:
Removed from v.1271  
changed lines
  Added in v.1365

  ViewVC Help
Powered by ViewVC 1.1.5