/[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 972 by ph10, Fri Jun 1 18:03:18 2012 UTC revision 1302 by ph10, Wed Mar 27 11:13:36 2013 UTC
# Line 313  Line 313 
313      *** Failers      *** Failers
314      fooabar      fooabar
315    
 /This one is here because Perl 5.005_02 doesn't fail it/I  
   
 /^(a)?(?(1)a|b)+$/I  
     *** Failers  
     a  
   
316  /This one is here because Perl behaves differently; see also the following/I  /This one is here because Perl behaves differently; see also the following/I
317    
318  /^(a\1?){4}$/I  /^(a\1?){4}$/I
# Line 2939  a random value. /Ix Line 2933  a random value. /Ix
2933      xxxxabcde\P      xxxxabcde\P
2934      xxxxabcde\P\P      xxxxabcde\P\P
2935    
2936  /-- This is not in the Perl >= 5.10 test because Perl seems currently to be  /-- This is not in the Perl-compatible test because Perl seems currently to be
2937      broken and not behaving as specified in that it *does* bumpalong after      broken and not behaving as specified in that it *does* bumpalong after
2938      hitting (*COMMIT). --/      hitting (*COMMIT). --/
2939    
# Line 2985  a random value. /Ix Line 2979  a random value. /Ix
2979    
2980  /^(?&t)*(?(DEFINE)(?<t>.))$/BZ  /^(?&t)*(?(DEFINE)(?<t>.))$/BZ
2981    
2982  / -- The first four of these are not in the Perl >= 5.10 test because Perl  / -- This one is here because Perl gives the match as "b" rather than "ab". I
      documents that the use of \K in assertions is "not well defined". The  
      last is here because Perl gives the match as "b" rather than "ab". I  
2983       believe this to be a Perl bug. --/       believe this to be a Perl bug. --/
2984    
 /(?=a\Kb)ab/  
     ab  
   
 /(?!a\Kb)ac/  
     ac  
   
 /^abc(?<=b\Kc)d/  
     abcd  
   
 /^abc(?<!b\Kq)d/  
     abcd  
   
2985  /(?>a\Kb)z|(ab)/  /(?>a\Kb)z|(ab)/
2986      ab      ab
2987    
 /----------------------/  
   
2988  /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/  /(?P<L1>(?P<L2>0|)|(?P>L2)(?P>L1))/
2989    
2990  /abc(*MARK:)pqr/  /abc(*MARK:)pqr/
# Line 3021  a random value. /Ix Line 2999  a random value. /Ix
2999  /A(*COMMIT)B/+K  /A(*COMMIT)B/+K
3000      ACABX      ACABX
3001    
3002  /--- These should be different, but in Perl 5.11 are not, which I think  /--- These should be different, but in Perl they are not, which I think
3003       is a bug in Perl. ---/       is a bug in Perl. ---/
3004    
3005  /A(*THEN)B|A(*THEN)C/K  /A(*THEN)B|A(*THEN)C/K
# Line 3030  a random value. /Ix Line 3008  a random value. /Ix
3008  /A(*PRUNE)B|A(*PRUNE)C/K  /A(*PRUNE)B|A(*PRUNE)C/K
3009      AC      AC
3010    
 /--- This should fail; the SKIP advances by one, but when we get to AC, the  
      PRUNE kills it. Perl behaves differently. ---/  
   
 /A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK  
     AAAC  
   
3011  /--- Mark names can be duplicated. Perl doesn't give a mark for this one,  /--- Mark names can be duplicated. Perl doesn't give a mark for this one,
3012  though PCRE does. ---/  though PCRE does. ---/
3013    
# Line 3061  with \Y. ---/ Line 3033  with \Y. ---/
3033  /^(ab (c+(*FAIL)cd) | xyz)/x  /^(ab (c+(*FAIL)cd) | xyz)/x
3034      abcccd      abcccd
3035    
3036  /--- Perl 5.11 gets some of these wrong ---/  /--- Perl gets some of these wrong ---/
3037    
3038  /(?>.(*ACCEPT))*?5/  /(?>.(*ACCEPT))*?5/
3039      abcde      abcde
# Line 3121  with \Y. ---/ Line 3093  with \Y. ---/
3093  /X\H++\R/BZ  /X\H++\R/BZ
3094      X\x0d\x0a      X\x0d\x0a
3095    
 /-- Perl treats this one differently, not failing the second string. I believe  
     that is a bug in Perl. --/  
   
 /^((abc|abcx)(*THEN)y|abcd)/  
     abcd  
     *** Failers  
     abcxy  
   
3096  /(?<=abc)def/  /(?<=abc)def/
3097      abc\P\P      abc\P\P
3098    
# Line 3427  with \Y. ---/ Line 3391  with \Y. ---/
3391    
3392  /\btype\b\W*?\btext\b\W*?\bjavascript\b|\burl\b\W*?\bshell:|<input\b.*?\btype\b\W*?\bimage\b|\bonkeyup\b\W*?\=/IS  /\btype\b\W*?\btext\b\W*?\bjavascript\b|\burl\b\W*?\bshell:|<input\b.*?\btype\b\W*?\bimage\b|\bonkeyup\b\W*?\=/IS
3393    
3394  /a(*SKIP)c|b(*ACCEPT)|/+SI  /a(*SKIP)c|b(*ACCEPT)|/+S!I
3395      a      a
3396    
3397  /a(*SKIP)c|b(*ACCEPT)cd(*ACCEPT)|x/SI  /a(*SKIP)c|b(*ACCEPT)cd(*ACCEPT)|x/SI
# Line 3453  with \Y. ---/ Line 3417  with \Y. ---/
3417  /a(?:.(*THEN:ABC))*?a/ims  /a(?:.(*THEN:ABC))*?a/ims
3418      \Mabbbbbbbbbbbbbbbbbbbbba      \Mabbbbbbbbbbbbbbbbbbbbba
3419    
 /-- These tests are in agreement with development Perl 5.015, which has fixed  
     some things, but they don't all work with 5.012, so they aren't in the  
     Perl-compatible tests. Those after the first come from Perl's own test  
     files. --/  
   
 /^((yes|no)(*THEN)(*F))?/  
   yes  
   
 /(A (.*)   C? (*THEN)  | A D) (*FAIL)/x  
 AbcdCBefgBhiBqz  
   
 /(A (.*)   C? (*THEN)  | A D) z/x  
 AbcdCBefgBhiBqz  
   
 /(A (.*)   C? (*THEN)  | A D) \s* (*FAIL)/x  
 AbcdCBefgBhiBqz  
   
 /(A (.*)   C? (*THEN)  | A D) \s* z/x  
 AbcdCBefgBhiBqz  
   
 /(A (.*)   (?:C|) (*THEN)  | A D) (*FAIL)/x  
 AbcdCBefgBhiBqz  
   
 /(A (.*)   (?:C|) (*THEN)  | A D) z/x  
 AbcdCBefgBhiBqz  
   
 /(A (.*)   C{0,6} (*THEN)  | A D) (*FAIL)/x  
 AbcdCBefgBhiBqz  
   
 /(A (.*)   C{0,6} (*THEN)  | A D) z/x  
 AbcdCBefgBhiBqz  
   
 /(A (.*)   (CE){0,6} (*THEN)  | A D) (*FAIL)/x  
 AbcdCEBefgBhiBqz  
   
 /(A (.*)   (CE){0,6} (*THEN)  | A D) z/x  
 AbcdCEBefgBhiBqz  
   
 /(A (.*)   (CE*){0,6} (*THEN)  | A D) (*FAIL)/x  
 AbcdCBefgBhiBqz  
   
 /(A (.*)   (CE*){0,6} (*THEN)  | A D) z/x  
 AbcdCBefgBhiBqz  
   
 /-----------------------------------------------/  
   
3420  /^(?>a+)(?>(z+))\w/BZ  /^(?>a+)(?>(z+))\w/BZ
3421      aaaazzzzb      aaaazzzzb
3422      ** Failers      ** Failers
# Line 3751  replaced by single letters. --/ Line 3669  replaced by single letters. --/
3669      \r\r\r\P      \r\r\r\P
3670      \r\r\r\P\P      \r\r\r\P\P
3671    
3672  /-- These two are here because Perl does not match: it seems to allow the  "AB(C(D))(E(F))?(?(?=\2)(?=\4))"
3673  COMMIT to escape from the assertion. --/      ABCDGHI\O03
3674    
3675    /-- These are all run as real matches in test 1; here we are just checking the
3676    settings of the anchored and startline bits. --/
3677    
3678  /(?=a(*COMMIT)b|ac)ac|ac/  /(?>.*?a)(?<=ba)/I
     ac  
3679    
3680  /(?=a(*COMMIT)b|(ac)) ac | (a)c/x  /(?:.*?a)(?<=ba)/I
     ac  
3681    
3682  "AB(C(D))(E(F))?(?(?=\2)(?=\4))"  /.*?a(*PRUNE)b/I
3683      ABCDGHI\O03  
3684    /.*?a(*PRUNE)b/sI
3685    
3686    /^a(*PRUNE)b/sI
3687    
3688    /.*?a(*SKIP)b/I
3689    
3690    /(?>.*?a)b/sI
3691    
3692    /(?>.*?a)b/I
3693    
3694    /(?>^a)b/sI
3695    
3696    /(?>.*?)(?<=(abcd)|(wxyz))/I
3697    
3698    /(?>.*)(?<=(abcd)|(wxyz))/I
3699    
3700    "(?>.*)foo"I
3701    
3702    "(?>.*?)foo"I
3703    
3704    /(?>^abc)/mI
3705    
3706    /(?>.*abc)/mI
3707    
3708    /(?:.*abc)/mI
3709    
3710    /-- Check PCRE_STUDY_EXTRA_NEEDED --/
3711    
3712    /.?/S-I
3713    
3714    /.?/S!I
3715    
3716    /(?:(a)+(?C1)bb|aa(?C2)b)/
3717        aab\C+
3718    
3719    /(?:(a)++(?C1)bb|aa(?C2)b)/
3720        aab\C+
3721    
3722    /(?:(?>(a))(?C1)bb|aa(?C2)b)/
3723        aab\C+
3724    
3725    /(?:(?1)(?C1)x|ab(?C2))((a)){0}/
3726        aab\C+
3727    
3728    /(?1)(?C1)((a)(?C2)){0}/
3729        aab\C+
3730    
3731    /(?:(a)+(?C1)bb|aa(?C2)b)++/
3732        aab\C+
3733        aab\C+\O2
3734    
3735    /(ab)x|ab/
3736        ab\O3
3737        ab\O2
3738    
3739    /(ab)/
3740        ab\O3
3741        ab\O2
3742    
3743    /(?<=123)(*MARK:xx)abc/K
3744        xxxx123a\P\P
3745        xxxx123a\P
3746    
3747    /123\Kabc/
3748        xxxx123a\P\P
3749        xxxx123a\P
3750    
3751    /^(?(?=a)aa|bb)/C
3752        bb
3753    
3754    /(?C1)^(?C2)(?(?C99)(?=(?C3)a(?C4))(?C5)a(?C6)a(?C7)|(?C8)b(?C9)b(?C10))(?C11)/
3755        bb
3756    
3757    /-- Perl seems to have a bug with this one --/
3758    
3759    /aaaaa(*COMMIT)(*PRUNE)b|a+c/
3760        aaaaaac
3761    
3762    /-- Here are some that Perl treats differently because of the way it handles
3763    backtracking verbs. --/
3764    
3765     /^(?!a(*SKIP)b)/
3766         ac
3767    
3768     /^(?!a(*SKIP)b)../
3769         acd
3770    
3771    /(?!a(*SKIP)b)../
3772         acd
3773    
3774    /^(?(?!a(*SKIP)b))/
3775         ac
3776    
3777    /^(?!a(*PRUNE)b)../
3778         acd
3779    
3780    /(?!a(*PRUNE)b)../
3781         acd
3782    
3783     /(?!a(*COMMIT)b)ac|cd/
3784         ac
3785    
3786     /(?!a(*COMMIT)b)ac|ad/
3787         ac
3788         ad
3789    
3790    /^(?!a(*THEN)b|ac)../
3791         ac
3792         ad
3793    
3794    /^(?=a(*THEN)b|ac)/
3795        ac
3796    
3797  /-- This one is here because Perl does not confine the *COMMIT to the  /\A.*?(?:a|b(*THEN)c)/
3798  assertion, and therefore fails the entire subroutine call. --/      ba
3799    
3800    /\A.*?(?:a|bc)/
3801        ba
3802    
3803    /\A.*?(?:a|b(*THEN)c)++/
3804        ba
3805    
3806    /\A.*?(?:a|b(*THEN)c|d)/
3807        ba
3808    
3809    /(?:(a(*MARK:X)a+(*SKIP:X)b)){0}(?:(?1)|aac)/
3810        aac
3811    
3812    /\A.*?(a|b(*THEN)c)/
3813        ba
3814    
3815    /^(A(*THEN)B|C(*THEN)D)/
3816        CD
3817    
3818    /^(A(*THEN)B|A(*THEN)D)/
3819        AD
3820    
3821  /((?=a(*COMMIT)b)ab|ac){0}(?:(?1)|a(c))/  /(?!b(*THEN)a)bn|bnn/
3822      ac      bnn
3823    
3824    /(?(?=b(*SKIP)a)bn|bnn)/
3825        bnn
3826    
3827    /(?=b(*THEN)a|)bn|bnn/
3828        bnn
3829    
3830    /-------------------------/
3831    
3832  /-- End of testinput2 --/  /-- End of testinput2 --/

Legend:
Removed from v.972  
changed lines
  Added in v.1302

  ViewVC Help
Powered by ViewVC 1.1.5