贪婪匹配和非贪婪匹配

import re

patern = re.compile('www\..*?')
match1 = patern.match("www.baidu.com")
if match1:
    print(match1.group())
else:
    print("match1 don't match")

不加?为贪婪匹配,输出:www.baidu.com
加?为非贪婪匹配,输出:www.