import re with open('app/modules/sag/templates/detail.html', 'r') as f: content = f.read() old_block = """