Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open('maildata.txt','r') as file:
- data = file.read()
- email_pattern = r'[a-zA-Z0-9.!$%-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,}'
- emails = re.findall(email_pattern, data)
- for email in emails:
- print(email)
- 1. jane.doe@example.com
- 2. mike-smith99@webmail.org
- 3. emma!jones@domain.net
- 4. alex-wilson$321@company.co
- 5. lucy.davis@partnermail.com
- 6. john_doe-123!@gmail.com
- 7. kate%ryan@service.org
- 8. james!watson@provider.net
- 9. susan$lee-987@company.com
- 10. robert-allen!567@webmail.co
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement