Is there a reason why the code snippet provided is not correctly performing regex operations on all instances of {{ ... }} placeholders? The input string below is a condensed version of the original content.
Check out this link for the code snippet
var input = "{{ %1$@ }} / {{ %1$@ }} ({{ %2$@ }}) {{ %1$@ }} {{ %1$@ }} {{ %1$d }} {{ %1$@ }} of {{ %2$d }} of {{ %3$d }}";
var regex = /(\{\{ \%(\d)\$(.) \}\})/g;
var match;
while (match = regex.exec(input)) {
console.log(match);
input = input.replace(match[0], '%@' + match[2]);
}
console.log(input);