fixing quotes, no escape characters in tests, fixed anchors

This commit is contained in:
alwaysjolley
2020-06-03 12:49:55 -04:00
parent 3ce7cd6c50
commit 1b8507636b
2 changed files with 18 additions and 18 deletions

View File

@ -35,7 +35,7 @@ def is_valid_domain(domain):
domain = domain[:-1]
if len(domain) > 253:
return False
fqdn_re = re.compile("(?=^.{1,63}$)(^(?:[a-z0-9](?:-*[a-z0-9])+)|[a-z0-9]$)", re.IGNORECASE)
fqdn_re = re.compile("(?=^.{1,63}$)(^(?:[a-z0-9](?:-*[a-z0-9])+)$|^[a-z0-9]$)", re.IGNORECASE)
return all(fqdn_re.match(d) for d in domain.split("."))