We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Validating Email Addresses With a Filter
Validating Email Addresses With a Filter
Sort by
recency
|
560 Discussions
|
Please Login in order to post a comment
if s.count('@') != 1 or s.count('.') != 1 or s.count('@')< 1 or s.count('.')< 1: return False try: un = lambda s: s.split('@')[0], web = lambda s: s.split('.')[0], ext = lambda s: s.split('.')[1] except: return False except: if lambda s: s.find('.') 3): return False
finally: return True
did without any functions but i guess using re would have been much simpler
import re def fun(s): for line in s: line = line.rstrip() if re.search('^[a-zA-Z0-9_-]+@[a-zA-Z0-9]+.[a-zA-Z0-9][a-z]{1,2}$',s): mystring = ' '.join(s) sorted(mystring) return True else: return False