regex replace all before dot code example Example: regular expression replace a dot mystring = mystring.replace(/\./g,' ')