title: MVC Validation make RegularExpression numeric only on string field
body: <p>I have the following property in my view model:</p>
  
  <pre><code>[Required]
  [MaxLength(12)]
  [MinLength(1)]
  [RegularExpression("[^0-9]", ErrorMessage = "UPRN must be numeric")]
  public string Uprn { get; set; }    
  </code></pre>
  
  <p>Regardless of <code>Uprn</code> being a <code>string</code>, I want to throw a validation error if there is anything other than numbers entered into the Uprn box on page submit.</p>
  
  <p>With the above, I am getting the error "UPRN must be numeric" whether its a string or int</p>
  
  <p>What's going on here?</p>