Skip to content

Fix email validation regex to require 2+ character TLDs#67

Open
bellisabell wants to merge 1 commit intomainfrom
bell/fix-email-regex-tld
Open

Fix email validation regex to require 2+ character TLDs#67
bellisabell wants to merge 1 commit intomainfrom
bell/fix-email-regex-tld

Conversation

@bellisabell
Copy link
Copy Markdown
Contributor

Summary

Fixes the email validation regex that was allowing single-letter TLDs (e.g., user@example.a).

Changes

Changed the TLD portion of VALID_EMAIL_REGEX from [a-z]+ to [a-z]{2,} to require at least 2 characters, which matches valid TLD requirements.

Testing

Emails like user@example.a will now be rejected, while valid emails like user@example.com or user@example.co continue to work.

Closes #31

The regex pattern [a-z]+ allowed single-letter TLDs which are invalid.
Changed to [a-z]{2,} to require at least 2 characters.

Closes #31
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

Successfully merging this pull request may close these issues.

Bug: Email validation regex allows single-letter TLDs

2 participants