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

Diff of /code/trunk/testdata/testinput2

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

revision 455 by ph10, Sat Sep 26 19:12:32 2009 UTC revision 729 by ph10, Mon Oct 10 16:02:20 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    
# Line 51  Line 51 
51    
52  /(?X)[\B]/  /(?X)[\B]/
53    
54    /(?X)[\R]/
55    
56    /(?X)[\X]/
57    
58    /[\B]/BZ
59    
60    /[\R]/BZ
61    
62    /[\X]/BZ
63    
64  /[z-a]/  /[z-a]/
65    
66  /^*/  /^*/
# Line 344  Line 354 
354      *** Failers      *** Failers
355      a      a
356    
357  /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
358    
359  /^(a\1?){4}$/I  /^(a\1?){4}$/I
360        aaaa
361      aaaaaa      aaaaaa
362    
363    /Perl does not fail these two for the final subjects. Neither did PCRE until/
364    /release 8.01. The problem is in backtracking into a subpattern that contains/
365    /a recursive reference to itself. PCRE has now made these into atomic patterns./
366    
367    /^(xa|=?\1a){2}$/
368        xa=xaa
369        ** Failers
370        xa=xaaa
371    
372    /^(xa|=?\1a)+$/
373        xa=xaa
374        ** Failers
375        xa=xaaa
376    
377  /These are syntax tests from Perl 5.005/I  /These are syntax tests from Perl 5.005/I
378    
# Line 1036  Line 1061 
1061  /abc(?C)de(?C1)f/I  /abc(?C)de(?C1)f/I
1062      123abcdef      123abcdef
1063    
1064  /(?C1)\dabc(?C2)def/I  /(?C1)\dabc(?C2)def/IS
1065        1234abcdef
1066        *** Failers
1067        abcdef
1068    
1069    /(?C1)\dabc(?C2)def/ISS
1070      1234abcdef      1234abcdef
1071      *** Failers      *** Failers
1072      abcdef      abcdef
# Line 1285  Line 1315 
1315    abcde    abcde
1316    abcdfe    abcdfe
1317    
1318  /a*b/ICDZ  /a*b/ICDZS
1319      ab
1320      aaaab
1321      aaaacb
1322    
1323    /a*b/ICDZSS
1324    ab    ab
1325    aaaab    aaaab
1326    aaaacb    aaaacb
# Line 1295  Line 1330 
1330    aaaab    aaaab
1331    aaaacb    aaaacb
1332    
1333  /(abc|def)x/ICDZ  /(abc|def)x/ICDZS
1334      abcx
1335      defx
1336      ** Failers
1337      abcdefzx
1338    
1339    /(abc|def)x/ICDZSS
1340    abcx    abcx
1341    defx    defx
1342      ** Failers
1343    abcdefzx    abcdefzx
1344    
1345  /(ab|cd){3,4}/IC  /(ab|cd){3,4}/IC
# Line 1305  Line 1347 
1347    abcdabcd    abcdabcd
1348    abcdcdcdcdcd    abcdcdcdcdcd
1349    
1350  /([ab]{,4}c|xy)/ICDZ  /([ab]{,4}c|xy)/ICDZS
1351        Note: that { does NOT introduce a quantifier
1352    
1353    /([ab]{,4}c|xy)/ICDZSS
1354      Note: that { does NOT introduce a quantifier      Note: that { does NOT introduce a quantifier
1355    
1356  /([ab]{1,4}c|xy){4,5}?123/ICDZ  /([ab]{1,4}c|xy){4,5}?123/ICDZ
# Line 1379  Line 1424 
1424      1X      1X
1425      123456\P      123456\P
1426    
1427  /abc/I>testsavedregex  /abc/IS>testsavedregex
1428    <testsavedregex
1429        abc
1430        ** Failers
1431        bca
1432    
1433    /abc/ISS>testsavedregex
1434    <testsavedregex
1435        abc
1436        ** Failers
1437        bca
1438    
1439    /abc/IFS>testsavedregex
1440  <testsavedregex  <testsavedregex
1441      abc      abc
1442      ** Failers      ** Failers
1443      bca      bca
1444    
1445  /abc/IF>testsavedregex  /abc/IFSS>testsavedregex
1446  <testsavedregex  <testsavedregex
1447      abc      abc
1448      ** Failers      ** Failers
# Line 1397  Line 1454 
1454      ** Failers      ** Failers
1455      def      def
1456    
1457    /(a|b)/ISS>testsavedregex
1458    <testsavedregex
1459        abc
1460        ** Failers
1461        def
1462    
1463  /(a|b)/ISF>testsavedregex  /(a|b)/ISF>testsavedregex
1464  <testsavedregex  <testsavedregex
1465      abc      abc
1466      ** Failers      ** Failers
1467      def      def
1468    
1469    /(a|b)/ISSF>testsavedregex
1470    <testsavedregex
1471        abc
1472        ** Failers
1473        def
1474    
1475  ~<(\w+)/?>(.)*</(\1)>~smgI  ~<(\w+)/?>(.)*</(\1)>~smgI
1476      <!DOCTYPE seite SYSTEM "http://www.lco.lineas.de/xmlCms.dtd">\n<seite>\n<dokumenteninformation>\n<seitentitel>Partner der LCO</seitentitel>\n<sprache>de</sprache>\n<seitenbeschreibung>Partner der LINEAS Consulting\nGmbH</seitenbeschreibung>\n<schluesselworte>LINEAS Consulting GmbH Hamburg\nPartnerfirmen</schluesselworte>\n<revisit>30 days</revisit>\n<robots>index,follow</robots>\n<menueinformation>\n<aktiv>ja</aktiv>\n<menueposition>3</menueposition>\n<menuetext>Partner</menuetext>\n</menueinformation>\n<lastedited>\n<autor>LCO</autor>\n<firma>LINEAS Consulting</firma>\n<datum>15.10.2003</datum>\n</lastedited>\n</dokumenteninformation>\n<inhalt>\n\n<absatzueberschrift>Die Partnerfirmen der LINEAS Consulting\nGmbH</absatzueberschrift>\n\n<absatz><link ziel="http://www.ca.com/" zielfenster="_blank">\n<bild name="logo_ca.gif" rahmen="no"/></link> <link\nziel="http://www.ey.com/" zielfenster="_blank"><bild\nname="logo_euy.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.cisco.de/" zielfenster="_blank">\n<bild name="logo_cisco.gif" rahmen="ja"/></link></absatz>\n\n<absatz><link ziel="http://www.atelion.de/"\nzielfenster="_blank"><bild\nname="logo_atelion.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.line-information.de/"\nzielfenster="_blank">\n<bild name="logo_line_information.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><bild name="logo_aw.gif" rahmen="no"/></absatz>\n\n<absatz><link ziel="http://www.incognis.de/"\nzielfenster="_blank"><bild\nname="logo_incognis.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.addcraft.com/"\nzielfenster="_blank"><bild\nname="logo_addcraft.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.comendo.com/"\nzielfenster="_blank"><bild\nname="logo_comendo.gif" rahmen="no"/></link></absatz>\n\n</inhalt>\n</seite>      \J1024<!DOCTYPE seite SYSTEM "http://www.lco.lineas.de/xmlCms.dtd">\n<seite>\n<dokumenteninformation>\n<seitentitel>Partner der LCO</seitentitel>\n<sprache>de</sprache>\n<seitenbeschreibung>Partner der LINEAS Consulting\nGmbH</seitenbeschreibung>\n<schluesselworte>LINEAS Consulting GmbH Hamburg\nPartnerfirmen</schluesselworte>\n<revisit>30 days</revisit>\n<robots>index,follow</robots>\n<menueinformation>\n<aktiv>ja</aktiv>\n<menueposition>3</menueposition>\n<menuetext>Partner</menuetext>\n</menueinformation>\n<lastedited>\n<autor>LCO</autor>\n<firma>LINEAS Consulting</firma>\n<datum>15.10.2003</datum>\n</lastedited>\n</dokumenteninformation>\n<inhalt>\n\n<absatzueberschrift>Die Partnerfirmen der LINEAS Consulting\nGmbH</absatzueberschrift>\n\n<absatz><link ziel="http://www.ca.com/" zielfenster="_blank">\n<bild name="logo_ca.gif" rahmen="no"/></link> <link\nziel="http://www.ey.com/" zielfenster="_blank"><bild\nname="logo_euy.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.cisco.de/" zielfenster="_blank">\n<bild name="logo_cisco.gif" rahmen="ja"/></link></absatz>\n\n<absatz><link ziel="http://www.atelion.de/"\nzielfenster="_blank"><bild\nname="logo_atelion.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><link ziel="http://www.line-information.de/"\nzielfenster="_blank">\n<bild name="logo_line_information.gif" rahmen="no"/></link>\n</absatz>\n\n<absatz><bild name="logo_aw.gif" rahmen="no"/></absatz>\n\n<absatz><link ziel="http://www.incognis.de/"\nzielfenster="_blank"><bild\nname="logo_incognis.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.addcraft.com/"\nzielfenster="_blank"><bild\nname="logo_addcraft.gif" rahmen="no"/></link></absatz>\n\n<absatz><link ziel="http://www.comendo.com/"\nzielfenster="_blank"><bild\nname="logo_comendo.gif" rahmen="no"/></link></absatz>\n\n</inhalt>\n</seite>
1477    
1478  /^a/IF  /^a/IF
1479    
# Line 1951  a random value. /Ix Line 2020  a random value. /Ix
2020    
2021  /(?(DEFINE) abc) xyz/xI  /(?(DEFINE) abc) xyz/xI
2022    
 /(?(DEFINE) abc){3} xyz/x  
   
2023  /(a|)*\d/  /(a|)*\d/
2024    \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa    \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
2025    \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4    \O0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4
# Line 2230  a random value. /Ix Line 2297  a random value. /Ix
2297  /\V+\v\V+\w/BZ  /\V+\v\V+\w/BZ
2298    
2299  /\( (?: [^()]* | (?R) )* \)/x  /\( (?: [^()]* | (?R) )* \)/x
2300  (0(0(0(0(0(0(0(0(0(0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\6666666666)/  /(?i:A{1,}\6666666666)/
2337    
2338  /\g6666666666/  /\g6666666666/
2339    
2340  /[\g6666666666]/  /[\g6666666666]/BZ
2341    
2342  /(?1)\c[/  /(?1)\c[/
2343    
# Line 2323  a random value. /Ix Line 2388  a random value. /Ix
2388      a\nb      a\nb
2389      a\r\nb      a\r\nb
2390      a\x85b      a\x85b
2391    
2392    /(*ANY).*/g
2393        abc\r\ndef
2394    
2395    /(*ANYCRLF).*/g
2396        abc\r\ndef
2397    
2398    /(*CRLF).*/g
2399        abc\r\ndef
2400    
2401  /a\Rb/I<bsr_anycrlf>  /a\Rb/I<bsr_anycrlf>
2402      a\rb      a\rb
# Line 2421  a random value. /Ix Line 2495  a random value. /Ix
2495    
2496  /\k{}/  /\k{}/
2497    
2498    /\k/
2499    
2500    /\kabc/
2501    
2502  /(?P=)/  /(?P=)/
2503    
2504  /(?P>)/  /(?P>)/
# Line 2552  a random value. /Ix Line 2630  a random value. /Ix
2630    abc\Y    abc\Y
2631    abcxypqr    abcxypqr
2632    abcxypqr\Y    abcxypqr\Y
2633    
2634    /(*NO_START_OPT)xyz/C
2635      abcxyz
2636    
2637    /xyz/CY
2638      abcxyz
2639    
2640  /^"((?(?=[a])[^"])|b)*"$/C  /^"((?(?=[a])[^"])|b)*"$/C
2641      "ab"      "ab"
# Line 3098  a random value. /Ix Line 3182  a random value. /Ix
3182    (?(1)|.)                    # check that there was an empty component    (?(1)|.)                    # check that there was an empty component
3183    /xiIS    /xiIS
3184    
3185    /(?|(?<a>A)|(?<a>B))/I
3186        AB\Ca
3187        BA\Ca
3188    
3189    /(?|(?<a>A)|(?<b>B))/
3190    
3191    /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |
3192        b(?<quote> (?<apostrophe>')|(?<realquote>")) )
3193        (?('quote')[a-z]+|[0-9]+)/JIx
3194        a"aaaaa
3195        b"aaaaa
3196        ** Failers
3197        b"11111
3198        a"11111
3199    
3200    /^(?|(a)(b)(c)(?<D>d)|(?<D>e)) (?('D')X|Y)/JDZx
3201        abcdX
3202        eX
3203        ** Failers
3204        abcdY
3205        ey
3206    
3207    /(?<A>a) (b)(c)  (?<A>d  (?(R&A)$ | (?4)) )/JDZx
3208        abcdd
3209        ** Failers
3210        abcdde
3211    
3212    /abcd*/
3213        xxxxabcd\P
3214        xxxxabcd\P\P
3215    
3216    /abcd*/i
3217        xxxxabcd\P
3218        xxxxabcd\P\P
3219        XXXXABCD\P
3220        XXXXABCD\P\P
3221    
3222    /abc\d*/
3223        xxxxabc1\P
3224        xxxxabc1\P\P
3225    
3226    /(a)bc\1*/
3227        xxxxabca\P
3228        xxxxabca\P\P
3229    
3230    /abc[de]*/
3231        xxxxabcde\P
3232        xxxxabcde\P\P
3233    
3234    /-- This is not in the Perl >= 5.10 test because Perl seems currently to be
3235        broken and not behaving as specified in that it *does* bumpalong after
3236        hitting (*COMMIT). --/
3237    
3238    /(?1)(A(*COMMIT)|B)D/
3239        ABD
3240        XABD
3241        BAD
3242        ABXABD
3243        ** Failers
3244        ABX
3245        BAXBAD
3246    
3247    /(\3)(\1)(a)/<JS>
3248        cat
3249    
3250    /(\3)(\1)(a)/SI<JS>
3251        cat
3252    
3253    /(\3)(\1)(a)/SI
3254        cat
3255    
3256    /i(?(DEFINE)(?<s>a))/SI
3257        i
3258    
3259    /()i(?(1)a)/SI
3260        ia
3261    
3262    /(?i)a(?-i)b|c/BZ
3263        XabX
3264        XAbX
3265        CcC
3266        ** Failers
3267        XABX
3268    
3269    /(?i)a(?s)b|c/BZ
3270    
3271    /(?i)a(?s-i)b|c/BZ
3272    
3273    /^(ab(c\1)d|x){2}$/BZ
3274        xabcxd
3275    
3276    /^(?&t)*+(?(DEFINE)(?<t>.))$/BZ
3277    
3278    /^(?&t)*(?(DEFINE)(?<t>.))$/BZ
3279    
3280    / -- The first four of these are not in the Perl >= 5.10 test because Perl
3281         documents that the use of \K in assertions is "not well defined". The
3282         last is here because Perl gives the match as "b" rather than "ab". I
3283         believe this to be a Perl bug. --/
3284    
3285    /(?=a\Kb)ab/
3286        ab
3287    
3288    /(?!a\Kb)ac/
3289        ac
3290    
3291    /^abc(?<=b\Kc)d/
3292        abcd
3293    
3294    /^abc(?<!b\Kq)d/
3295        abcd
3296    
3297    /(?>a\Kb)z|(ab)/
3298        ab
3299    
3300    /----------------------/
3301    
3302    /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
3303    
3304    /abc(*MARK:)pqr/
3305    
3306    /abc(*:)pqr/
3307    
3308    /abc(*FAIL:123)xyz/
3309    
3310    /--- This should, and does, fail. In Perl, it does not, which I think is a
3311         bug because replacing the B in the pattern by (B|D) does make it fail. ---/
3312    
3313    /A(*COMMIT)B/+K
3314        ACABX
3315    
3316    /--- These should be different, but in Perl 5.11 are not, which I think
3317         is a bug in Perl. ---/
3318    
3319    /A(*THEN)B|A(*THEN)C/K
3320        AC
3321    
3322    /A(*PRUNE)B|A(*PRUNE)C/K
3323        AC
3324    
3325    /--- A whole lot of tests of verbs with arguments are here rather than in test
3326         11 because Perl doesn't seem to follow its specification entirely
3327         correctly. ---/
3328    
3329    /--- Perl 5.11 sets $REGERROR on the AC failure case here; PCRE does not. It is
3330         not clear how Perl defines "involved in the failure of the match". ---/
3331    
3332    /^(A(*THEN:A)B|C(*THEN:B)D)/K
3333        AB
3334        CD
3335        ** Failers
3336        AC
3337        CB
3338    
3339    /--- Check the use of names for success and failure. PCRE doesn't show these
3340    names for success, though Perl does, contrary to its spec. ---/
3341    
3342    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
3343        AB
3344        CD
3345        ** Failers
3346        AC
3347        CB
3348    
3349    /--- An empty name does not pass back an empty string. It is the same as if no
3350    name were given. ---/
3351    
3352    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/K
3353        AB
3354        CD
3355    
3356    /--- PRUNE goes to next bumpalong; COMMIT does not. ---/
3357    
3358    /A(*PRUNE:A)B/K
3359        ACAB
3360    
3361    /(*MARK:A)(*PRUNE:B)(C|X)/KS
3362        C
3363        D
3364    
3365    /(*MARK:A)(*PRUNE:B)(C|X)/KSS
3366        C
3367        D
3368    
3369    /(*MARK:A)(*THEN:B)(C|X)/KS
3370        C
3371        D
3372    
3373    /(*MARK:A)(*THEN:B)(C|X)/KSY
3374        C
3375        D
3376    
3377    /(*MARK:A)(*THEN:B)(C|X)/KSS
3378        C
3379        D
3380    
3381    /--- This should fail, as the skip causes a bump to offset 3 (the skip) ---/
3382    
3383    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xK
3384        AAAC
3385    
3386    /--- Same --/
3387    
3388    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xK
3389        AAAC
3390    
3391    /--- This should fail; the SKIP advances by one, but when we get to AC, the
3392         PRUNE kills it. ---/
3393    
3394    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK
3395        AAAC
3396    
3397    /A(*:A)A+(*SKIP)(B|Z) | AC/xK
3398        AAAC
3399    
3400    /--- This should fail, as a null name is the same as no name ---/
3401    
3402    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xK
3403        AAAC
3404    
3405    /--- This fails in PCRE, and I think that is in accordance with Perl's
3406         documentation, though in Perl it succeeds. ---/
3407    
3408    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xK
3409        AAAC
3410    
3411    /--- Mark names can be duplicated ---/
3412    
3413    /A(*:A)B|X(*:A)Y/K
3414        AABC
3415        XXYZ
3416    
3417    /^A(*:A)B|^X(*:A)Y/K
3418        ** Failers
3419        XAQQ
3420    
3421    /--- A check on what happens after hitting a mark and them bumping along to
3422    something that does not even start. Perl reports tags after the failures here,
3423    though it does not when the individual letters are made into something
3424    more complicated. ---/
3425    
3426    /A(*:A)B|XX(*:B)Y/K
3427        AABC
3428        XXYZ
3429        ** Failers
3430        XAQQ
3431        XAQQXZZ
3432        AXQQQ
3433        AXXQQQ
3434    
3435    /--- COMMIT at the start of a pattern should be the same as an anchor. Perl
3436    optimizations defeat this. So does the PCRE optimization unless we disable it
3437    with \Y. ---/
3438    
3439    /(*COMMIT)ABC/
3440        ABCDEFG
3441        ** Failers
3442        DEFGABC\Y
3443    
3444    /--- Repeat some tests with added studying. ---/
3445    
3446    /A(*COMMIT)B/+KS
3447        ACABX
3448    
3449    /A(*THEN)B|A(*THEN)C/KS
3450        AC
3451    
3452    /A(*PRUNE)B|A(*PRUNE)C/KS
3453        AC
3454    
3455    /^(A(*THEN:A)B|C(*THEN:B)D)/KS
3456        AB
3457        CD
3458        ** Failers
3459        AC
3460        CB
3461    
3462    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/KS
3463        AB
3464        CD
3465        ** Failers
3466        AC
3467        CB
3468    
3469    /^(A(*PRUNE:)B|C(*PRUNE:B)D)/KS
3470        AB
3471        CD
3472    
3473    /A(*PRUNE:A)B/KS
3474        ACAB
3475    
3476    /(*MARK:A)(*PRUNE:B)(C|X)/KS
3477        C
3478        D
3479    
3480    /(*MARK:A)(*THEN:B)(C|X)/KS
3481        C
3482        D
3483    
3484    /A(*MARK:A)A+(*SKIP)(B|Z) | AC/xKS
3485        AAAC
3486    
3487    /A(*MARK:A)A+(*MARK:B)(*SKIP:B)(B|Z) | AC/xKS
3488        AAAC
3489    
3490    /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xKS
3491        AAAC
3492    
3493    /A(*:A)A+(*SKIP)(B|Z) | AC/xKS
3494        AAAC
3495    
3496    /A(*MARK:A)A+(*SKIP:)(B|Z) | AC/xKS
3497        AAAC
3498    
3499    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AAC/xKS
3500        AAAC
3501    
3502    /A(*:A)B|XX(*:B)Y/KS
3503        AABC
3504        XXYZ
3505        ** Failers
3506        XAQQ
3507        XAQQXZZ
3508        AXQQQ
3509        AXXQQQ
3510    
3511    /(*COMMIT)ABC/
3512        ABCDEFG
3513        ** Failers
3514        DEFGABC\Y
3515    
3516    /^(ab (c+(*THEN)cd) | xyz)/x
3517        abcccd
3518    
3519    /^(ab (c+(*PRUNE)cd) | xyz)/x
3520        abcccd
3521    
3522    /^(ab (c+(*FAIL)cd) | xyz)/x
3523        abcccd
3524    
3525    /--- Perl 5.11 gets some of these wrong ---/
3526    
3527    /(?>.(*ACCEPT))*?5/
3528        abcde
3529    
3530    /(.(*ACCEPT))*?5/
3531        abcde
3532    
3533    /(.(*ACCEPT))5/
3534        abcde
3535    
3536    /(.(*ACCEPT))*5/
3537        abcde
3538    
3539    /A\NB./BZ
3540        ACBD
3541        *** Failers
3542        A\nB
3543        ACB\n
3544    
3545    /A\NB./sBZ
3546        ACBD
3547        ACB\n
3548        *** Failers
3549        A\nB
3550    
3551    /A\NB/<crlf>
3552        A\nB
3553        A\rB
3554        ** Failers
3555        A\r\nB
3556    
3557    /\R+b/BZ
3558    
3559    /\R+\n/BZ
3560    
3561    /\R+\d/BZ
3562    
3563    /\d*\R/BZ
3564    
3565    /\s*\R/BZ
3566    
3567    /-- Perl treats this one differently, not failing the second string. I believe
3568        that is a bug in Perl. --/
3569    
3570    /^((abc|abcx)(*THEN)y|abcd)/
3571        abcd
3572        *** Failers
3573        abcxy
3574    
3575    /(?<=abc)def/
3576        abc\P\P
3577    
3578    /abc$/
3579        abc
3580        abc\P
3581        abc\P\P
3582    
3583    /abc$/m
3584        abc
3585        abc\n
3586        abc\P\P
3587        abc\n\P\P
3588        abc\P
3589        abc\n\P
3590    
3591    /abc\z/
3592        abc
3593        abc\P
3594        abc\P\P
3595    
3596    /abc\Z/
3597        abc
3598        abc\P
3599        abc\P\P
3600    
3601    /abc\b/
3602        abc
3603        abc\P
3604        abc\P\P
3605    
3606    /abc\B/
3607        abc
3608        abc\P
3609        abc\P\P
3610    
3611    /.+/
3612        abc\>0
3613        abc\>1
3614        abc\>2
3615        abc\>3
3616        abc\>4
3617        abc\>-4
3618    
3619    /^\cģ/
3620    
3621    /(?P<abn>(?P=abn)xxx)/BZ
3622    
3623    /(a\1z)/BZ
3624    
3625    /(?P<abn>(?P=abn)(?<badstufxxx)/BZ
3626    
3627    /(?P<abn>(?P=axn)xxx)/BZ
3628    
3629    /(?P<abn>(?P=axn)xxx)(?<axn>yy)/BZ
3630    
3631    /-- These tests are here because Perl gets the first one wrong. --/
3632    
3633    /(\R*)(.)/s
3634        \r\n
3635        \r\r\n\n\r
3636        \r\r\n\n\r\n
3637    
3638    /(\R)*(.)/s
3639        \r\n
3640        \r\r\n\n\r
3641        \r\r\n\n\r\n
3642    
3643    /((?>\r\n|\n|\x0b|\f|\r|\x85)*)(.)/s
3644        \r\n
3645        \r\r\n\n\r
3646        \r\r\n\n\r\n
3647    
3648    /-- --/
3649    
3650    /^abc$/BZ
3651    
3652    /^abc$/BZm
3653    
3654    /^(a)*+(\w)/S
3655        aaaaX
3656        ** Failers
3657        aaaa
3658    
3659    /^(?:a)*+(\w)/S
3660        aaaaX
3661        ** Failers
3662        aaaa
3663    
3664    /(a)++1234/SDZ
3665    
3666    /([abc])++1234/SI
3667    
3668    /(?<=(abc)+)X/
3669    
3670    /(^ab)/I
3671    
3672    /(^ab)++/I
3673    
3674    /(^ab|^)+/I
3675    
3676    /(^ab|^)++/I
3677    
3678    /(?:^ab)/I
3679    
3680    /(?:^ab)++/I
3681    
3682    /(?:^ab|^)+/I
3683    
3684    /(?:^ab|^)++/I
3685    
3686    /(.*ab)/I
3687    
3688    /(.*ab)++/I
3689    
3690    /(.*ab|.*)+/I
3691    
3692    /(.*ab|.*)++/I
3693    
3694    /(?:.*ab)/I
3695    
3696    /(?:.*ab)++/I
3697    
3698    /(?:.*ab|.*)+/I
3699    
3700    /(?:.*ab|.*)++/I
3701    
3702    /(?=a)[bcd]/I
3703    
3704    /((?=a))[bcd]/I
3705    
3706    /((?=a))+[bcd]/I
3707    
3708    /((?=a))++[bcd]/I
3709    
3710    /(?=a+)[bcd]/iI
3711    
3712    /(?=a+?)[bcd]/iI
3713    
3714    /(?=a++)[bcd]/iI
3715    
3716    /(?=a{3})[bcd]/iI
3717    
3718    /(abc)\1+/S
3719    
3720    /-- Perl doesn't get these right IMO (the 3rd is PCRE-specific) --/
3721    
3722    /(?1)(?:(b(*ACCEPT))){0}/
3723        b
3724    
3725    /(?1)(?:(b(*ACCEPT))){0}c/
3726        bc
3727        ** Failers
3728        b
3729    
3730    /(?1)(?:((*ACCEPT))){0}c/
3731        c
3732        c\N
3733    
3734    /^.*?(?(?=a)a|b(*THEN)c)/
3735        ba
3736    
3737    /^.*?(?(?=a)a|bc)/
3738        ba
3739    
3740    /^.*?(?(?=a)a(*THEN)b|c)/
3741        ac
3742    
3743    /^.*?(?(?=a)a(*THEN)b)c/
3744        ac
3745    
3746    /^.*?(a(*THEN)b)c/
3747        aabc
3748    
3749    /^.*? (?1) c (?(DEFINE)(a(*THEN)b))/x
3750        aabc
3751    
3752    /^.*?(a(*THEN)b|z)c/
3753        aabc
3754    
3755    /^.*?(z|a(*THEN)b)c/
3756        aabc
3757    
3758    /-- --/
3759    
3760    /-- These studied versions are here because they are not Perl-compatible; the
3761        studying means the mark is not seen. --/
3762    
3763    /(*MARK:A)(*SKIP:B)(C|X)/KS
3764        C
3765        D
3766    
3767    /(*:A)A+(*SKIP:A)(B|Z)/KS
3768        AAAC
3769    
3770    /-- --/
3771    
3772    "(?=a*(*ACCEPT)b)c"
3773        c
3774        c\N
3775    
3776    /(?1)c(?(DEFINE)((*ACCEPT)b))/
3777        c
3778        c\N
3779    
3780    /(?>(*ACCEPT)b)c/
3781        c
3782        c\N
3783    
3784    /(?:(?>(a)))+a%/++
3785        %aa%
3786    
3787    /(a)b|ac/++SS
3788        ac\O3
3789    
3790    /(a)(b)x|abc/++
3791         abc\O6
3792    
3793    /(a)bc|(a)(b)\2/
3794        \O3abc
3795        \O4abc
3796    
3797    /(?(DEFINE)(a(?2)|b)(b(?1)|a))(?:(?1)|(?2))/SI
3798    
3799    /(a(?2)|b)(b(?1)|a)(?:(?1)|(?2))/SI
3800    
3801    /(a(?2)|b)(b(?1)|a)(?1)(?2)/SI
3802    
3803    /(abc)(?1)/SI
3804    
3805    /^(?>a)++/
3806        aa\M
3807        aaaaaaaaa\M
3808    
3809    /(a)(?1)++/
3810        aa\M
3811        aaaaaaaaa\M
3812    
3813    /(?:(foo)|(bar)|(baz))X/SS=
3814        bazfooX
3815        foobazbarX
3816        barfooX
3817        bazX
3818        foobarbazX
3819        bazfooX\O0
3820        bazfooX\O2
3821        bazfooX\O4
3822        bazfooX\O6
3823        bazfooX\O8
3824        bazfooX\O10
3825    
3826    /(?=abc){3}abc/BZ
3827    
3828    /(?=abc)+abc/BZ
3829    
3830    /(?=abc)++abc/BZ
3831    
3832    /(?=abc){0}xyz/BZ
3833    
3834    /(?=(a))?./BZ
3835    
3836    /(?=(a))??./BZ
3837    
3838    /^(?=(a)){0}b(?1)/BZ
3839    
3840    /(?(DEFINE)(a))?b(?1)/BZ
3841    
3842    /^(?=(?1))?[az]([abc])d/BZ
3843    
3844    /^(?!a){0}\w+/BZ
3845    
3846    /(?<=(abc))?xyz/BZ
3847    
3848    /[:a[:abc]b:]/BZ
3849    
3850    /((?2))((?1))/SS
3851        abc
3852    
3853    /((?(R2)a+|(?1)b))/
3854        aaaabcde
3855    
3856    /(?(R)a*(?1)|((?R))b)/
3857        aaaabcde
3858    
3859    /(a+|(?R)b)/
3860    
3861    /^(a(*:A)(d|e(*:B))z|aeq)/C
3862        adz
3863        aez
3864        aeqwerty
3865    
3866    /.(*F)/
3867        \P\Pabc
3868    
3869    /\btype\b\W*?\btext\b\W*?\bjavascript\b/IS
3870    
3871    /\btype\b\W*?\btext\b\W*?\bjavascript\b|\burl\b\W*?\bshell:|<input\b.*?\btype\b\W*?\bimage\b|\bonkeyup\b\W*?\=/IS
3872    
3873    /a(*SKIP)c|b(*ACCEPT)|/+SI
3874        a
3875    
3876    /a(*SKIP)c|b(*ACCEPT)cd(*ACCEPT)|x/SI
3877        ax
3878    
3879    'a*(*ACCEPT)b'+
3880        \N\N
3881        abc\N\N
3882        bbb\N\N
3883    
3884    /(*ACCEPT)a/+I
3885        bax
3886    
3887    /z(*ACCEPT)a/+I
3888        baxzbx
3889    
3890    /a(?:.)*?a/ims
3891        \Mabbbbbbbbbbbbbbbbbbbbba
3892    
3893    /a(?:.(*THEN))*?a/ims
3894        \Mabbbbbbbbbbbbbbbbbbbbba
3895    
3896    /a(?:.(*THEN:ABC))*?a/ims
3897        \Mabbbbbbbbbbbbbbbbbbbbba
3898    
3899    /-- These tests are in agreement with development Perl 5.015, which has fixed
3900        some things, but they don't all work with 5.012, so they aren't in the
3901        Perl-compatible tests. Those after the first come from Perl's own test
3902        files. --/
3903    
3904    /^((yes|no)(*THEN)(*F))?/
3905      yes
3906    
3907    /(A (.*)   C? (*THEN)  | A D) (*FAIL)/x
3908    AbcdCBefgBhiBqz
3909    
3910    /(A (.*)   C? (*THEN)  | A D) z/x
3911    AbcdCBefgBhiBqz
3912    
3913    /(A (.*)   C? (*THEN)  | A D) \s* (*FAIL)/x
3914    AbcdCBefgBhiBqz
3915    
3916    /(A (.*)   C? (*THEN)  | A D) \s* z/x
3917    AbcdCBefgBhiBqz
3918    
3919    /(A (.*)   (?:C|) (*THEN)  | A D) (*FAIL)/x
3920    AbcdCBefgBhiBqz
3921    
3922    /(A (.*)   (?:C|) (*THEN)  | A D) z/x
3923    AbcdCBefgBhiBqz
3924    
3925    /(A (.*)   C{0,6} (*THEN)  | A D) (*FAIL)/x
3926    AbcdCBefgBhiBqz
3927    
3928    /(A (.*)   C{0,6} (*THEN)  | A D) z/x
3929    AbcdCBefgBhiBqz
3930    
3931    /(A (.*)   (CE){0,6} (*THEN)  | A D) (*FAIL)/x
3932    AbcdCEBefgBhiBqz
3933    
3934    /(A (.*)   (CE){0,6} (*THEN)  | A D) z/x
3935    AbcdCEBefgBhiBqz
3936    
3937    /(A (.*)   (CE*){0,6} (*THEN)  | A D) (*FAIL)/x
3938    AbcdCBefgBhiBqz
3939    
3940    /(A (.*)   (CE*){0,6} (*THEN)  | A D) z/x
3941    AbcdCBefgBhiBqz
3942    
3943    /-----------------------------------------------/
3944    
3945    /^(?>a+)(?>(z+))\w/BZ
3946        aaaazzzzb
3947        ** Failers
3948        aazz
3949    
3950    /(.)(\1|a(?2))/
3951        bab
3952    
3953    /\1|(.)(?R)\1/
3954        cbbbc
3955    
3956    /(.)((?(1)c|a)|a(?2))/
3957        baa
3958    
3959    /(?P<abn>(?P=abn)xxx)/BZ
3960    
3961    /(a\1z)/BZ
3962    
3963    /^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/
3964         \Maabbccddee
3965    
3966    /^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/
3967         \Maabbccddee
3968    
3969    /^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/
3970         \Maabbccddee
3971    
3972  /-- End of testinput2 --/  /-- End of testinput2 --/

Legend:
Removed from v.455  
changed lines
  Added in v.729

  ViewVC Help
Powered by ViewVC 1.1.5