title: C# Regex to match letters, numbers, underscore, dash and point
body: <p>I looking for this but i can't found a good solution.</p>
  
  <p>I found a <a href="https://stackoverflow.com/questions/885860/c-sharp-regular-expression-to-match-letters-numbers-and-underscore">solution</a> but visual studio get an error</p>
  
  <pre><code>var regexItem = new Regex(@"^[a-zA-Z0-9\_]+$);
  </code></pre>
  
  <p>And it's my condition:</p>
  
  <pre><code>if (regexItem.IsMatch(name))
  {
       //...
  }
  </code></pre>