import re
'''
匹配除了换行之外的所有字符
'''
atRegex = re.compile(r'.at')
a = atRegex.findall('the cat in the hat sat on the flat mat')
print(a)
结果是:
['cat', 'hat', 'sat', 'lat', 'mat']
import re
'''
匹配除了换行之外的所有字符
'''
atRegex = re.compile(r'.at')
a = atRegex.findall('the cat in the hat sat on the flat mat')
print(a)
结果是:
['cat', 'hat', 'sat', 'lat', 'mat']
本文标题:正则_统配字符.
本文链接:https://www.haomeiwen.com/subject/gzcjiftx.html
网友评论