# New Ticket Created by  Sam S. 
# Please include the string:  [perl #131973]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=131973 >


Based on S05, these test-cases should all pass:

     is "ab" ~~ / [ab | a ] b /, "ab", 'normal backtracking';
     is "ab" ~~ / [ab | a ]: b /, Nil, 'locally disabled backtracking';
     is "ab" ~~ / :r [ab | a ] b /, Nil, 'globally disabled backtracking';
     is "ab" ~~ / :r [ab | a ]:! b /, "ab", 'globally disabled but 
locally re-enabled backtracking';

In current Rakudo, the first three pass but the last one fails (it 
refuses to backtrack into the alternation and thus returns no Match).

According to S05 that's a bug:

"The new :r or :ratchet modifier causes this regex to not backtrack by 
default. [...] Explicit backtracking modifiers on quantified atoms[...] 
will override this.
-- http://design.perl6.org/S05.html#line_624

Related to RT #130117.

Reply via email to