import re
# Greedy
s = '<html><head><title>Title</title></head></html>'
print(re.match('<.*>', s))
print(re.match('<.*?>', s))
実行結果:
<re.Match object; span=(0, 46), match='<html><head><title>Title</title></head></html>'>
<re.Match object; span=(0, 6), match='<html>'>