Skip to content

Issue With Email Validation Regex Pattern #1997

Closed

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.

Activity

  1. SumithThota commented on Oct 10, 2025

    @SumithThota
    ContributorAuthor

    Hi @wiz0floyd ,

    I have submitted a pull request for the changes. Please review it at your convenience.
    If any modifications or improvements are needed, feel free to let me know.

    Thank you!

  2. SumithThota commented on Oct 10, 2025

    @SumithThota
    ContributorAuthor

    Hi @wiz0floyd ,

    I realized that the issue was closed because I accidentally closed the previous PR.
    I’ve now reopened the pull request (or raised a new one).
    Please review it when you get a chance, and let me know if any further changes are needed.
    Thank you for your time and understanding!

  3. SumithThota commented on Oct 10, 2025

    @SumithThota
    ContributorAuthor

    Hi @wiz0floyd I just raised the PR #2012
    Please review it when you get a chance, and let me know if any further changes are needed.
    Thank you for your time and understanding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions