title: How to validate CNIC no in mvc by regular expression
body: <p>I want validate the CNIC no(computed national identity card no). 
  I want to take input from client like (12345-1234567-1) no character except dashes. I wrote below regular expression  </p>
  
  <pre><code>[RegularExpression("^[0-9]{5}-[-|]-[0-9]{7}-[-|]-[0-9]{1}")]
  public string NICNo { get; set; }
  </code></pre>
  
  <p>But when I submit the from it shows the whole regular expression in validation error Like below</p>
  
  <p><a href="https://i.stack.imgur.com/3pwAw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3pwAw.png" alt="enter image description here"></a></p>