Created
November 6, 2014 13:21
-
-
Save 2m/56d8af00aa9eba5daa37 to your computer and use it in GitHub Desktop.
Scala regexp unapply
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scala> val YearMonth = "([0-9]+)-([0-9]+)".r | |
YearMonth: scala.util.matching.Regex = ([0-9]+)-([0-9]+) | |
scala> val YearMonth(year, month) = "2014-11" | |
year: String = 2014 | |
month: String = 11 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment