/[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 454 by ph10, Tue Sep 22 09:42:11 2009 UTC revision 551 by ph10, Sun Oct 10 17:33:07 2010 UTC
# Line 283  Line 283 
283  /(?<X>a)(?<=b(?&X))/  /(?<X>a)(?<=b(?&X))/
284      baz      baz
285    
286    /^(?|(abc)|(def))\1/
287        abcabc
288        defdef
289        ** Failers
290        abcdef
291        defabc
292    
293    /^(?|(abc)|(def))(?1)/
294        abcabc
295        defabc
296        ** Failers
297        defdef
298        abcdef
299    
300    /(?:a(?<quote> (?<apostrophe>')|(?<realquote>")) |b(?<quote> (?<apostrophe>')|(?<realquote>")) ) (?('quote')[a-z]+|[0-9]+)/xJ
301        a\"aaaaa
302        b\"aaaaa
303        ** Failers
304        b\"11111
305    
306    /(?:(?1)|B)(A(*F)|C)/
307        ABCD
308        CCD
309        ** Failers
310        CAD
311    
312    /^(?:(?1)|B)(A(*F)|C)/
313        CCD
314        BCD
315        ** Failers
316        ABCD
317        CAD
318        BAD
319    
320    /(?:(?1)|B)(A(*ACCEPT)XX|C)D/
321        AAD
322        ACD
323        BAD
324        BCD
325        BAX
326        ** Failers
327        ACX
328        ABC
329    
330    /(?(DEFINE)(A))B(?1)C/
331        BAC
332    
333    /(?(DEFINE)((A)\2))B(?1)C/
334        BAAC
335    
336    /(?<pn> \( ( [^()]++ | (?&pn) )* \) )/x
337        (ab(cd)ef)
338    
339    /^(?!a(*SKIP)b)/
340        ac
341    
342    /^(?=a(*SKIP)b|ac)/
343        ** Failers
344        ac
345    
346    /^(?=a(*THEN)b|ac)/
347        ac
348    
349    /^(?=a(*PRUNE)b)/
350        ab
351        ** Failers
352        ac
353    
354    /^(?=a(*ACCEPT)b)/
355        ac
356    
357    /^(?(?!a(*SKIP)b))/
358        ac
359    
360    /(?>a\Kb)/
361        ab
362    
363    /((?>a\Kb))/
364        ab
365    
366    /(a\Kb)/
367        ab
368    
369    /^a\Kcz|ac/
370        ac
371    
372    /(?>a\Kbz|ab)/
373        ab
374    
375    /^(?&t)(?(DEFINE)(?<t>a\Kb))$/
376        ab
377    
378    /^([^()]|\((?1)*\))*$/
379        a(b)c
380        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  /-- End of testinput11 --/  /-- End of testinput11 --/

Legend:
Removed from v.454  
changed lines
  Added in v.551

  ViewVC Help
Powered by ViewVC 1.1.5