(.*?)实验室
(.*?)实验室
import re
l1="www1kwww2kwwwk"
print(re.findall("w*",l1))
print(re.findall("w*?",l1))
print(re.findall("ww*",l1))
print(re.findall("ww*?",l1))
print(re.findall(".*",l1))
print(re.findall(".*?",l1))
print(re.findall("(.*)",l1))
print(re.findall("(.*?)",l1))
print(re.findall("www(.*)",l1))
print(re.findall("www(.*?)",l1))
print(re.findall("www(.*)k",l1))
print(re.findall("www(.*?)k",l1))
['www', '', '', 'www', '', '', 'www', '', '']
['', '', '', '', '', '', '', '', '', '', '', '', '', '', '']
['www', 'www', 'www']
['w', 'w', 'w', 'w', 'w', 'w', 'w', 'w', 'w']
['www1kwww2kwwwk', '']
['', '', '', '', '', '', '', '', '', '', '', '', '', '', '']
['www1kwww2kwwwk', '']
['', '', '', '', '', '', '', '', '', '', '', '', '', '', '']
['1kwww2kwwwk']
['', '', '']
['1kwww2kwww']
['1', '2', '']
关于(.*?)的惰性匹配,我认为是取满足条件的最短长度的字符
大概看懂以上就7 8分了解了