Skip to content

Instantly share code, notes, and snippets.

@jegger
Created September 11, 2016 11:34
Show Gist options
  • Save jegger/2adceb4756712781943958653f79461d to your computer and use it in GitHub Desktop.
Save jegger/2adceb4756712781943958653f79461d to your computer and use it in GitHub Desktop.
def validateEmail(self, email):
"""This function validates the mail address given
in the argument: email.
"""
if len(email) > 7:
if re.match("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", email) != None:
return True
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment