You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Performance issue
[ ] Feature request
[x] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:
According to #18985, EMAIL_REGEXP must match the HTML spec.
It's not outdated. It is an enhanced version 😁
Basically, the email regex is ported over from AngularJS.
A little background:
A while back, the AngularJS regex looked almost identical to the WHATWG one (save for some domain name length restrictions).
Then, in angular/angular.js@f3f5cf72e, the regex was enhanced to incorporate more RFC rules (e.g. related to domain names, etc). The commit message has more details.
There is no such thing as a perfect email regex, so either one is as good imo.
👍 for documenting what it does, though (even if just a high-level overview; one can always find the full details in the source code 😁).
@Naveen562117 ... on a project you usually have your own validation set of validators (mainly because of your own rules for returned errors data structures) where the built in ones you wrap into (+ maybe enhance by your concrete needs).
"validators.email" is accepting the
email ID such as
"example@gmail"
which is invalid without .com at the end [email protected]
is the valid
this was the issue i found
and the solution i for this issue is this: Validators.pattern ('([a-zA-Z0-9.!#$%&’*+/=?^_{|}~-]+@[a-zA-Z0-9-]+[.](?:\[a-zA-Z0-9-]+))')
@Maxkorz You are right about the tests and I agree with you but in terms of documentation, I think the Angular team doesn't need to explain everything they do if it takes a search on google to understand what a valid email is. Looking forward to the final decision about this here.
@ponkys Disagree. The email validator does not match the rules provided by the RFC (2822?). Because of that, I have no idea what their email validator does. On a project with very specific requirements it would be nice to know without guessing/checking.
For instance their built in validator does not allow " or \ characters and fails against some international characters.
Activity
gkalpak commentedon Jul 29, 2018
It's not outdated. It is an enhanced version 😁
Basically, the email regex is ported over from AngularJS.
A little background:
A while back, the AngularJS regex looked almost identical to the WHATWG one (save for some domain name length restrictions).
Then, in angular/angular.js@f3f5cf72e, the regex was enhanced to incorporate more RFC rules (e.g. related to domain names, etc). The commit message has more details.
There is no such thing as a perfect email regex, so either one is as good imo.
👍 for documenting what it does, though (even if just a high-level overview; one can always find the full details in the source code 😁).
Naveen562117 commentedon Aug 2, 2018
validators pattern for email
mlc-mlapis commentedon Aug 2, 2018
@Naveen562117 ... on a project you usually have your own validation set of validators (mainly because of your own rules for returned errors data structures) where the built in ones you wrap into (+ maybe enhance by your concrete needs).
Naveen562117 commentedon Aug 2, 2018
"validators.email" is accepting the
email ID such as
"example@gmail"
which is invalid without .com at the end
[email protected]
is the valid
this was the issue i found
and the solution i for this issue is this:
Validators.pattern ('([a-zA-Z0-9.!#$%&’*+/=?^_{|}~-]+@[a-zA-Z0-9-]+[.](?:\[a-zA-Z0-9-]+))')which is accepting the email id
trotyl commentedon Aug 2, 2018
@Naveen562117
example@gmailis a valid email address which has been answered for many years:https://stackoverflow.com/questions/20573488/why-does-html5-form-validation-allow-emails-without-a-dot
An application could use stricter rule for its business requirement, but that won't change what a valid email is.
ponkys commentedon Aug 2, 2018
It seems that the discussion here is over and the issue can be closed.
[7/1/19] Update: There are reasons people have pointed out in this thread that makes me regret this comment. this issue should keep open.
ponkys commentedon Aug 9, 2018
@Maxkorz You are right about the tests and I agree with you but in terms of documentation, I think the Angular team doesn't need to explain everything they do if it takes a search on google to understand what a valid email is. Looking forward to the final decision about this here.
scottseeker commentedon Jan 7, 2019
@ponkys Disagree. The email validator does not match the rules provided by the RFC (2822?). Because of that, I have no idea what their email validator does. On a project with very specific requirements it would be nice to know without guessing/checking.
For instance their built in validator does not allow " or \ characters and fails against some international characters.
ponkys commentedon Jan 7, 2019
@scottseeker Thanks for pointing this out.
docs(forms): expand e-mail validation description (#32961)
angular-automatic-lock-bot commentedon Jun 2, 2021
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.