Use match rather than search

This commit is contained in:
Erik Johnston 2018-10-19 10:26:50 +01:00
parent 3c580c2b47
commit 47a9ba435d

View File

@ -92,10 +92,11 @@ class _AliasRule(object):
boolean
"""
if not self._user_id_regex.search(user_id):
# Note: The regexes are anchored at both ends
if not self._user_id_regex.match(user_id):
return False
if not self._alias_regex.search(alias):
if not self._alias_regex.match(alias):
return False
return True