title: How do I replace the spaces between words in Emacs?
body: <p>I have a files consisting of words:</p>
  
  <pre><code>ndkjsank ndjksandknsakj                                     
  dnsjakndjskndjknsakjn dsajkndksnakjndsnajkndjkas 
  dsnjak    a
  </code></pre>
  
  <p>And I would like to replace the (sometimes multiple) spaces between them with a single tab:</p>
  
  <pre><code>dsnak**\t**ndsjka
  njdkas**\t**ndksjankda
  njdsaibdusai**\t**nkdsnakjdnas
  </code></pre>
  
  <p>Is this possible using a regular expression in Emacs? I thought I might get away with using a rectangular selection area but the words are of varying length (and the file is far too long to do it manually).</p>
  
  <p>EDIT:</p>
  
  <p>This comes close but it also selects the spaces/newlines/tabs to the right of the second word:</p>
  
  <pre><code>\s-
  </code></pre>