regex eliminar múltiples espacios
string = string.replace(/\s\s+/g, ' ');
Distinct Deer
string = string.replace(/\s\s+/g, ' ');
//..
return str.replace(/\s/g, '');
//..
\s* ignore spaces
eg \s*yourregex\s*
string = string.replace(/ +/g, ' ');