Frameworks usually have some sort of email parser. Email parsing is non trivial. But I agree matching
.*?@domain.com$ would probably work fine.
1. Split on @
2. Get last string from array
3. Convert to lowercase
4. Perform exact string compare against target domain
It's possible that there's some window for obscure unicode hijinks, but I'd posit that a regexp parser or a "proper" email parsing library is just as at-risk. Possibly more so as those would be significantly more complicated and involve significantly more code.The default is greedy... match match match nom nom nom!