Code Monkey home page Code Monkey logo

Comments (7)

Tratcher avatar Tratcher commented on June 28, 2024

The email address is never used, why bother validating it?

from twitarr.

grundoon avatar grundoon commented on June 28, 2024

I'd posit that the only real purpose of the validation is to catch typos in the (optionally) shared field in one's profile. I have no insight as to why it was originally made a mandatory part of the registration.

The length thing is pretty archaic though and I agree should be upped to cover the newer, longer TLDs. I'm personally using the official Swift regex:

[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}

from twitarr.

hendricksond avatar hendricksond commented on June 28, 2024

There's not much point in requiring the e-mail address during registration, other than having it on file in case we want to send out some sort of notification before putting the twitarr archives online post-cruise (which is something we haven't done in a while). We don't confirm the e-mail address for new sign-ups. It could be removed from registration, but I'd rather keep it in.

I do agree that the current regex needs to be fixed or removed. But before changes are made, a consensus on which one to use (or to remove) should be made, and we should use the same one everywhere (if possible).

I do like @grundoon 's suggestion. I can't really pose an alternative, since I'm mostly a .NET guy who does email validation using System.Net.Mail.MailAddress.

from twitarr.

Tratcher avatar Tratcher commented on June 28, 2024

I had to update System.Net.Mail.MailAddress a while back. Validation is a very deep rat hole, especially now that unicode email addresses are going live. Best to keep it a simple "anychars@anychars".

from twitarr.

grundoon avatar grundoon commented on June 28, 2024

Is it my lack of regex parsing fu, or does not even the W3C one allow either of my original totally valid addresses... grundoon@[8.8.8.8] or bang path formats?

from twitarr.

Hixie avatar Hixie commented on June 28, 2024

I don't believe IPv6 addresses or bang path formats are allowed by the specs these days.

The HTML spec regexp doesn't attempt to support IDN e-mail addresses because the HTML type=email form field is supposed to convert them to punycode.

If we don't really care about the exact syntax, we might want to just allow anything, or anything with a single "@", or something. I don't really mind what we allow, I just noticed that what we require now is not correct. :-) I'll make the client I'm writing locally test against whatever the server tests for.

from twitarr.

hendricksond avatar hendricksond commented on June 28, 2024

Ruby has a built-in email address regexp, URI::MailTo::EMAIL_REGEXP, which is an implementation of the one recommended by the HTML spec. I'm going to switch it to use that - while not perfect, it's better than what we have now.

It's also likely that e-mail address will be removed from registration in the near future. If it is removed from registration, it will be kept on the user profile for anyone who wants to publicize it.

from twitarr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.