Advertisement
elena1234

email validation in Python with RegEx

Feb 10th, 2022 (edited)
1,279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. import re
  2.  
  3. pattern = re.compile(r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)")
  4. emails = ["emiliq_g@gmail.com", "ivanP@gmail.com", "124@"]
  5. for email in emails:
  6.     if pattern.match(email):
  7.         print(email)
  8.        
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement