firasdib / Regex101

This repository is currently only used for issue tracking for www.regex101.com
3.26k stars 199 forks source link

Library Regex for Email needs to be corrected. #1988

Closed gajendhir closed 1 year ago

gajendhir commented 1 year ago

Bug Description

Existing Regex for Email

\w+[@]+\w+[.]+[a-z]\w+

This allows multiple consecutive dots (.) in an email address after the @

Reproduction steps

check it for - emailad@example..com

Expected Outcome

Not Matched but it matches Capture

Solution

A more appropriate regex for email would be

\w+[@]+(?:\w+[.])+[a-z]\w+

Browser

Any

OS

Any

working-name commented 1 year ago

Hi @gajendhir,

Thank you much for your feedback!

The library is open for submissions from anyone. You can vote entries up or down, and the idea is that the good ones would rise to the top. Please use your voting power and please feel free to post better regexes on there.