Created
January 27, 2015 03:08
-
-
Save JeremyHutchings/d27fd0ea06f570ea1259 to your computer and use it in GitHub Desktop.
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
val input = "Enjoying this apple 3.14159 times today" | |
//input: String = Enjoying this apple 3.14159 times today | |
val pattern = """.* apple ([\d.]+) times .*""".r | |
//pattern: scala.util.matching.Regex = .* apple ([\d.]+) times .* | |
val pattern(amountText) = input | |
//amountText: String = 3.14159 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment