Python Developer Question:

Download Job Interview Questions and Answers PDF

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

Python Developer Interview Question
Python Developer Interview Question

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 Interview Questions And Answers PDF

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?