title: Regular expression prevent dash from being entered
body: <p>I have the following regular expression within my .NET MVC file:</p>
  <pre><code>   [RegularExpression(@&quot;[a-zA-Z0-9\-_]{0,10}$&quot;, ErrorMessage = &quot;Please
     enter a valid User Code.&quot;)]
  </code></pre>
  <p>I want the characters to be no longer than 10 characters. It should allow for alpha-numberic values only and prevent any spaces.</p>
  <p>The code above works but the user is able to enter a dash &quot;-&quot;. How do I prevent this from happening.</p>