I have a string with multiple URLs and some text in between.
How can I replace each URL with their hostname and top-level-domain?
Example Input: www.google.com some text google.com some text http://google.com some text https://stackoverflow.com/questions/ask
Desired Output: google.com some text google.com some text google.com some text stackoverflow.com
I've found the Python module tldextract but that just helps with extracting hostname + tld but not with finding and replacing all URLs
Thanks in advance!