title: preg_replace - leaving in unwanted characters
body: <p>I've got a string:</p>
  
  <pre><code>$string = "Hello World!";
  </code></pre>
  
  <p>I want to turn it into a URL friendly tag, and I've developed a function to do it:</p>
  
  <pre><code>function stripJunk($string){
      $string = str_replace(" ", "-", $string);
      $string = preg_replace("/[^a-zA-Z]\s/", "", $string);
      $string = strtolower($string);
      return $string;
  }
  </code></pre>
  
  <p>However, when I run my <code>$string</code> through it above, I get the following:</p>
  
  <pre><code>$string = "hello-world!";
  </code></pre>
  
  <p>It seems that there are characters slipping through my preg_replace, even though from what I understand, they shouldn't be.</p>
  
  <p>It should read like this:</p>
  
  <pre><code>$string = "hello-world";
  </code></pre>
  
  <p>What's going on here? (This should be easy peasy lemon squeasy!)</p>
  
  <p><strong>Edit 1</strong>: I wasn't aware that regular expressions were beginners stuff, but whatever. Additionally, removing the \s in my string does not produce the desired result.</p>
  
  <p>The desired result is: </p>
  
  <ol>
  <li>All spaces are converted to dashes.</li>
  <li>All remaining characters that are not A-Z or 0-9 are removed.</li>
  <li>The string is then converted to lower case.</li>
  </ol>
  
  <p><strong>Edit 2+</strong>: Cleaned up my code just a little.</p>