replace all alphanumeric characters js code example Example: replace non alphanumeric javascript text.replace(/[\W_]+/g," ");