Created
February 10, 2012 22:13
-
-
Save felipehummel/1793431 to your computer and use it in GitHub Desktop.
scala regex
This file contains hidden or 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
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