python里的正则表达式
匹配字符import res = 'adawdafA@#!#@!1231cad'print(re.findall('[a-z]',s)) # 匹配小写英文字母print(re.findall('[0-9]',s)) # 匹配数字print(re.findall('[A-Z]',s)) # 匹配大写英文字母print(re.findall('[a-zA-Z0-9]',s)) # 匹配英文字母加数字print(re.findall('[^a-zA-Z0-9]',s)) # 匹配(过滤(英
原创
2020-09-03 11:09:03 ·
1168 阅读 ·
1 评论