Skip to content

Request additional Validators.email documentation details #18985

Closed

Description

@JoeKahl

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] 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

Current behavior

https://angular.io/api/forms/Validators#email
Validators.email documentation simply says: Validator that performs email validation.
I want to know more, such as if this if for an email address and what characters it might permit or prohibit. Our initial code has a pattern. Not sure who created it. Validators.pattern('[a-z0-9._%+-]+@[a-z0-9.-]+') I need to decide if I want to switch to the Validators.email but the documentation has little information.

Expected behavior

I would like to read about the Validators.email and what it prohibits.

Minimal reproduction of the problem with instructions

n/a

What is the motivation / use case for changing the behavior?

I want help deciding between Validators, such as pattern versus email.

Environment

"@angular/forms": "4.1.0"

Browser:

  • Chrome (desktop) version XX
  • Chrome (Android) version XX
  • Chrome (iOS) version XX
  • Firefox version XX
  • Safari (desktop) version XX
  • Safari (iOS) version XX
  • IE version XX
  • Edge version XX

For Tooling issues:

  • Node version: XX
  • Platform:

Others:

Activity

  1. trotyl commented on Sep 1, 2017

    @trotyl
    Contributor

    It's well-defined in HTML spec.

  2. JoeKahl commented on Sep 1, 2017

    @JoeKahl
    Author
  3. added this to the needsTriage milestone on Feb 26, 2018
  4. added
    feature
    on Jun 4, 2018
  5. modified the milestones: needsTriage, Backlog on Jun 4, 2018
  6. 4 remaining items

  7. PooSham commented on Aug 28, 2019

    @PooSham

    @trotyl Angular doesn't seem to follow the HTML spec though.

    Angular uses the following:
    ^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$
    HTML spec offers this:
    ^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$

    As a sidenote, .NET uses this abomination, which is said to be equivivalent to jquery validate
    ^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$

    Which made me realize that even if I validate the email client-side, it's not a guarantee that AspNetCore Identity will accept it... -_-

  8. added a commit that references this issue on Oct 7, 2019
    006af0b
  9. angular-automatic-lock-bot commented on Nov 7, 2019

    @angular-automatic-lock-bot

    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.

  10. locked and limited conversation to collaborators on Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: formsfeaturestate: has PR

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions