Python Developer Question:

Please write A Reg Expression That Confirms An Email Id Using The Python Reg Expression Module <Re>?

Tweet Share WhatsApp

Answer:

Python has a regular expression module <re>.

Check out the <re> expression that can check the email id for .com and .co.in subdomain.

import re
print(re.search(r"[0-9a-zA-Z.]+@[a-zA-Z]+.(com|co.in)$","jhon.sina@gmail.com"))

Download Python Developer PDF Read All 77 Python Developer Questions
Previous QuestionNext Question
Do you know what Are The Optional Statements That Can Be Used Inside A <Try-Except> Block In Python?Tell me what’s The Process To Get The Home Directory Using ‘~’ In Python?