I have a field that contains email addresses, I want to use regex to strip everything before the @ symbol to give me just the domain e.g.

john@apple.com => apple.com
jill@apple.com => apple.com

How can I do this will a simple function?


Without regex, you can use this:

if A1 contains 'foo@sample.com' then in B1 you can place the following formula:

|improve this answer|||||
  • OK that works, but is way off for example "jake.noble@blah.com" gives me "le@blah.com". The incorrect proceeding chars seem to vary a lot too. – Jake N Oct 22 '13 at 23:16
  • 1
    You need to use LEN too like this =RIGHT(K3,(LEN(K3) - SEARCH("@",K3))) - thank you so much! – Jake N Oct 22 '13 at 23:21
  • Arrg, yeah sorry (made one simple example, and that worked fine), but your right! I updated the answer, so i thank you ;-) – Roger Oct 23 '13 at 0:34

If all that is in the field is an email address and you don't have to worry about validation, then .+@ will match everything up to the domain name. if you need a search and replace, then use the same search string and leave the replace "expression" empty. That should replace what is matched with nothing.

|improve this answer|||||
  • 1
    Whats the Numbers Regex function - there doesn't appear to be one!?! – Jake N Oct 22 '13 at 22:55
  • I don't know if Numbers has one. If it doesn't, then you will need to export to CSV and the problem of removing what you want from the email address becomes much harder. – Ɱark Ƭ Oct 22 '13 at 22:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .