title: Javascript Regex match everything except double spaces then replace
body: <p>I need a regex that will match anything except white spaces or only words in between double spaces.</p>
  
  <p>Like : </p>
  
  <p>let's assume the <code>underscores</code> where equal to <code>spaces</code> just for example.</p>
  
  <p><code>foo_bar__The_Quick_Dog__is_addicted_to___jumping___</code></p>
  
  <p>Then <code>replace</code> the <code>spaces</code> with any <code>symbol</code>, preferably a <code>Comma (,)</code>.</p>
  
  <p>So we should have: <strong>foo bar, The Quick Dog, is addicted to, jumping.</strong></p>
  
  <p>However, the word <em>jumping</em> should NOT have it's white spaces replaced with <code>comma</code> because it's at the end... adding a <code>comma</code> to it will be meaningless</p>
  
  <p>I tried:</p>
  
  <pre><code>/\(\s*([^)]+?)\s*\)/
  </code></pre>
  
  <p>and</p>
  
  <pre><code>[a-z].\s{2,}.*
  </code></pre>
  
  <p>and</p>
  
  <pre><code>\s\s.*[a-z]
  </code></pre>
  
  <p>and</p>
  
  <pre><code>(?:[a-zA-Z0-9]+[ ])+[a-zA-Z0-9]+
  </code></pre>
  
  <p>and a few hundreds more... still no good.</p>
  
  <p>Thank</p>