javascript regex replace any characters not belonging to a alphanumeric code example Example: replace non alphanumeric javascript text.replace(/[\W_]+/g," ");