/[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 604 by ph10, Thu Jun 2 19:04:54 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 379  Line 379 
379      a(b)c      a(b)c
380      a(b(c)d)e      a(b(c)d)e
381    
382    /(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))/
383        0
384        00
385        0000
386    
387    /(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))/
388        0
389        00
390        0000
391    
392    /--- This one does fail, as expected, in Perl. It needs the complex item at the
393         end of the pattern. A single letter instead of (B|D) makes it not fail,
394         which I think is a Perl bug. --- /
395    
396    /A(*COMMIT)(B|D)/
397        ACABX
398    
399    /--- Check the use of names for failure ---/
400    
401    /^(A(*PRUNE:A)B|C(*PRUNE:B)D)/K
402        ** Failers
403        AC
404        CB
405    
406    /(*MARK:A)(*SKIP:B)(C|X)/K
407        C
408        D
409    
410    /^(A(*THEN:A)B|C(*THEN:B)D)/K
411        ** Failers
412        CB
413    
414    /^(?:A(*THEN:A)B|C(*THEN:B)D)/K
415        CB
416    
417    /^(?>A(*THEN:A)B|C(*THEN:B)D)/K
418        CB
419    
420    /--- This should succeed, as the skip causes bump to offset 1 (the mark). Note
421    that we have to have something complicated such as (B|Z) at the end because,
422    for Perl, a simple character somehow causes an unwanted optimization to mess
423    with the handling of backtracking verbs. ---/
424    
425    /A(*MARK:A)A+(*SKIP:A)(B|Z) | AC/xK
426        AAAC
427    
428    /--- Test skipping over a non-matching mark. ---/
429    
430    /A(*MARK:A)A+(*MARK:B)(*SKIP:A)(B|Z) | AC/xK
431        AAAC
432    
433    /--- Check shorthand for MARK ---/
434    
435    /A(*:A)A+(*SKIP:A)(B|Z) | AC/xK
436        AAAC
437    
438    /--- Don't loop! ---/
439    
440    /(*:A)A+(*SKIP:A)(B|Z)/K
441        AAAC
442    
443    /--- This should succeed, as a non-existent skip name disables the skip ---/
444    
445    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/xK
446        AAAC
447    
448    /A(*MARK:A)A+(*SKIP:B)(B|Z) | AC(*:B)/xK
449        AAAC
450    
451    /--- We use something more complicated than individual letters here, because
452    that causes different behaviour in Perl. Perhaps it disables some optimization;
453    anyway, the result now matches PCRE in that no tag is passed back for the
454    failures. ---/
455    
456    /(A|P)(*:A)(B|P) | (X|P)(X|P)(*:B)(Y|P)/xK
457        AABC
458        XXYZ
459        ** Failers
460        XAQQ
461        XAQQXZZ
462        AXQQQ
463        AXXQQQ
464    
465    /--- COMMIT at the start of a pattern should act like an anchor. Again,
466    however, we need the complication for Perl. ---/
467    
468    /(*COMMIT)(A|P)(B|P)(C|P)/
469        ABCDEFG
470        ** Failers
471        DEFGABC
472    
473    /--- COMMIT inside an atomic group can't stop backtracking over the group. ---/
474    
475    /(\w+)(?>b(*COMMIT))\w{2}/
476        abbb
477    
478    /(\w+)b(*COMMIT)\w{2}/
479        abbb
480    
481    /--- Check opening parens in comment when seeking forward reference. ---/
482    
483    /(?&t)(?#()(?(DEFINE)(?<t>a))/
484        bac
485    
486    /--- COMMIT should override THEN ---/
487    
488    /(?>(*COMMIT)(?>yes|no)(*THEN)(*F))?/
489      yes
490    
491    /(?>(*COMMIT)(yes|no)(*THEN)(*F))?/
492      yes
493    
494    /^((yes|no)(*THEN)(*F))?/
495      yes
496    
497    /b?(*SKIP)c/
498        bc
499        abc
500    
501    /(*SKIP)bc/
502        a
503    
504    /(*SKIP)b/
505        a
506    
507    /(?P<abn>(?P=abn)xxx|)+/
508        xxx
509    
510    /(?i:([^b]))(?1)/
511        aa
512        aA
513        ** Failers
514        ab
515        aB
516        Ba
517        ba
518    
519    /^(?&t)*+(?(DEFINE)(?<t>a))\w$/
520        aaaaaaX
521        ** Failers
522        aaaaaa
523    
524    /^(?&t)*(?(DEFINE)(?<t>a))\w$/
525        aaaaaaX
526        aaaaaa
527    
528    /^(a)*+(\w)/
529        aaaaX
530        YZ
531        ** Failers
532        aaaa
533    
534    /^(?:a)*+(\w)/
535        aaaaX
536        YZ
537        ** Failers
538        aaaa
539    
540    /^(a)++(\w)/
541        aaaaX
542        ** Failers
543        aaaa
544        YZ
545    
546    /^(?:a)++(\w)/
547        aaaaX
548        ** Failers
549        aaaa
550        YZ
551    
552    /^(a)?+(\w)/
553        aaaaX
554        YZ
555    
556    /^(?:a)?+(\w)/
557        aaaaX
558        YZ
559    
560    /^(a){2,}+(\w)/
561        aaaaX
562        ** Failers
563        aaa
564        YZ
565    
566    /^(?:a){2,}+(\w)/
567        aaaaX
568        ** Failers
569        aaa
570        YZ
571    
572    /(a|)*(?1)b/
573        b
574        ab
575        aab
576    
577    /(a)++(?1)b/
578        ** Failers
579        ab
580        aab
581    
582    /(a)*+(?1)b/
583        ** Failers
584        ab
585        aab
586    
587  /-- End of testinput11 --/  /-- End of testinput11 --/

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

  ViewVC Help
Powered by ViewVC 1.1.5