Created
July 5, 2018 08:45
-
-
Save prakashrd/e60c860181adafc97ac7f2e69c51db28 to your computer and use it in GitHub Desktop.
Scala Regex
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
scala> val s = """(\d+)-(\d+)-(\d+).*""".r | |
s: scala.util.matching.Regex = (\d+)-(\d+)-(\d+).* | |
scala> val s(a,b,c) = "20-30-04 jfa" | |
a: String = 20 | |
b: String = 30 | |
c: String = 04 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment