I'm looking for a regex to remove every url or domain name from a string, so that:
string='this is my content domain.com more content http://domain2.org/content and more content domain.net/page'
becomes
'this is my content more content and more content'
Removing the most common tlds is enough for me, so I tried
string = re.sub(r'\w+(.net|.com|.org|.info|.edu|.gov|.uk|.de|.ca|.jp|.fr|.au|.us|.ru|.ch|.it|.nel|.se|.no|.es|.mil)\s?','',string)
but this is removing too much stuff and not only urls. What would be the correct syntax?
.matches any char.