mirror of
https://github.com/ppy/osu
synced 2025-01-20 13:00:54 +00:00
Using static call and verbatim symbol and optimizes regex pattern for username check
This commit is contained in:
parent
be86ca582c
commit
882223b27f
@ -134,7 +134,7 @@ namespace osu.Game.Online.Chat
|
||||
{
|
||||
string fullName = Regex.Escape(username);
|
||||
string underscoreName = Regex.Escape(username.Replace(' ', '_'));
|
||||
return new Regex($"(^|^\\W|\\W|\\w\\W)({fullName}|{underscoreName})($|$\\W|\\W|\\w\\W)", RegexOptions.IgnoreCase).IsMatch(message);
|
||||
return Regex.IsMatch(message, $@"(^|\W)({fullName}|{underscoreName})($|\W)", RegexOptions.IgnoreCase);
|
||||
}
|
||||
|
||||
public class PrivateMessageNotification : OpenChannelNotification
|
||||
|
Loading…
Reference in New Issue
Block a user