用不到就根本记不住之正则

re 模糊匹配

USER_REGULATION = [
    {"method": ["GET", "PUT", "POST"], "pattern": "store/.*/pictures"},
    {"method": ["GET", "PUT", "POST"], "pattern": "users/.*"},
]

list = []

def text():

    for item in USER_REGULATION:
        regex = re.compile(item["pattern"])
        match = regex.search(path_url)
        if match:

    list.append(item)

原文地址:https://www.cnblogs.com/yanhui1995/p/11753169.html