What would this C# regex look like?
- At least one (1) character in length
- Up to seven (7) characters in length
- Numeric characters
I have this, but I needs to check for 1-7 digits:
var chequeNumRX = new Regex("^[0-9]+$");
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.
In regular expressions, you can use the repetition operator
{min,max}.The above regex would match
\da minimum of 1 time and a maximum of 7 times.Note that
\dis a shorthand character class equivalent to[0-9].