title: PHP Regex - Remove invalid characters from string
body: <p>I know there are many regex questions, but I don't know it well enough, nor could I find an answer explaining it well enough to derive the solution I'm trying to get.</p>
  
  <p>In PHP, using </p>
  
  <pre><code>preg_replace($pattern,"",$data); 
  </code></pre>
  
  <p>I'd like to allow all alphanumeric characters along with the minus, period, and underscore characters. What is the $pattern I need?</p>