lukevella / rallly

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
https://rallly.co
GNU Affero General Public License v3.0
3.55k stars 338 forks source link

Email validator is really broken. Won't accept .com.au .co.uk #101

Closed solidifier closed 2 years ago

solidifier commented 3 years ago

I'm not sure why you guys are being so rigorous with the email validation. You've probably just used a bad regex.

It appears that you're forcing a match to only a single domain above the binary TLD, but not subdomains. eg it allows x@x.x but not x@x.x.x So any .co.uk or .com.au emails will get rejected.. basically anything with more than one level above the TLD. You probably need a + on the final group.. Or just use a properly tested regex.

BTW, I'm specifically referring to the email field right at the top of the page at https://rallly.co/new The Your Details section.

Here's a comprehensive email regex that I've found. Probably overkill, but you can see the stackoverflow source link below. Best to copy it from the source as I think it includes some Github escape characters.

(?:[a-z0-9!#$%&'+/=?^_`{|}~-]+(?:.[a-z0-9!#$%&'+/=?^_`{|}~-]+)|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\[\x01-\x09\x0b\x0c\x0e-\x7f])")@(?:(?:a-z0-9?.)+a-z0-9?|[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])).){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\[\x01-\x09\x0b\x0c\x0e-\x7f])+)])

https://stackoverflow.com/a/201378

lukevella commented 2 years ago

Closing this as it's not longer an issue.