You are viewing a single comment's thread. Return to all comments →
import re def fun(s): try: username, website = s.split("@") web, extension = website.split(".", 1) except ValueError: return False username_pattern = r'^[a-zA-Z0-9_-]+$' web_pattern = r'^[a-zA-Z0-9]+$' extension_pattern = r'^[a-z]+$' if re.match(username_pattern, username) and re.match(web_pattern, web) and re.match(extension_pattern, extension) and 1<= len(extension)<=3: return True return False
Seems like cookies are disabled on this browser, please enable them to open this website
Validating Email Addresses With a Filter
You are viewing a single comment's thread. Return to all comments →