What would be a proper regular expression for JavaScript to cover cell phone number like the following?
000-00-0000
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.
The \d is shorthand for a digit so I’d go with something like this:
However, and this is because I have no idea how phone-numbers look in your country id probably also go with something else in the last part since the length of that probably can differ so lets say that the minimum is 4 digits and the maximum is six then I’d do something like this.
Notice the last part in the regular expression \d{4,6}.
Also this isn’t a very tricky question so listen to the community (the comments) and try to google stuff like this in the future, you’ll always learn more if you figure stuff out by yourself.