1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 09:48:20 +08:00

Fix: Validate datetime instead of using regex (#3252)

This commit is contained in:
LmeSzinc
2023-11-01 02:40:02 +08:00
parent e3e72f02cf
commit 1d1d20fef9

View File

@@ -455,7 +455,11 @@ def get_localstorage(key):
def re_fullmatch(pattern, string):
if pattern == "datetime":
pattern = RE_DATETIME
try:
datetime.datetime.fromisoformat(string)
return True
except ValueError:
return False
# elif:
return re.fullmatch(pattern=pattern, string=string)