Validate Email Address using Regex in Python

Source code :

import re
email = "google@g.com fac@o.com 0.@com .com@hello"
print("email matches are:",len(re.findall("[\w._%+-]{1,20}@[\w.-]{2,20}[A-Za-z]{2,3}",email)))

Output :

email matches are :2

Output :


                

Comments :