Skip to content

Change domain regex to not match domains with leading - or . characters #217

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

Merged
merged 2 commits into from
Sep 12, 2017

Conversation

bendykowski
Copy link
Contributor

According to official specifications which are summarised here http://emailregex.com/email-validation-summary/ domain labels can't be trailing or leading by "-" character. A domain can't be also leaded by "." character as it should separate two domain labels only. I've separated IP regex as well to simplify the code and added e-mail tests to cover previously failing cases.

According to official specifications which are summarised here http://emailregex.com/email-validation-summary/ domain labels can't be trailing or leading by "-" character. A domain can't be also leaded by "." character as it should separate two domain labels only. I've separated IP regex as well to simplify the code and added e-mail tests to cover previously failing cases.
According to official specifications which are summarised here https://en.wikipedia.org/wiki/Email_address local part of email can't be trailing or leading by "." character. It can't contain consecutive dots also. I've also added missing special characters support and added tests.
@olafleur
Copy link
Collaborator

Good job ! 👍

@olafleur olafleur merged commit 3c47de6 into gregjacobs:master Sep 12, 2017
@olafleur
Copy link
Collaborator

Thanks for your contribution !

Your fix is added to version 1.4.4

Feel free to submit other pull requests if you wish ! :)

@gregjacobs
Copy link
Owner

Thanks @viman and @olafleur!

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

Successfully merging this pull request may close these issues.

3 participants