def is_valid_email ( email ) : pattern = re . compile ( r'[\w\.-]+@[\w\.-]+[.]\w+' ) return bool ( pattern . match ( email ) )
regular expression for valid email address in python
Check if email is valid
def is_valid_email(email):
    """
    Check if email is valid
    """
    pattern = re.compile(r'[\w\.-]+@[\w\.-]+[.]\w+')
    return bool(pattern.match(email))