JSON = '{"name01":"Joe", "age01":"25"}'
data = json.loads(JSON)
html = re.sub('\\$(\\w+)', lambda m: data[m.group(1)], html)
print(html)
How to replace values from JSON with those found by RegEx in a file using Python?