Advertisement
GamerBhai02

APP Exp 2

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