diff --git a/telematrix/__init__.py b/telematrix/__init__.py
index bdb7154..f4e92c3 100644
--- a/telematrix/__init__.py
+++ b/telematrix/__init__.py
@@ -98,7 +98,7 @@ def format_matrix_msg(form, username, content):
:return: The formatted string.
"""
if 'format' in content and content['format'] == 'org.matrix.custom.html':
- re.sub("(.+?)".format(MATRIX_HOST_BARE), "\\2", content['formatted_body'])
+ re.sub("(.+?)".format(MATRIX_HOST_BARE), "\\2", content['formatted_body'])
sanitized = sanitize_html(content['formatted_body'])
return html.escape(form).format(username, sanitized), 'HTML'
else: