title: Regular expression for letters, numbers and - _
body: <p>I'm having trouble checking in PHP if a value is is any of the following combinations</p>
  
  <ul>
  <li>letters (upper or lowercase)</li>
  <li>numbers (0-9)</li>
  <li>underscore (_)</li>
  <li>dash (-)</li>
  <li>point (.)</li>
  <li>no spaces! or other characters</li>
  </ul>
  
  <p>a few examples:</p>
  
  <ul>
  <li>OK: "screen123.css"</li>
  <li>OK: "screen-new-file.css"</li>
  <li>OK: "screen_new.js"</li>
  <li>NOT OK: "screen new file.css"</li>
  </ul>
  
  <p>I guess I need a regex for this, since I need to throw an error when a give string has other characters in it than the ones mentioned above.</p>