1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-18 07:49:52 +08:00

Compile regex

This commit is contained in:
Craftplacer
2020-01-22 00:31:44 +01:00
Unverified
parent 795051e256
commit 88ea1138b6
+1 -1
View File
@@ -144,7 +144,7 @@ namespace osu.Game.Online.Chat
notificationOverlay?.Post(notification);
}
private static IEnumerable<string> getWords(string input) => Regex.Matches(input, @"\w+").Select(c => c.Value);
private static IEnumerable<string> getWords(string input) => Regex.Matches(input, @"\w+", RegexOptions.Compiled).Select(c => c.Value);
/// <summary>
/// Finds the first matching string/word in both <paramref name="x"/> and <paramref name="y"/> (case-insensitive)