Is there a way to extract the domain from a text field that contains the URL.
Example:
URL: cobas® 8100 automated workflow series
Extracted domain: diagnostics.roche.com
Is there a way to extract the domain from a text field that contains the URL.
Example:
URL: cobas® 8100 automated workflow series
Extracted domain: diagnostics.roche.com
hi @JHConsulting , like below?
thisRow.[the url].totext().slice(1,sum(thisRow.[the url].Find(".com"),Length(".com")))
best, christiaan
Hi @JHConsulting ,
if you want something more generic embracing a wider variety of URLs, perhaps the Regex could be helpful (credit to this: javascript - Regular Expression - Extract subdomain & domain - Stack Overflow)
However, there are some caveats to take into considerations:
RegexExtract()
Anyway, you put on a variable (Regex
as a column or named formula) the regex:
^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/?\n]+)
And then:
URL.RegexReplace(Regex, "$1").regexExtract(Regex)
I hope this helps.
Cheers!
Thank you. Works fine with .com
Thank you. I will try it.