Skip to content

Instantly share code, notes, and snippets.

@xola139
Created May 29, 2018 15:11
Show Gist options
  • Save xola139/d12d41c5dab5c2809eb1cfaabd78bef6 to your computer and use it in GitHub Desktop.
Save xola139/d12d41c5dab5c2809eb1cfaabd78bef6 to your computer and use it in GitHub Desktop.
Snippet remove acent with javascript
var regex = new RegExp("^[a-zA-Z0-9 ,-._ÑñáéíóúÁÉÍÓÚ'\"]+$");
var str = String.fromCharCode(!e.charCode ? e.which : e.charCode);
if (regex.test(str)) {
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment