I\'m trying to replace multiple words in a string with multiple other words. The string is \"I have a cat, a dog, and a goat.\"
However, this does not produce \"I ha
user regular function to define the pattern to replace and then use replace function to work on input string,
var i = new RegExp('"{','g'), j = new RegExp('}"','g'), k = data.replace(i,'{').replace(j,'}');