The local part should not contain leading or trailing dots in the EMAIL_REGEXP#124
Conversation
leading or trailing dots
…l part instead of a character class
| # practical regexp for email address | ||
| # https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address |
There was a problem hiding this comment.
It was unfortunate that there was no test cases to assert intentional violations to work, but as clearly mentioned in this comment right above the updated regexp, the leading/trailing/consecutive dots are intentionally allowed - otherwise it is considered a major breaking change. #189 (comment)
|
Replicating #177 (comment)
|
First of all, I'd like to thank all the contributors for their time and effort.
Recently, I've noticed that the EMAIL_REGEXP constant fails to handle a situations where there are leading or trailing dots in the local part of an email address. It's worth noting that while all major email providers permit the use of dots between characters, they prohibit their placement at the beginning or end of the local part.
I didn't find the exact information about the leading and trailing dots in the RFCs (5321, 5322). However, I believe it's practically useful to specify them in the regex.
Examples of an invalid email:
.hello@example.comhello.@example.com