161
duckWit
6y

If you're going to bother to detect that my input is without hyphens, then you can certainly insert them for me too.

Comments
  • 32
    On the same topic: forms that say your email is invalid because your (phone) keyboard automatically added a space at the end
  • 24
    @Nitwix or forms that disallow the plus (+) in email addresses..
    I use this to sort my Gmail inbox with rules.

    Once I had a case where I could register using such an email but I could not log in because the + was invalid in the login form 🤔
  • 9
    The general rule I try to follow for emails is: "just accept anything which has at leas one @ and send a verification mail"

    Related: https://youtube.com/watch/...
  • 7
    @bootleg-dev Yeah I think .*@.*\..* (anything@anything.anything) is all the email validation you can reasonably do.
  • 1
    Yeah! And fuck the password forms! Might just auto add some random numbers and Case-shuffle the letters for me while you're at it!

    I mean; I'm not even going to remember it anyways with all your requirements, so feel free to do whatever you want, just don't bother me with it.
  • 1
    All great comments.

    @bootleg-dev that's what I do too. I don't even bother with regex for email addresses. Unless you know the exact domains or formats of email addresses you are looking for, I simply look for the '@' symbol and then do email verification through a click back in a sent email.
  • 2
    For phone numbers, most websites don't accept the country calling codes (+33 for France for example). When living abroad it's so annoying!
  • 1
    There's a library for this. Works real nice. I think the one I use is by another author but https://github.com/jackocnr/...
Add Comment