Skip to content

Instantly share code, notes, and snippets.

@kent
Created November 15, 2011 02:35
Show Gist options
  • Select an option

  • Save kent/1365956 to your computer and use it in GitHub Desktop.

Select an option

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