From b6d47a41f411959a4fe2105f7fa25eff76f46dc2 Mon Sep 17 00:00:00 2001 From: tbrose Date: Tue, 7 Dec 2021 02:14:40 +0100 Subject: [PATCH] Adjusted RegEx pattern to also take special characters into account --- osu.Game/Online/Chat/MessageNotifier.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Online/Chat/MessageNotifier.cs b/osu.Game/Online/Chat/MessageNotifier.cs index 4ae4e64855..883f6a7284 100644 --- a/osu.Game/Online/Chat/MessageNotifier.cs +++ b/osu.Game/Online/Chat/MessageNotifier.cs @@ -134,7 +134,7 @@ namespace osu.Game.Online.Chat { string fullName = Regex.Escape(username); string underscoreName = Regex.Escape(username.Replace(' ', '_')); - return new Regex($"\\b({fullName}|{underscoreName})\\b", RegexOptions.IgnoreCase).IsMatch(message); + return new Regex($"(^|^\\W|\\W|\\w\\W)({fullName}|{underscoreName})($|$\\W|\\W|\\w\\W)", RegexOptions.IgnoreCase).IsMatch(message); } public class PrivateMessageNotification : OpenChannelNotification