\w is not whitespace. Derp

This commit is contained in:
Jeffrey Goldberg 2023-11-27 01:01:31 -06:00
parent 0e3cdf7295
commit 0a6728e2d2
1 changed files with 2 additions and 2 deletions

View File

@ -1083,12 +1083,12 @@ class Connection(BaseModel):
# URL_PREFIX_RE = %r{\Ahttp(s?)://[^/]+}
pattern = re.compile(r"""
^\w* # ignore leading spaces
^\s* # ignore leading spaces
@? # Optional @ prefix
(?P<uname>[a-z0-9_]+([a-z0-9_.-]+[a-z0-9_]+)?) # username part
@ # separator
(?P<domain>[a-z0-9_]+([a-z0-9_.-]+[a-z0-9_]+)?) # domain part
\w*$ # ignore trailing whitespace
\s*$ # ignore trailing whitespace
""", re.VERBOSE | re.IGNORECASE)
m = pattern.match(id)