From Code Trash
Here is the regex to strip the characters you dont want to be in a string.
The following will remove all characters except letters numbers and spaces.
g is for all occurrence and i is for case insensitive.
val = val.replace(/[^a-z 0-9]+/gi,'');