jasonfry.co.uk

Bad Email Address Validation

For many years I have used a personal domain for my personal email. My email address only has a single character before the '@' symbol (e.g. a@example.com). In the last few months it has started to get rejected more often, due to over-zealous and incorrect client-side validation.

No regex will ever be able to validate an email address fully. Stop trying so hard. Let the email delivery system handle it or keep it incredibly simple, e.g. /^.+@.+$/. This is the regex I use on systems I work on.

Every time I encounter this issue I try and talk to support staff about it but I'm yet to see this issue fixed. Your support staff won't understand when someone encounters a bug like this - they'll just run through a script and tell your potential users to do silly things like clearing cookies to sign into an Android app (this has happened to me).

Current list of known offenders:

All of the above have lost out on purchases. Bad code costs your business money.