Skip to content
Snippets Groups Projects
Commit 248a0f6d authored by Guillaume Chanel's avatar Guillaume Chanel
Browse files

Update email regexpr

The former one was not working correctly. I shamelessly used one
taken from:
https://uibakery.io/regex-library/email-regex-python
parent be854eae
Branches
No related tags found
No related merge requests found
Pipeline #19597 passed
......@@ -6,7 +6,7 @@ import re
import logging
email_regex = re.compile(r'^([A-Za-z0-9]+[.-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(\.[A-Z|a-z]{2,})+$')
email_regex = re.compile(r"^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$")
def is_valid_email(email: str) -> bool:
is_valid = re.fullmatch(email_regex, email) is not None
if not is_valid:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment