Skip to content

Instantly share code, notes, and snippets.

@sunnydoll
Created December 1, 2015 20:22
Show Gist options
  • Save sunnydoll/3bf65bf5aec91c0632f5 to your computer and use it in GitHub Desktop.
Save sunnydoll/3bf65bf5aec91c0632f5 to your computer and use it in GitHub Desktop.
Regexp for normal chars
function filterSpecialChar(text) {
var patt = /[^a-zA-Z0-9{}.,\?'"\[\]\(\)\-\\\/:&;\*@\s]+/;
if(patt.test(text))
return false;
else
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment