title: How to pattern match multiple values in Scala?
body: <p>Let's say I want to handle multiple return values from a remote service using the same code. I don't know how to express this in Scala:</p>
  
  <pre><code>code match {
    case "1" =&gt; // Whatever
    case "2" =&gt; // Same whatever
    case "3" =&gt; // Ah, something different
  }
  </code></pre>
  
  <p>I know I can use Extract Method and call that, but there's still repetition in the call. If I were using Ruby, I'd write it like this:</p>
  
  <pre><code>case code
  when "1", "2"
    # Whatever
  when "3"
    # Ah, something different
  end
  </code></pre>
  
  <p>Note that I simplified the example, thus I don't want to pattern match on regular expressions or some such. The match values are actually complex values.</p>