title: Regex for string property
body: <p>I need help to get regex for my <code>ValidationAttribute</code>.</p>
  
  <p>Allowed value must be <code>alphabet</code> + <code>numeric</code> + "<code>_</code>" + "<code>-</code>" + "<code>.</code>".
  The value must start and end with number and alphabet only.</p>
  
  <p>Examples:</p>
  
  <ul>
  <li><code>"1abc-def"</code> should work</li>
  <li><code>"abc-1def"</code> should work</li>
  <li><code>"-abc-def"</code> should fail</li>
  <li><code>"abc-def."</code> should fail</li>
  <li><code>"a bc-def"</code> should fail</li>
  </ul>