1、通配符匹配次数
import re key = r"saasandsasandsaaas" p = r"sa{1,2}s" pattern = re.compile(p1)printpattern1.findall(key) #out # ['saas', 'sas']# 如果 {1,}则表示至少匹配1次# 如果 {,2} 则表示最多匹配2次