|Date:||Sun, 27 Aug 2017 19:03:29 +0200|
|To:||Rakudo Bugtracker <rakudobug [...] perl.org>|
|From:||Sam S <smls75 [...] gmail.com>|
|Subject:||[REGEX] Backtracking modifiers on individual atoms fail to override a regex-global `:ratchet` modifier.|
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. --Related to RT #130117.