📅  最后修改于: 2022-03-11 14:46:16.236000             🧑  作者: Mango
import re
PATTERN = re.compile(r'((\w:)|(\.))((/(?!/)(?!/)|\\{2})[^\n?"|>\\:*]+)+')
def is_valid_path(string: str):
if string and isinstance(string, str) and PATTERN.match(string):
return True
return False