diff --git a/files/helpers/regex.py b/files/helpers/regex.py
index 0d59e5e724..b456b985c3 100644
--- a/files/helpers/regex.py
+++ b/files/helpers/regex.py
@@ -9,7 +9,7 @@ valid_username_chars = 'a-zA-Z0-9_\-'
valid_username_regex = re.compile("^[a-zA-Z0-9_\-]{3,25}$", flags=re.A)
mention_regex = re.compile('(^|\s|>)@([a-zA-Z0-9_\-]{1,30})(?!([^<]*<\/(code|pre|a)>|[^`]*`))', flags=re.A)
-group_mention_regex = re.compile('(^|\s|>)!([a-z0-9_\-]{3,25})(?!([^<]*<\/(code|pre|a)>|[^`]*`))', flags=re.A)
+group_mention_regex = re.compile('(^|\s|>)!([a-z0-9_\-]{3,25})(?!([^<]*<\/(code|pre|a)>|[^`]*`))', flags=re.A|re.I)
everyone_regex = re.compile('(^|\s|>)!(everyone)(?!([^<]*<\/(code|pre|a)>|[^`]*`))', flags=re.A)
diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py
index 342994f8e8..d0b0283189 100644
--- a/files/helpers/sanitize.py
+++ b/files/helpers/sanitize.py
@@ -391,7 +391,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=True, count_marseys
else:
existing = g.db.get(Group, name)
if existing:
- sanitized = sanitized.replace(i.group(0), f'{i.group(1)}!{i.group(2)}', 1)
+ sanitized = sanitized.replace(i.group(0), f'{i.group(1)}!{name}', 1)
soup = BeautifulSoup(sanitized, 'lxml')