Skip to content

Commit

Permalink
Misc
Browse files Browse the repository at this point in the history
We originally had ifdefs here for netf, so const made sense, they don't anymore.
  • Loading branch information
JustArchi committed Mar 22, 2024
1 parent f874598 commit 0b94213
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions ArchiSteamFarm/Core/GeneratedRegexes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,17 @@
namespace ArchiSteamFarm.Core;

internal static partial class GeneratedRegexes {
private const string CdKeyPattern = @"^[0-9A-Z]{4,7}-[0-9A-Z]{4,7}-[0-9A-Z]{4,7}(?:(?:-[0-9A-Z]{4,7})?(?:-[0-9A-Z]{4,7}))?$";
private const string DecimalPattern = @"[0-9\.,]+";
private const RegexOptions DefaultOptions = RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.IgnoreCase;
private const string DigitsPattern = @"\d+";
private const string NonAsciiPattern = @"[^\u0000-\u007F]+";

[GeneratedRegex(CdKeyPattern, DefaultOptions)]
[GeneratedRegex(@"^[0-9A-Z]{4,7}-[0-9A-Z]{4,7}-[0-9A-Z]{4,7}(?:(?:-[0-9A-Z]{4,7})?(?:-[0-9A-Z]{4,7}))?$", DefaultOptions)]
internal static partial Regex CdKey();

[GeneratedRegex(DecimalPattern, DefaultOptions)]
[GeneratedRegex(@"[0-9\.,]+", DefaultOptions)]
internal static partial Regex Decimal();

[GeneratedRegex(DigitsPattern, DefaultOptions)]
[GeneratedRegex(@"\d+", DefaultOptions)]
internal static partial Regex Digits();

[GeneratedRegex(NonAsciiPattern, DefaultOptions)]
[GeneratedRegex(@"[^\u0000-\u007F]+", DefaultOptions)]
internal static partial Regex NonAscii();
}

0 comments on commit 0b94213

Please sign in to comment.