Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

your email regex is WRONG #1

Open
RandalSchwartz opened this issue May 30, 2023 · 1 comment
Open

your email regex is WRONG #1

RandalSchwartz opened this issue May 30, 2023 · 1 comment

Comments

@RandalSchwartz
Copy link

        r'^[a-zA-Z0-9.a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9]+\.[a-zA-Z0-9.]{2,}$';

No, please don't use this regex to validate email. It's wrong. The shortest regex to validate an RFC822 email address is about 2400 characters, and is given in https://www.ex-parrot.com/pdw/Mail-RFC822-Address.html. Anything shorter is WRONG, unless you're using a grammar, as package:email_validator properly does. Use that for Dart/Flutter please.

@sidx8
Copy link
Owner

sidx8 commented Aug 11, 2023

Hello,
Thank you for pointing out the issue with the regex for email validation. I appreciate the link and the suggestion to use a more comprehensive solution. I understand the intricacies and nuances of email validation and the importance of adhering to the RFC822 standard. I'll definitely take a closer look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants