I have an issue trying to get a correct regex for an email validator for my jQuery validate plugin. I'm trying to get an expression that will only allow email addresses like the following:
firstname.mi.lastname.civ (or .mil)
Lastname should allow a number. And addresses should only be allowed from a select set of domains: (ndu.edu or nps.edu or any address from .mil or .gov)
I've been playing around with RegExr.com, which is great, but I'm having a problem getting the right combo to work in all my situations. Here is what I have so far:
This works okay for: email@example.com (or .gov) and for firstname.lastname@example.org (or .gov)
But I can get my other domains to work. Any help would be greatly appreciated as I am getting rather frustrated trying to get this completed. I admit I'm not that savvy with regex!