Input:
\". . . . .\"
Expected output:
in PCRE:
s/\s+/ /g
in JavaScript:
text = text.replace(/\s+/g, " ");