News for hackers. Stuff that matters.
Re:Ruby's Email Address Regexp by merlinscholz on Tuesday January 04, 2022 @10:15PM (#29804594)
And even though that sounds reasonable, it is still wrong. Technically, you do not even need the dot, if you add an MX record to a whole TLD or have some other funky DNS setup.

Source: https://www.netmeister.org/blog/email.html

Re:Ruby's Email Address Regexp by ameliaquining on Tuesday January 04, 2022 @10:40PM (#29804824)
I'll quote the WHATWG HTML spec, which that Ruby code cites as its source (https://html.spec.whatwg.org/multipage/input.html#valid-e-ma...):

> This requirement is a willful violation of RFC 5322, which defines a syntax for email addresses that is simultaneously too strict (before the "@" character), too vague (after the "@" character), and too lax (allowing comments, whitespace characters, and quoted strings in manners unfamiliar to most users) to be of practical use here.

Personally, I say if it's good enough for Web browsers, it's probably good enough for your app.

Re:Ruby's Email Address Regexp by 0x640x6D on Tuesday January 04, 2022 @10:35PM (#29804783)
The linked regexp doesn't require the TLD: https://rubular.com/r/Y9G4HR2Ox8gzqd
Re:Ruby's Email Address Regexp by NavinF on Tuesday January 04, 2022 @10:39PM (#29804813)
Yep! I know that @mil addresses used to be a thing. With the explosion of new TLDs I would be unsurprised if name@gmail addresses became a thing in the future and silly devs handled it by adding an exception to their huge regex instead of just using “.+@.+”.