This might be a strange question but let me elaborate. I have a list of domains I need to go through and get their parent domain. Ex: from configuration.apple.com and help.apple.com I want to just keep apple.com. Is there a way to do this with regex? I have hundreds of domains to manipulate so this would make life infinitely easier.
I can't use a static index because of the varied nature of the subdomains. Any suggestions/help is appreciated. The logic I'm trying to use is basically to iterate through each string and when the first '.' is found, delete all previous characters and the '.' but I don't know how to make that work. Thanks in advance.