utils: Style fix and simplify a bit the VALID_USERNAME_RE

This commit is contained in:
Dmitry D. Chernov 2020-03-31 19:18:57 +10:00
parent 1669d80082
commit 0ec612d71a

View File

@ -64,7 +64,7 @@ TG_JOIN_RE = re.compile(
#
# See https://telegram.org/blog/inline-bots#how-does-it-work
VALID_USERNAME_RE = re.compile(
r'^([a-z]((?!__)[\w\d]){3,30}[a-z\d]'
r'^([a-z](?:(?!__)\w){3,30}[a-z\d]'
r'|gif|vid|pic|bing|wiki|imdb|bold|vote|like|coub)$',
re.IGNORECASE
)