MarcoAurelio <> ezt írta (időpont: 2021. jún. 7., H, 16:18):
(e.g. just replace the template name leaving brakets
and parameters untouched i.e. {{template|1=parameter}}).

This is the easiest case if only the template names change and there are no nested templates. That's what is for.

A fix r'\{\{oldtemplate(\|.*?)\}\}', r'{{newtemplate\1}}' should do the work.
A less elegant trick, if your problem is, that should be run several times: put the commands in a batch file / bash script.