Hidden features of Scala
Okay, I had to add one more. Every Regex object in Scala has an extractor (see answer from oxbox_lakes above) that gives you access to the match groups. So you can do something like: // Regex to split a date in the format Y/M/D. val regex = “(\\d+)/(\\d+)/(\\d+)”.r val regex(year, month, day) = “2010/1/13” The … Read more