mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-25 10:28:39 +00:00
Merge branch 'create-is-valid-email' of https://github.com/caedenph/python into create-is-valid-email
This commit is contained in:
commit
60ca06bfee
@ -31,7 +31,7 @@ email_tests: tuple[tuple[str, bool], ...] = (
|
|||||||
False,
|
False,
|
||||||
),
|
),
|
||||||
("i.like.underscores@but_its_not_allowed_in_this_part", False),
|
("i.like.underscores@but_its_not_allowed_in_this_part", False),
|
||||||
("", False)
|
("", False),
|
||||||
)
|
)
|
||||||
|
|
||||||
# The maximum octets (one character as a standard unicode character is one byte)
|
# The maximum octets (one character as a standard unicode character is one byte)
|
||||||
@ -88,12 +88,8 @@ def is_valid_email_address(email: str) -> bool:
|
|||||||
):
|
):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# (4.) Validate the placement of "." characters
|
# (4.) Validate the placement of "." characters in the local-part
|
||||||
if (
|
if local_part.startswith(".") or local_part.endswith(".") or ".." in local_part:
|
||||||
local_part.startswith(".")
|
|
||||||
or local_part.endswith(".")
|
|
||||||
or ".." in local_part
|
|
||||||
):
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# (5.) Validate the characters in the domain
|
# (5.) Validate the characters in the domain
|
||||||
|
Loading…
x
Reference in New Issue
Block a user