Skip to content

Instantly share code, notes, and snippets.

@prakashrd
Created July 5, 2018 08:45
Show Gist options
  • Save prakashrd/e60c860181adafc97ac7f2e69c51db28 to your computer and use it in GitHub Desktop.
Save prakashrd/e60c860181adafc97ac7f2e69c51db28 to your computer and use it in GitHub Desktop.
Scala Regex
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