Skip to content

Instantly share code, notes, and snippets.

@craigsdennis
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save craigsdennis/090e64bf8f1975614eb7 to your computer and use it in GitHub Desktop.
Save craigsdennis/090e64bf8f1975614eb7 to your computer and use it in GitHub Desktop.
Regular Expressions example in Scala
val title = "Regular Expressions in 10 different languages"
val pattern = """(\d+)""".r.unanchored
title match {
case pattern(total) => s"There are $total languages represented."
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment