I would use regex to trim everything to the right of the 3rd “/“, then do a regex split by “.” (Or regex to trim everything left of the 2nd “.” From the right) , then clean it up with a simple formula in the Column Expressions node.
I am still doing a lot of trial and error on RegEx test websites for things like directional character counting, but I am sure one of the RegEx masters on here can just shoot from the hip and give you a formula.
First of all, there is no such thing as the “short domain” What you are looking for is what’s commonly referred to as the domain name or simply domain, though this is also not entirely accurate (hence why I said “commonly referred to” - the proper term is the “root domain” or “apex domain”).
www.hello.com is a subdomain of hello.com for example, and asewa.asdhiasd.to is a subdomain of asdhiasd.to.
Looking at what @iCFO , the idea is good, but unfortunately not all domains follow this structure, so it will not work with all domain names. UK urls for example have domains that ends with .co.uk or .gov.uk (e.g: yahoo.co.uk) for example. Canadian urls also have this kind of domains, for example .qc.ca (e.g: etatcivil.gouv.qc.ca)
So, the proposed solution would not work.
Palladian offers a node called URL Domain Extractor that does exactly what you are looking for:
This is an example of the node in action:
Palladian is a very useful extension and offers a lot of tools. I would strongly recommend getting it. However, sometimes there are company policies that do not allow “external” extensions to be installed, and if that is the case for you and can’t get the Palladian extension, you can check what @takbb did there without the Palladian extension:
Awesome node share @bruno29a! In general I always find myself defaulting back to manually solving problems like these. The regex would have gotten pretty complex if it needed to handle domain structures differences that you highlighted, which is a massive time waste vs this solution. I am going to take some time and explore more of these “specialty task” nodes.