title: Regular expression, replace multiple slashes with only one
body: <p>It seems like an easy problem to solve, but It's not as easy as it seems. I have this string in PHP:</p>
  
  <pre><code>////%postname%/
  </code></pre>
  
  <p>This is a URL and I never want more than one slash in a row. I never want to remove the slashes completely.</p>
  
  <p>This is how it should look like:</p>
  
  <pre><code>/%postname%/
  </code></pre>
  
  <p>Because the structure could look different I need a clever preg replace regexp, I think. It need to work with URLS like this:</p>
  
  <pre><code>////%postname%//mytest/test///testing
  </code></pre>
  
  <p>which should be converted to this:</p>
  
  <pre><code>/%postname%/mytest/test/testing
  </code></pre>