Help

Root domain formula

Solved
Jump to Solution
8311 15
cancel
Showing results for 
Search instead for 
Did you mean: 
Jen_Baguhin
5 - Automation Enthusiast
5 - Automation Enthusiast

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

example:

If we add

Column 1
https://www.domain.com/
https://domain.com/
https://www.domain.com
https://domain.com
http://www.domain.com/
http://domain.com/
http://www.domain.com
http://domain.com

Column 2 Result in all rows of above
domain.com

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!

Chris_Lally
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.", ""),
IF(RIGHT(URL,1)="/",
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.

Joachim_Brindea
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