Basic regulaer expressions fails
I'm trying to replace a ^ if the user types it in.
This works ....
alert("^Fred^Bloggs^".replace(/\^/g, "-"));
I'm using an array of special characters which I'm encoding and it fails when trying to encode a ^.
This doesn't work ....
var c = "\^";
var re = new RegExp(c, "g");
alert("^Fred^Bloggs^".replace(re, "-"));
Any ideas?