-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add E.164 format validation for strings #3476
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
Conversation
✅ Deploy Preview for guileless-rolypoly-866f8a ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
This seems good to me. Is there a specific reason this is still a draft PR? My plan is to merge this into |
|
Hello, apologies for the delay. I first needed to further investigate in order to be able to add the pr description. Cheers |
|
Hello, added a section on E.164 to both Readme files. |
Hello, following the previous discussion, I added validation for the E.164 format on strings using a modified regex from this article. I removed support for spaces as those don't seem to be permitted. The validation could be further enhanced by prohibiting
0as the first value since country codes start with1.There is an alternative regular expression from the Twilio docs for E.164 numbers. This regular expression permits very short E.164 numbers. It could be used in tandem with the existing string validations like
minandmax. This would give users the option to adapt the number length further, which seems to be necessary in some instances, according to this stack overflow post.Cheers
Thank you for your contribution to our project! Before submitting your pull request, please ensure the following: