I've got strings like these:
| Released = {{start-date|June 14, 1972}}
| Released = {{Start date|1973|03|01|df=y}}
I'd like to replace all | within {{ }} with ^
| Released = {{start-date^June 14, 1972}}
| Released = {{Start date^1973^03^01^df=y}}
I can't use substring replacement because there are | symbols outside {{ }}, which must be left intact. And because I don't know exactly how many parts does the string in {{ }} have, I can't use something like s/{{(.+?)\|(.+?)}}/{{$1^$2}}/.
I suppose I need to use some kind of recursion here?