Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
scala.util.matching.Regex.replaceAll
val matchAll = new Regex(".*")
matchAll.replaceAllIn("I have no money", m => m.matched)
// I have no money
matchAll.replaceAllIn("I have $0", m => m.matched)
// I have I have $0
matchAll.replaceAllIn("I have $1", m => m.matched)
// java.lang.IndexOutOfBoundsException: No group 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.