mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 22:20:52 +00:00
Fix CD-key regex to be ignore-case
Also modify regex a bit to not catch keys like AAAAA-AAAAA-AAAAA- and the ones that are too long
This commit is contained in:
@@ -98,7 +98,7 @@ namespace ArchiSteamFarm {
|
||||
|
||||
private static bool IsValidCdKey(string key) {
|
||||
if (!string.IsNullOrEmpty(key)) {
|
||||
return Regex.IsMatch(key, @"[0-9A-Z]{4,5}-[0-9A-Z]{4,5}-[0-9A-Z]{4,5}-?(?:(?:[0-9A-Z]{4,5}-?)?(?:[0-9A-Z]{4,5}))?");
|
||||
return Regex.IsMatch(key, @"^[0-9A-Z]{4,5}-[0-9A-Z]{4,5}-[0-9A-Z]{4,5}(?:(?:-[0-9A-Z]{4,5})?(?:-[0-9A-Z]{4,5}))?$", RegexOptions.IgnoreCase);
|
||||
}
|
||||
|
||||
Logging.LogNullError(nameof(key));
|
||||
|
||||
Reference in New Issue
Block a user