I have a challenge where I need to convert something like "{{John}}" into just "John."
Initially, I am extracting this from a string:
var parameters = content.match(/[{{]+[Aa-Åå]+[}}]/g);
The regular expression is doing its job correctly by parsing the "{}" to identify content within the string.
However, my issue arises when I attempt to remove the "{}" from each "parameter":
for (var i = 0; i < parameters.length; i++) {
parameters = parameters[i].replace(/[{}]/g, "");
}
Upon alerting "parameters," all I see is the letter "a." I'm puzzled as to what I might be overlooking, as it seems like it should work as intended.