Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- f = open('Emails.txt')
- valid = []
- invalid = []
- i = 0
- regexp = r'^((\w+)|(\.|-)?)+@((\w+|-|_)+\.[a-zA-Z0-9-.]+$'
- for email in f.readlines():
- print(i)
- print(email)
- i += 1
- email = email.strip()
- if re.match(r"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$", email):
- valid.append(email)
- else:
- invalid.append(email)
- print(invalid)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement