-
Notifications
You must be signed in to change notification settings - Fork 41
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
Leverage validators package instead of writing our own regexp #26
Comments
@themisir what do you think ? I can open a PR if there is an agreement that is probably a safer path forward. |
I don't like depending on 3rd party packages just for a few lines of code actually 😅 |
I understand the sentiment but those few lines of codes are kinda critical to get right and duplicating and maintaining that effort seems kinda pointless. For me this falls into the same realm as |
For reference this package seems like an even better candidate, focusing only on email validation without using regexp |
Validation of common idioms via regexp is a tricky business and not something you really want to do yourself. For example, the regexp currently being used to validate emails is actually quite simple:
If we were to compare it to the one being define in the validators package:
Obviously the latter take into account Unicode characters and probably some other quirks.
I believe it would be better to simply leverage the validators package instead of trying to come up with regexps on our own that we have to maintain and test.
The text was updated successfully, but these errors were encountered: