I would like to be able to do this:
var test = "A3%2345-S63.][343\g30.1.0.45";
test.removeSpecialCharacters();
all special characters ie (%,*, (,[..etc) will be removed);
or
test.removeSpecialCharacters("-");
meaning all special characters will be replaced with "-"
I've tried with this but i don't think i'm doing it right :(
jQuery.fn.removeSpecialCharacters = function (optional replaceWith) {
this.replace(/[^a-z0-9\s]/gi, '');
}