Replacing all non-alphanumeric characters with empty strings
I tried using this but didn't work- return value.replaceAll("/[^A-Za-z0-9 ]/", ""); ...
I tried using this but didn't work- return value.replaceAll("/[^A-Za-z0-9 ]/", ""); ...
I was actually asked this myself a few weeks ago, whereas I know exactly how to do this with a SP or UDF but I was wondering if there was a quick and easy way of doing this without these methods, I'm assuming that there is and I just can't find it. A point I need to make is that although we know what characters are allowed (a-z, A-Z, 0...
We have been using the following js/regex to find and replace all non-alphanumeric characters apart from - and + outputString = outputString.replace(/[^\w|^\+|^-]*/g, ""); However it doesn't work entirely - it doesn't replace the ^ and | characters. I can't help but wonder if this is something to do with the ^ and | being used as meta-...