import res = "{Dog} loves {Cat}"l = ["Scooby Doo", "Sylvester"] print(re.sub(r'{[^{}]*}', '{}', s).format(*l))
Standard input is empty
Scooby Doo loves Sylvester
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!