Things not to do when validating email addresses

ERROR: WOUTER+TIMHOTEL@GREP.BE is not a valid email address

True, because I entered it in lowercase.

  1. Email address local parts (the bit before the @) are case sensitive. That means you can't just convert it to all caps and assume it will arrive.
  2. local parts can be composed out of any character from the following list:
    • alphanumeric characters (a-z, A-Z, 0-9), and
    • !#$%&'*+-/=?^_`{}|~.

This means that if you're trying to validate an email address by adding a regular expression that does more than check whether there's not exactly one @ in the address, you're almost always wrong.

Next time you try to tell me my mail address is invalid, go read the RFC first.

Morons.