Every line of 'remove all non-alphanumeric characters javascript' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
1 export function cleanAlphaNumericString(str: string): string { 2 return (str && typeof str === "string") ? str.replace(/\W/g, '') : str; 3 }
21 function allowalphanumeric(e) { 22 var key = window.event ? e.keyCode : e.which; 23 var keychar = String.fromCharCode(key); 24 var reg = new RegExp("[a-zA-Z0-9]"); 25 var carok = reg.test(keychar); 26 return carok; 27 }