python正则表达式

判断字符串是否符合某种模式,比如字符串是否由字母、数字、下划线组成:

if re.match(r"^[a-zA-Z0-9_]+$", a_name) == None:
    print("not matched")
原文地址:https://www.cnblogs.com/guo-xiang/p/9380608.html