title: Replace all non alphanumeric characters, new lines, and multiple white space with one space
body: <p>I'm looking for a neat regex solution to replace</p>
  <ul>
  <li>All non alphanumeric characters</li>
  <li>All newlines</li>
  <li>All multiple instances of white space</li>
  </ul>
  <p>With a single space</p>
  <hr />
  <p>For those playing at home (<strong>the following does work</strong>)</p>
  <pre><code>text.replace(/[^a-z0-9]/gmi, &quot; &quot;).replace(/\s+/g, &quot; &quot;);
  </code></pre>
  <p>My thinking is <em>regex</em> is probably powerful enough to achieve this in one statement. The components I think I'd need are</p>
  <ul>
  <li><code>[^a-z0-9]</code> - to remove non alphanumeric characters</li>
  <li><code>\s+</code> - match any collections of spaces</li>
  <li><code>\r?\n|\r</code> - match all new line</li>
  <li><code>/gmi</code> - global, multi-line, case insensitive</li>
  </ul>
  <p>However, I can't seem to style the regex in the right way (<strong>the following doesn't work</strong>)</p>
  <pre><code>text.replace(/[^a-z0-9]|\s+|\r?\n|\r/gmi, &quot; &quot;);
  </code></pre>
  <hr />
  <p><strong>Input</strong></p>
  <pre><code>234&amp;^%,Me,2 2013 1080p x264 5 1 BluRay
  S01(*&amp;asd 05
  S1E5
  1x05
  1x5
  </code></pre>
  <hr />
  <p><strong>Desired Output</strong></p>
  <pre><code>234 Me 2 2013 1080p x264 5 1 BluRay S01 asd 05 S1E5 1x05 1x5
  </code></pre>