Example & Tutorial understanding programming in easy ways.

Write a reg expression that confirms an Email Id using the Python Regular Expression module 'Re' ?

Example-

first-part@second.third


-Here first may be any number or character thats why 0-9a-zA-Z, 

-then in second part we only allow characters thats by a-zA-Z

-Then third part may be com/co/in


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

Read More →