Skip to content
This repository has been archived by the owner on Apr 8, 2020. It is now read-only.

Don't validate emails with regex #2

Closed
sethgrid opened this issue Mar 10, 2016 · 2 comments
Closed

Don't validate emails with regex #2

sethgrid opened this issue Mar 10, 2016 · 2 comments

Comments

@sethgrid
Copy link

Check out:
http://play.golang.org/p/fKwLaT3gY4

It shows many valid email addresses as invalid. See

https://en.wikipedia.org/wiki/Email_address#Valid_email_addresses
https://davidcel.is/posts/stop-validating-email-addresses-with-regex/
Related:
http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address

If you really want to use regular expressions (which is not Go's strong suit), just check if there is something before and after an @.

@aliuygur
Copy link
Owner

Thank you. I will refactor.

@aliuygur
Copy link
Owner

fixed d428c94

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants