in reply to Regex for extracting a domain name from a string.
Then count the components with $dots = ($host =~ y/\.//); and make decisions on how much to print based on the number of dots you find.
PS: Yes, I know that regex was weak but it's just a simple example to get started. A proper module is of course suggested to have any sort of reliability for this complicated of a problem.
|
|---|