Validators.email()
regexp for easier comparison with WHATWG version (#32961)
As mentioned in the previous commit, the regexp used by `Validators.email()` is a slightly enhanced version of the [WHATWG one](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address). This commit refactors the regexp (without changing its behavior) to make it more closely match the format of WHATWG version, so that it is easier for people to compare it against the WHATWG one and understand the differences. The main changes were: - Changing the order of characters/character classes inside `[...]`; e.g. `[A-Za-z]` --> `[a-zA-Z]` - Mark all groups as non-capturing (since we do not use the captured values); e.g. `(foo)` --> `(?:foo)` (This could theoretically also have a positive performance impact, but I suspect JavaScript engines are already optimizing away capturing groups when they are not used.) PR Close #32961
refactor(forms): refactor
Validators.email()
regexp for easier comparison with WHATWG version (#32961)
Angular
Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages.
Quickstart
Changelog
Learn about the latest improvements.
Want to help?
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the hotlist: community-help.
Description
Languages
TypeScript
68.6%
HTML
12.8%
JavaScript
8.4%
Pug
7%
Starlark
1.4%
Other
1.7%