PCRE: /\A[A-Z0-9_\.%\+\-]+@(?:[A-Z0-9\-]+\.)+(?:[a-z]{2,4}|museum|travel)\z/i
POSIX: /^[A-Z0-9_\.%\+\-]+@(?:[A-Z0-9\-]+\.)+(?:[A-Z]{2,4}|museum|travel)$/i
This regex is correct in every way for my needs except that it allows emails such as [email protected]. It says these are a match. If I'm not mistaken, doesn't the {2,4} after [A-Z] mean that it has to be between 2 and 4 characters? Could it be a problem with the altercation and museum and travel? I have verified that these are allowed through in my application, and a few regex testers. Also, I'm fuzzy on whether I did do the PCRE and POSIX correctly. I fear they might both just be PCRE and I'm being ridiculous. AFAIK, JavaScript is POSIX and Ruby is PCRE. So if I didn't get that right, lemme down easy, it has been a long, long night of learning regexes, in and out, and I'm trying to look badass. :)