Skip to content

Instantly share code, notes, and snippets.

@rafapolo
Created April 27, 2010 15:19
Show Gist options
  • Save rafapolo/380857 to your computer and use it in GitHub Desktop.
Save rafapolo/380857 to your computer and use it in GitHub Desktop.
Pega todos os emails entre os dados de um .txt
emails_pattern = Regexp.new(/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b/)
emails_list = File.open("arquivao.txt").read.scan(emails_pattern).uniq.sort
puts "#{email_list.count} emails encontrados."
@rafapolo
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment