title: Trim whitespace from middle of string
body: <p>I'm using the following regex to capture a fixed width "description" field that is always 50 characters long:</p>
  
  <pre><code>(?.{50})
  </code></pre>
  
  <p>My problem is that the descriptions sometimes contain a <em>lot</em> of whitespace, e.g.</p>
  
  <pre><code>"FLUID        COMPRESSOR                          "
  </code></pre>
  
  <p>Can somebody provide a regex that:</p>
  
  <ol>
  <li>Trims all whitespace off the end</li>
  <li>Collapses any whitespace in between words to a <strong>single space</strong></li>
  </ol>