运行结果与课程不一致
import re
key=r"<h1>Hello World</h1><h2>Hello error</h3><h2>Hello everyone</h2><h3>Hello everybody</h3><h4>Hello ladies</h4>"
p1=r"(?<=<(h[1-4]>)).+?(?=</\1>)"
pattern1=re.compile(p1)
objs=pattern1.finditer(key)
list=[]
for obj in objs:
list.append(obj.group())
print (list)
运行结果为[ ]