Skip to content

Issue With Email Validation Regex Pattern #1997

@SumithThota

Description

@SumithThota

Problem :

I found that the email regex pattern ^[^\s@]+@[^\s@]+\.[^\s@]+$ at Source
will fails to handle several edge cases and may incorrectly validate or reject certain legitimate email formats.

Propsal :

pattern: ^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$
This pattern more effectively handles:

  1. Quoted local parts
  2. Dots within the local segment
  3. IP-based domains
  4. Complex but valid email formats

Goal

Enhance the email validation logic to ensure broader compatibility with real-world email formats and align with standard validation practices.

Assign to Me

I would like to work on this issue.
Kindly assign this issue to me so that I can proceed with implementing and testing the improved regex validation.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions