Skip to content

Instantly share code, notes, and snippets.

@UberMouse
Created June 17, 2013 03:41
Show Gist options
  • Save UberMouse/5794521 to your computer and use it in GitHub Desktop.
Save UberMouse/5794521 to your computer and use it in GitHub Desktop.
object Main {
def main(args:Array[String]) {
val re = "[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?".r
val source = scala.io.Source.fromFile(args(0))
source.getLines
.filter(x => x.length > 0)
.map(x => re.findFirstIn(x) != None)
.foreach(println)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment