Posted on 2005-04-08
searchTerm = document.getElementById(fromId).value;
var POUND = new RegExp( '#', 'g' );
searchTerm = searchTerm.replace(POUND,'');
var PIPE = new RegExp( '\|', 'g' );
searchTerm = searchTerm.replace(PIPE,'');
document.getElementById(fromId).value = searchTerm;
It isn't recognizing the | symbol for some reason. I know this is something simple that I'm missing. I know the pipe symbol is special in reg exp, but I am trying to escape it with the use of the backslash. Help?