# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #72234]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=72234 >


This be Rakudo db84bc on Parrot r43174.

$ perl6 -e 'say "abab" ~~ / (ab)+: ab / || "no match"'
no match

$ perl6 -e 'say "abab" ~~ / (a :: b)+: ab / || "no match"'
abab

This is a PGE bug, but I don't know where else to submit PGE bugs, and
they are expressed through Rakudo, so I'll submit it here.

The first expression prints 'no match', and it should. This is because
the ':' in the quantifier forbids the parenthesis group to backtrack
into itself. It needs to backtrack into itself because it greedily ate
both the 'ab' literals, when it should have saved one for dessert.

The second expression should also print 'no match', for the exact same
reasons. But it prints 'abab', which means it matches, which means it
backtracks into the parenthesized submatch. It should do so no more
than the first expression should -- adding '::' shouldn't change
things.

Reply via email to