Skip to content

Instantly share code, notes, and snippets.

@felipehummel
Created February 10, 2012 22:13
Show Gist options
  • Save felipehummel/1793431 to your computer and use it in GitHub Desktop.
Save felipehummel/1793431 to your computer and use it in GitHub Desktop.
scala regex
val Regex = """\(([0-9]+),[0-9]+,'([^']+)','[^']*',[0-9]+,[0-9]+,[0-9]+,[0-9.]+,'[0-9]+',[0-9]+,[0-9]+,[0-9]+\)""".r
io.Source.fromFile("ptwiki-20120126-page.sql").getLines().foreach { line =>
Regex.findAllIn(line).foreach {
case Regex(id, title) => println(id + " :: "+title)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment