Best answer

Extract domain from email adress with formatter

  • 3 September 2021
  • 3 replies
  • 1172 views

Hello everybody : ) 

Does anybody know how to extract only the domain from an email adress with the formatter ?

Like the following :

“me@company.com” → “company”

 

Thanks a lot :smile:

icon

Best answer by luke.johnson 3 September 2021, 17:18

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Userlevel 7
Badge +14

Hi @optimio 

Formatter > Text > Split (@) and keep the last segment.

Userlevel 1

Hi @optimio!

For a more complex extraction like this, you can use the Formatter’s “Extract Pattern” transform option. This allows you to provide a Regular Expression to find a match. Regular Expressions can look pretty intimidating, but I believe the following the pattern should achieve what you’re looking for:

(?<=@)[^.]*.[^.]*(?=\.)

 

 

This would produce the following output:

 

 

Let me know if this helps or if you have any other questions!

Userlevel 1

Hi @optimio 

Formatter > Text > Split (@) and keep the last segment.

This will keep “.com” in the output, but it’s definitely a simpler solution if that isn’t an issue!