mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-19 02:33:34 +08:00
Fix: Validate datetime instead of using regex (#3252)
This commit is contained in:
@@ -455,7 +455,11 @@ def get_localstorage(key):
|
|||||||
|
|
||||||
def re_fullmatch(pattern, string):
|
def re_fullmatch(pattern, string):
|
||||||
if pattern == "datetime":
|
if pattern == "datetime":
|
||||||
pattern = RE_DATETIME
|
try:
|
||||||
|
datetime.datetime.fromisoformat(string)
|
||||||
|
return True
|
||||||
|
except ValueError:
|
||||||
|
return False
|
||||||
# elif:
|
# elif:
|
||||||
return re.fullmatch(pattern=pattern, string=string)
|
return re.fullmatch(pattern=pattern, string=string)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user