Created
April 27, 2010 15:19
-
-
Save rafapolo/380857 to your computer and use it in GitHub Desktop.
Pega todos os emails entre os dados de um .txt
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
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." |
Author
rafapolo
commented
Apr 27, 2010
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment