📜  python 模式匹配示例 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:17.143000             🧑  作者: Mango

代码示例1
import re
pattern = re.compile('[a-zA-Z ]+')        # a...z A...Z and space allowed
message = "Weather is nice"
if pattern.match(message).group() == message:
    print("match")
else:
    print("no match")