How to format raw string with different expressions inside?
Use f-strings (introduced in Python 3.6):
a = 15
print(fr'Escape is here:\n but still {a}')
# => Escape is here:\n but still 15
Escape the curly brackets with curly brackets
>>> import re
>>> text = '"""!some text'
>>> re.findall(r'"{{3}}{symbol}some\stext'.format(symbol='!'), text)
['"""!some text']
However it is better to just use %
formatting in this situation.