Hi, I need to parse a string, check if there are periods and strip the string.
For example i have the following domains and subdomains: mydomain.com, dev.mydomain.com
I need to strip all periods so i have a string without periods or domain extensions: mydomain, devmydomain.
I use this for domains but i don't know how to do it for subdomains also
I need to parse each string and strip the domain and periods.It works with tr but the problem is how do i check if it's a subdomain.For the two strings above it should result:
Thank you, it works but for different domain extensions like .net, .org ..ow do I do it ? I don't know what domain extension would be, it could be .net or aomething else
Thank you but I think you misunderstood, without the domain extension, without .com, .net, .org or other domain extension. it must be something generic because I don't know the domain extension.
The examples above should be:
devmydomain (without com)
mydomain (without com)
Would take care of that. But there are also various top level domains in two parts, e.g. .co.uk or .co.au. You would have to write exceptions for those cases if you want to cover everything.