I need a regex to validate:
- just numbers
- it have to start with the number 20
- the five number needs to be 0 or 1
- the seven number needs to be 1, 2 or 3
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Starts with 20, then 2 of any digits, then 0 or 1, then any digits, then 1, 2 or 3. If you need additional digits after the 7th, you can insert a
\d*before the$:Edit: As CodeMonkey points out,
\dwill be interpreted in C# as an escape sequence, so be sure to use a verbatim string (as now shown above.)