fork download
  1. object Main extends App {
  2. val Pattern = "^(.*)@(.*)$".r
  3. "my-email@seznam.cz" match {
  4. case Pattern(name, domain) => println(s"Got a match! name = $name and domain = $domain")
  5. case _ => println("No match found.")
  6. }
  7. }
  8.  
Success #stdin #stdout 0.41s 322432KB
stdin
Standard input is empty
stdout
Got a match! name = my-email and domain = seznam.cz