import re
str = 'hihihi>abcdefgid=testgogogo<movemove&'
# 符号须要本义 后面多加一个 # 前后都是符号
title1 = re.findall(r'\>((?:.|n)*?)\<', str)[0]
# 只有前面是符号
title2 = re.findall(r'id=((?:.|n)*?)\&', str)[0]
print('title1 ---',title1)
print('title2 ---',title2)
输入后果
title1 --- abcdefgid=testgogogo
title2 --- testgogogo<movemove