Last active
August 29, 2015 14:16
-
-
Save timyates/94eff7f56822846fd2af to your computer and use it in GitHub Desktop.
Filed under "wouldn't it be nice" ;-)
This file contains 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
def matcher = ~/(?<year>\d\d\d\d)-(?<month>\d\d)-(?<day>\d\d)/ | |
switch('2014-10-10') { | |
case matcher: { year, month, day -> | |
println "On day $day of month $month, in the year $year" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Or indeed:
If you like typing ;-)