fork download
  1. import re
  2.  
  3. email = "firstname.lastname@gmail.com";
  4. m = re.match(r'^([^\s@.]+)\.([^\s@.]+)@([^\s@]+)$', email)
  5. if m:
  6. print(m.groups())
  7.  
Success #stdin #stdout 0.04s 9348KB
stdin
Standard input is empty
stdout
('firstname', 'lastname', 'gmail.com')