javascript regex replace all other characters code example Example: str replace javascript all str.replace(/abc/g, '');