I want a regex that checks the following things:
- The string starts with an +
- After the ‘+’ only numbers can occur
- There should be atleast 4 numbers after the +
Does anyone know how to make this?
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.
will meet your requirements.
^is the anchor for start fo the string\dis a digit{4,}says at least 4 of the preceding expression (here the\d). you can add a maximum if needed like{4,20}would allow at least 4 and at most 20 characters.$is the anchor for the end of the string