> > > ... > > > "y" ~~ /(x)|(y)/ I would probably take advantage of the composability of Raku regexes, and do something like
my regex x { x } my regex y { y } and then use / <x> | <y> / and check for $<x> or $<y> > > S:g[(x)|(y)] = $0 ?? x-replacement !! y-replacement e.g. this becomes S:g[<x>|<y>] = $<x> ?? x-replacement !! y-replacement Brian