Improve regex readability by using character set

This commit is contained in:
WitherFlower 2024-10-10 17:42:43 +02:00
parent 6b532824b1
commit eb2f1d09f8

View File

@ -617,9 +617,7 @@ namespace osu.Game.Screens.Select
/// <param name="val">The string value to attempt parsing for.</param>
private static bool tryUpdateRankedDateRange(ref FilterCriteria.OptionalRange<DateTimeOffset> dateRange, Operator op, string val)
{
GroupCollection? match = null;
match ??= tryMatchRegex(val, @"^(?<year>\d+)((-|/|\.)(?<month>\d+)((-|/|\.)(?<day>\d+))?)?$");
GroupCollection? match = tryMatchRegex(val, @"^(?<year>\d+)([-/.](?<month>\d+)([-/.](?<day>\d+))?)?$");
if (match == null)
return false;