Regex pattern:
^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-].(?!.*\.TEST).*@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*(\.COM|\.EDU)+$
I want my pattern to match an email that does NOT include ".TEST" (using negative lookahead) right before "@" and ends with "COM" or "EDU".
This pattern works for the most part (so far), but incorrectly matches "(" when entered in the 1st half of the pattern. I realize that it's because I have "." instead of "+" after the first bit, but if I don't, then everything else doesn't work.
I've looked around, but could not find a similar enough solution. I'm bad at regex.
Any help would be greatly appreciated.