Skip to content

Email validation snippit matches improper emails as well #21

@HazemSayad

Description

@HazemSayad

Describe the bug
using the !valemail snippet: /[A-Z0-9._%+-]+@[A-Z0-9-]+.+.[A-Z]{2,4}/igm it matches normal emails fine, BUT it also matches commas and some other symbols. Examples: @gmail,com, @gmail?com, @gmail:com match

To Reproduce
Steps to reproduce the behavior:

  1. use the !valemail snippet: regex = !valemail
  2. "test@gmail:com".match(regex) matches

Expected behavior
It should not match unacceptable symbols as per email standards

Screenshots
image
above pic shows that the regex matches :com

image
above pic shows that the regex matches ?com

Additional context
during testing, i found that i was able to create weird emails, so i also checked with regexr.com to verify what's going on

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions