Re: Root domain formula

Jump to Solution
3238 0
Showing results for 
Search instead for 
Did you mean: 
5 - Automation Enthusiast
5 - Automation Enthusiast

Is there any way to change different versions of domains to its root domains?


If we add

Column 1

Column 2 Result in all rows of above

15 Replies 15

Hey, @Brian_Moran

Sorry, I’m just seeing this. Luckily, in the 4 years since I wrote that formula you are referencing, Airtable has added some REGEX functions that should help with that.

Perhaps try replacing the entire SEARCH('com/', URL) function with this:

REGEX(URL, "[com|org|net|ie|io]/")

If that works, you can continue to add any other tld’s you might need inside those brackets, separated by a ‘pipe’ character |.

Thanks Jeremy! I’ll give that a try and report back!

4 - Data Explorer
4 - Data Explorer

I ended up needing to just get rid of the www. or https:// and such AND a trailing “/” IF there was one, hope it helps!

LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(URL, "http://",""), "https://",""), "www.", ""),
LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(URL, "http://",""), "https://",""), "www.", ""))-1,
LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(URL, "http://",""), "https://",""), "www.", ""))

Thanks! I used this and it worked great. It saved me a bunch of time to look up something someone shared instead of reinventing it myself.

6 - Interface Innovator
6 - Interface Innovator

This removes subdomains, folders, etc and doesn't output anything if there is no url.

IF({url}="","",REGEX_EXTRACT( {url}, '^(?:https?:\\/\\/)?(?:[^@\n]+@)?(?:www\\.)?(?:[^.]+\\.)?([^:\\/\n?]+\\.[^:\\/\n?]+)'))


This worked very well, thank you