mirror of
https://github.com/ppy/osu
synced 2025-01-10 08:09:40 +00:00
Improve regex readability by using character set
This commit is contained in:
parent
6b532824b1
commit
eb2f1d09f8
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user