How to pattern match multiple values in Scala?
You can do: code match { case “1” | “2” => // whatever case “3” => } Note that you cannot bind parts of the pattern to names – you can’t do this currently: code match { case Left(x) | Right(x) => case null => }