Input:
\". . . . .\"
Expected output:
var str="this is some text with lots of spaces!"; var result =str.replace(/\s+/," ");