Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isMobilePhone fails ###-###-#### format #826

Closed
Kiran-N opened this issue May 3, 2018 · 2 comments
Closed

isMobilePhone fails ###-###-#### format #826

Kiran-N opened this issue May 3, 2018 · 2 comments

Comments

@Kiran-N
Copy link

Kiran-N commented May 3, 2018

validator.isMobilePhone("###-###-####",'en-US') fails as a valid number.

@chriso
Copy link
Collaborator

chriso commented May 4, 2018

I'd be happy to accept a PR that relaxed the format to allow hyphens. Some of the other patterns already allow this. In the mean time, you can validate the results of phone.replace(/-/g, '') or use a custom regular expression pattern.

@chriso
Copy link
Collaborator

chriso commented Jul 31, 2018

Fixed by #872

@chriso chriso closed this as completed Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants