Sometimes I have a long list and I would like to check whether a string matches anything in the list. I am trying to interpolate a junction inside a regex. They are all errors.
say "12345" ~~ m/ <{ (2,3,4).any }> /
Cannot resolve caller MAKE_REGEX(Int, Bool, Bool, Int, PseudoStash); none of these signatures match:
say "12345" ~~ m/ $( (2,3,4).any ) /
This type cannot unbox to a native string: P6opaque, Junction
Does this error message mean that junctions cannot be used inside regex interpolation?
The work-around I have is
say "12345" ~~ m/ <{ (2,3,4).join("||") }> /
「2」
How can I use junctions inside regex interpolation?