python_正则表达式_匹配单个字符与数字

匹配单个字符与数字

import re
print(re.search("\d","good man8 is sunck!sunck is nice"))
print(re.findall("[\D]","good man is sunck!"))
print(re.search("[\w]","_good man is sunck!sunck is nice"))
print(re.search("[\w]","good_ man is sunck!sunck is nice"))

结果:

发布了70 篇原创文章 · 获赞 11 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/YMY_mine/article/details/84245975