Skip to content

Instantly share code, notes, and snippets.

@kent
Created November 15, 2011 02:35
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 kent/1365956 to your computer and use it in GitHub Desktop.
Save kent/1365956 to your computer and use it in GitHub Desktop.
Email Sieve
f = File.open("")
content = f.read
r = Regexp.new(/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b/)
emails = content.scan(r).uniq
puts emails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment