Fix raw strings in URL pattern (#5972)

Add missing raw string specifiers.
This commit is contained in:
Adriane Boyd 2020-08-26 04:00:49 +02:00 committed by GitHub
parent 332803eda9
commit 7d7b65ffd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -37,13 +37,13 @@ URL_PATTERN = (
r"|"
# host & domain names
# mods: match is case-sensitive, so include [A-Z]
"(?:" # noqa
"(?:"
"[A-Za-z0-9\u00a1-\uffff]"
"[A-Za-z0-9\u00a1-\uffff_-]{0,62}"
")?"
"[A-Za-z0-9\u00a1-\uffff]\."
")+"
r"(?:" # noqa
r"(?:"
r"[A-Za-z0-9\u00a1-\uffff]"
r"[A-Za-z0-9\u00a1-\uffff_-]{0,62}"
r")?"
r"[A-Za-z0-9\u00a1-\uffff]\."
r")+"
# TLD identifier
# mods: use ALPHA_LOWER instead of a wider range so that this doesn't match
# strings like "lower.Upper", which can be split on "." by infixes in some