>>> pa = re.compile(r'<.*>') >>> result = pa.findall('<H1>title</H1>') >>> print(result) ['<H1>title</H1>'] >>> pa2 = re.compile(r'<.*?>') >>> result2 = pa2.findall('<H2>title</H2>') >>> print(result2) ['<H2>', '</H2>']
关于一个懒惰和非懒惰的