underscore before @
Validation fails when addresses have underscore before @ For example:
But these are valid e-mail addresses
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 202e3f9f-a12a-53de-9069-fd469e3dbebc
- Version Independent ID: fd3699bb-4881-b6b4-1275-43eed3d5f626
- Content: How to: Verify that Strings Are in Valid Email Format
- Content Source: docs/standard/base-types/how-to-verify-that-strings-are-in-valid-email-format.md
- Product: dotnet
- GitHub Login: @rpetrusha
- Microsoft Alias: ronpet
Thanks for your feedback @ezin82. @Thraka was already working on some updates to this topic, so he'll investigate this.
@ezin82 Hi! After pondering this and #5305 and #7184 for a while, I've decided not to fix this. There are many discussions on the internet about using regex for email validation and how it seems almost impossible to get the "perfect" regex.
There are many other valid things you can put in that email validation test that actually fail. This sample isn't meant to be the best email validation test, it's simply meant to be there as an example.
You'll need to customize the regex to fit your needs, or find another validation regex to use in its place.
- https://codereview.stackexchange.com/questions/77072/regex-to-match-email-address
- https://softwareengineering.stackexchange.com/questions/78353/how-far-should-one-take-e-mail-address-validation/78363#78363
- https://www.regular-expressions.info/email.html
- https://davidcel.is/posts/stop-validating-email-addresses-with-regex/
- https://hackernoon.com/the-100-correct-way-to-validate-email-addresses-7c4818f24643