title: Regular Expression for Email Validation
body: <p>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:</p>
  
  <p>firstname.mi.lastname.civ (or .mil)</p>
  
  <p>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)</p>
  
  <p>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:</p>
  
  <p>^[A-Z0-9]+.([A-Z0-9]+.)<em>([A-Z0-9]+)+@([-a-z0-9_]+(.[-a-z0-9_]+)</em>((nps.edu|ndu.edu)|.(gov|mil)))(:[0-9])?$</p>
  
  <p>This works okay for:
  firstname.mi.lastname@mail.mil  (or .gov)
  and for
  firstname.mi.lastname1@mail.mil (or .gov)</p>
  
  <p>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!</p>