How do I parse a website domain from an email address column with a coda formula?

Spreadsheet analog here

Bless all Codans :crossed_swords:

I’m ot sure, but whatever it is, is is going to have regex.

Hi @David_Self ,

Two ways (at least)

  1. basically, as Excel:
thisRow.[Email].ToText().Right(thisRow.[Email].Length() - thisRow.[Email].Find("@") )
  1. with Regex (less cumbersome, to my tastes):
thisRow.[Email].RegexReplace(".*@", "")

I hope this helps.

Cheers!

1 Like

I was able to solve it using this formula!

    Right(thisRow.Email,Length(thisRow.Email)-Find("@",thisRow.Email ) )

@David_Self or slice(thisRow.email.ToText(),Find("@",thisRow.email)+1)
but I prefer the Regexreplace from @federico

2 Likes

Thank you @Federico_Stefanato ! Very heplful.

1 Like

[emailString].ToText().Split(’@’).nth(2)

2 Likes

The simplest would be

Email.ToText().Split("@").Last()

No need for regex in this case, although generally speaking whenever you need to split, match, or extract a substring according to some pattern (e.g. “everything after @” is also a pattern), that’s what regular expressions are for. It’s too bad though that RegexExtract() is still an experimental formula. It’s more logical to extract everything after @

Email.RegexExtract("(?<=@).*")

than replace everything up to @ inclusively with a blank string

Email.RegexReplace(".*@", "")
1 Like