fix: email reg (#135)

This commit is contained in:
Joel
2023-05-22 10:39:51 +08:00
committed by GitHub
parent 4db01403ae
commit 17a8118154
4 changed files with 6 additions and 6 deletions

View File

@@ -21,7 +21,7 @@ class TimestampField(fields.Raw):
def email(email):
# Define a regex pattern for email addresses
pattern = r"^[\w\.-]+@([\w-]+\.)+[\w-]{2,4}$"
pattern = r"^[\w\.-]+@([\w-]+\.)+[\w-]{2,}$"
# Check if the email matches the pattern
if re.match(pattern, email) is not None:
return email