javascript replace regex remove special characters code example Example: js remove special characters var desired = stringToReplace.replace(/[^\w\s]/gi, '')