From debf04556bcf7b156d9a5e94311e2c03185e6cea Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 4 May 2018 01:15:15 +0100 Subject: [PATCH] fix user in user regexp --- synapse/rest/client/v2_alpha/register.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/rest/client/v2_alpha/register.py b/synapse/rest/client/v2_alpha/register.py index 36676c9fa8..31554e7879 100644 --- a/synapse/rest/client/v2_alpha/register.py +++ b/synapse/rest/client/v2_alpha/register.py @@ -405,7 +405,7 @@ class RegisterRestServlet(RestServlet): break except SynapseError as e: if e.errcode == Codes.USER_IN_USE: - m = re.match(r'^(.*)(\d+)$', desired_username) + m = re.match(r'^(.*?)(\d+)$', desired_username) if m: desired_username = m.group(1) + str( int(m.group(2)) + 1