次の簡単なアプリがあります。
object TestPatternMatch extends App {
  if (args.length != 1)
    throw new IllegalArgumentException("takes one argument which is a regex string that will be used to limit the org deletion")
  val pattern = args(0).r
  println("looking for orgs with name matching regex: " + pattern)
  val orgs = Seq("zephyr-test-123", "abcdef", "zephyr-test-xyz-xyz-xyz")
  orgs.foreach {
    _ match {
      case pattern(x) ⇒ println("matched " + x)
      case y          ⇒ println("failed to match " + y)
    }
  }
}
以下のように呼び出すと、1 番目と 3 番目の組織で一致することを期待していました。私は何を逃したのですか?
[info] Running TestPatternMatch zephyr-test-.*
looking for orgs with name matching regex: zephyr-test-.*
failed to match zephyr-test-123
failed to match abcdef
failed to match zephyr-test-xyz-xyz-xyz