In the code below. I expected true but i am getting false instead. What am I missing?
var text = "Sentence $confirmationlink$ fooo";
alert(placeHolderExists(text,'confirmationlink'); // alerts false
function placeHolderExists(text,placeholdername) {
var pattern = new RegExp('\$'+placeholdername+'\$');
return pattern.test(text);
}