import re def is_valid_email(email_address): """Validates if the email address provided is valid.""" regex = re.fullmatch(r"([-!#-'*+/-9=?A-Z^-~]+(\.[-!#-'*+/-9=?A-Z^-~]+)*|\"([]!#-[^-~ \t]|(\\[\t -~]))+\")@([-!#-'*+/-9=?A-Z^-~]+(\.[-!#-'*+/-9=?A-Z^-~]+)*|\[[\t -Z^-~]*])", str(email_address)) return regex is not None
Posted: March 21, 2023
Return to the snippets listing