c# - Form a RegEx for asp.net asp:RegularExpressionValidator -


i have following requirement validating string in text box control:

  1. the no should of 12 characters maximum , minimum of 11 characters.
  2. first 11 characters should numbers
  3. the 12th characters should alphabet.

i practiced form regular expression using this regex builder. string ^([0-9]{11}[a-za-z]{1}){11,12}$. validation not working. beginner in asp.net don't have idea forming regex. missing?

i have used asp:regularexpressionvalidator control.

you need make last [a-za-z] optional.

@"^\d{11}[a-za-z]?$" 

Comments