# New Ticket Created by Ron Schmidt # Please include the string: [perl #130562] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=130562 >
So "42" ~~ / [ "0" || "42" ] | "4" / matches 4 but if you stick to just one kind of alternation: "42" ~~ / [ "0" | "42" ] | "4" / "42" ~~ / [ "0" || "42" ] || "4" / the match correctly comes back with 42. It looks like in the mixed case the "|" longest alternation is not picking the longest match which is a bug. A test might look like: is ~("42" ~~ / [ "0" || "42" ] | "4" /), "42", "mixed longest with grouped lexical alternation picks longest match";