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

Diff of /code/trunk/testdata/testinput11

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

revision 500 by ph10, Sat Mar 6 19:00:29 2010 UTC revision 642 by ph10, Thu Jul 28 18:59:40 2011 UTC
# Line 1  Line 1 
1  /-- These tests are for the Perl 5.10 features that PCRE supports. --/  /-- These tests are for the Perl >= 5.10 features that PCRE supports. --/
2    
3  /\H\h\V\v/  /\H\h\V\v/
4      X X\x0a      X X\x0a
# Line 246  Line 246 
246      aaabccc      aaabccc
247    
248  /(A (A|B(*ACCEPT)|C) D)(E)/x  /(A (A|B(*ACCEPT)|C) D)(E)/x
249        AB
250      ABX      ABX
251      AADE      AADE
252      ACDE      ACDE
# Line 379  Line 380 
380      a(b)c      a(b)c
381      a(b(c)d)e      a(b(c)d)e
382    
383    /(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))/
384        0
385        00
386        0000
387    
388    /(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))/
389        0
390        00
391        0000
392    
393    /--- This one does fail, as expected, in Perl. It needs the complex item at the
394         end of the pattern. A single letter instead of (B|D) makes it not fail,
395         which I think is a Perl bug. --- /
396    
397    /A(*COMMIT)(B|D)/
398        ACABX
399    
400    /--- Check the use of names for failure ---/
401    
402    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
403        ** Failers
404        AC
405        CB
406    
407    /--- Force no study, otherwise mark is not seen. The studied version is in
408         test 2 because it isn't Perl-compatible. ---/
409    
410    /(*MARK:A)(*SKIP:B)(C|X)/KSS
411        C
412        D
413    
414    /^(A(*THEN:A)B|C(*THEN:B)D)/K
415        ** Failers
416        CB
417    
418    /^(?:A(*THEN:A)B|C(*THEN:B)D)/K
419        CB
420    
421    /^(?>A(*THEN:A)B|C(*THEN:B)D)/K
422        CB
423    
424    /--- This should succeed, as the skip causes bump to offset 1 (the mark). Note
425    that we have to have something complicated such as (B|Z) at the end because,
426    for Perl, a simple character somehow causes an unwanted optimization to mess
427    with the handling of backtracking verbs. ---/
428    
429    /A(*MARK:A)A+(*SKIP:A)(B|Z) | AC/xK
430        AAAC
431    
432    /--- Test skipping over a non-matching mark. ---/
433    
434    /A(*MARK:A)A+(*MARK:B)(*SKIP:A)(B|Z) | AC/xK
435        AAAC
436    
437    /--- Check shorthand for MARK ---/
438    
439    /A(*:A)A+(*SKIP:A)(B|Z) | AC/xK
440        AAAC
441    
442    /--- Don't loop! Force no study, otherwise mark is not seen. ---/
443    
444    /(*:A)A+(*SKIP:A)(B|Z)/KSS
445        AAAC
446    
447    /--- This should succeed, as a non-existent skip name disables the skip ---/
448    
449    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/xK
450        AAAC
451    
452    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC(*:B)/xK
453        AAAC
454    
455    /--- We use something more complicated than individual letters here, because
456    that causes different behaviour in Perl. Perhaps it disables some optimization;
457    anyway, the result now matches PCRE in that no tag is passed back for the
458    failures. ---/
459    
460    /(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/xK
461        AABC
462        XXYZ
463        ** Failers
464        XAQQ
465        XAQQXZZ
466        AXQQQ
467        AXXQQQ
468    
469    /--- COMMIT at the start of a pattern should act like an anchor. Again,
470    however, we need the complication for Perl. ---/
471    
472    /(*COMMIT)(A|P)(B|P)(C|P)/
473        ABCDEFG
474        ** Failers
475        DEFGABC
476    
477    /--- COMMIT inside an atomic group can't stop backtracking over the group. ---/
478    
479    /(\w+)(?>b(*COMMIT))\w{2}/
480        abbb
481    
482    /(\w+)b(*COMMIT)\w{2}/
483        abbb
484    
485    /--- Check opening parens in comment when seeking forward reference. ---/
486    
487    /(?&t)(?#()(?(DEFINE)(?<t>a))/
488        bac
489    
490    /--- COMMIT should override THEN ---/
491    
492    /(?>(*COMMIT)(?>yes|no)(*THEN)(*F))?/
493      yes
494    
495    /(?>(*COMMIT)(yes|no)(*THEN)(*F))?/
496      yes
497    
498    /^((yes|no)(*THEN)(*F))?/
499      yes
500    
501    /b?(*SKIP)c/
502        bc
503        abc
504    
505    /(*SKIP)bc/
506        a
507    
508    /(*SKIP)b/
509        a
510    
511    /(?P<abn>(?P=abn)xxx|)+/
512        xxx
513    
514    /(?i:([^b]))(?1)/
515        aa
516        aA
517        ** Failers
518        ab
519        aB
520        Ba
521        ba
522    
523    /^(?&t)*+(?(DEFINE)(?<t>a))\w$/
524        aaaaaaX
525        ** Failers
526        aaaaaa
527    
528    /^(?&t)*(?(DEFINE)(?<t>a))\w$/
529        aaaaaaX
530        aaaaaa
531    
532    /^(a)*+(\w)/
533        aaaaX
534        YZ
535        ** Failers
536        aaaa
537    
538    /^(?:a)*+(\w)/
539        aaaaX
540        YZ
541        ** Failers
542        aaaa
543    
544    /^(a)++(\w)/
545        aaaaX
546        ** Failers
547        aaaa
548        YZ
549    
550    /^(?:a)++(\w)/
551        aaaaX
552        ** Failers
553        aaaa
554        YZ
555    
556    /^(a)?+(\w)/
557        aaaaX
558        YZ
559    
560    /^(?:a)?+(\w)/
561        aaaaX
562        YZ
563    
564    /^(a){2,}+(\w)/
565        aaaaX
566        ** Failers
567        aaa
568        YZ
569    
570    /^(?:a){2,}+(\w)/
571        aaaaX
572        ** Failers
573        aaa
574        YZ
575    
576    /(a|)*(?1)b/
577        b
578        ab
579        aab
580    
581    /(a)++(?1)b/
582        ** Failers
583        ab
584        aab
585    
586    /(a)*+(?1)b/
587        ** Failers
588        ab
589        aab
590    
591    /(?1)(?:(b)){0}/
592        b
593    
594    /(foo ( \( ((?:(?> [^()]+ )|(?2))*) \) ) )/x
595        foo(bar(baz)+baz(bop))
596    
597    /(A (A|B(*ACCEPT)|C) D)(E)/x
598        AB
599    
600    /\A.*?(?:a|b(*THEN)c)/
601        ba
602    
603    /\A.*?(?:a|bc)/
604        ba
605    
606    /\A.*?(a|b(*THEN)c)/
607        ba
608    
609    /\A.*?(a|bc)/
610        ba
611    
612    /\A.*?(?:a|b(*THEN)c)++/
613        ba
614    
615    /\A.*?(?:a|bc)++/
616        ba
617    
618    /\A.*?(a|b(*THEN)c)++/
619        ba
620    
621    /\A.*?(a|bc)++/
622        ba
623    
624    /\A.*?(?:a|b(*THEN)c|d)/
625        ba
626    
627    /\A.*?(?:a|bc|d)/
628        ba
629    
630    /(?:(b))++/
631        beetle
632    
633    /(?(?=(a(*ACCEPT)z))a)/
634        a
635    
636    /^(a)(?1)+ab/
637        aaaab
638    
639    /^(a)(?1)++ab/
640        aaaab
641    
642    /^(?=a(*:M))aZ/K
643        aZbc
644    
645    /^(?!(*:M)b)aZ/K
646        aZbc
647    
648    /(?(DEFINE)(a))?b(?1)/
649        backgammon
650    
651    /^\N+/
652        abc\ndef
653    
654    /^\N{1,}/
655        abc\ndef
656    
657    /(?(R)a+|(?R)b)/
658        aaaabcde
659    
660    /(?(R)a+|((?R))b)/
661        aaaabcde
662    
663    /((?(R)a+|(?1)b))/
664        aaaabcde
665    
666    /((?(R1)a+|(?1)b))/
667        aaaabcde
668    
669  /-- End of testinput11 --/  /-- End of testinput11 --/

Legend:
Removed from v.500  
changed lines
  Added in v.642

  ViewVC Help
Powered by ViewVC 1.1.5