Answers for "js regex non alphanumeric"

5

remove non alphanumeric characters javascript

input.replace(/\W/g, '') //doesnt include underscores


input.replace(/[^0-9a-z]/gi, '') //removes underscores too
Posted by: Guest on June-01-2020
1

javascript regular expression for alphanumeric

/^[a-z0-9]+$/i

^         Start of string
[a-z0-9]  a or b or c or ... z or 0 or 1 or ... 9
+         one or more times (change to * to allow empty string)
$         end of string    
/i        case-insensitive
Posted by: Guest on December-03-2020
0

replace non alphanumeric javascript

text.replace(/[\W_]+/g," ");
Posted by: Guest on March-29-2020

Code answers related to "js regex non alphanumeric"

Code answers related to "Javascript"

Browse Popular Code Answers by Language