Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Jul 29, 2021 01:26 PM
Hi all, I’m trying to create a formula that helps me trim a product specific link to its root website link.
For example, I have: https://freestar.co/products/12-x-bottles
And want to get: https://freestar.co
In some cases, the links are https://www.
and sometimes they are are above (without the www).
Could you help me out?
Solved! Go to Solution.
Jul 29, 2021 02:51 PM
Welcome to the Airtable community,
This is a great use case for regular expressions.
If all of your urls will begin with “https”, you could use this formula
IF(
REGEX_MATCH({url}, "https://[^/]+"),
REGEX_EXTRACT({url}, "https://[^/]+")
)
Jul 29, 2021 02:51 PM
Welcome to the Airtable community,
This is a great use case for regular expressions.
If all of your urls will begin with “https”, you could use this formula
IF(
REGEX_MATCH({url}, "https://[^/]+"),
REGEX_EXTRACT({url}, "https://[^/]+")
)
Jul 30, 2021 03:30 AM
Thank you @kuovonne - this worked perfectly! :clap: