mirror of
https://github.com/ppy/osu.git
synced 2025-01-31 15:12:54 +08: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>
|
/// <param name="val">The string value to attempt parsing for.</param>
|
||||||
private static bool tryUpdateRankedDateRange(ref FilterCriteria.OptionalRange<DateTimeOffset> dateRange, Operator op, string val)
|
private static bool tryUpdateRankedDateRange(ref FilterCriteria.OptionalRange<DateTimeOffset> dateRange, Operator op, string val)
|
||||||
{
|
{
|
||||||
GroupCollection? match = null;
|
GroupCollection? match = tryMatchRegex(val, @"^(?<year>\d+)([-/.](?<month>\d+)([-/.](?<day>\d+))?)?$");
|
||||||
|
|
||||||
match ??= tryMatchRegex(val, @"^(?<year>\d+)((-|/|\.)(?<month>\d+)((-|/|\.)(?<day>\d+))?)?$");
|
|
||||||
|
|
||||||
if (match == null)
|
if (match == null)
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user