Replace all URL unless it is allowed
- by ratamaster
I had a regex that replaced all URLs from a given string:
my_string = "www.example.com test www.mysite.com"
my_string.gsub!(/[a-zA-Z0-9\-\.]+\.(com|net|de|org|uk|biz|info|co.uk|es|de)(\/\S*)?/i,'(site hidden)')
As a result of the above I get: "(site hidden) test (site hidden)"
How could I change the regex to not replace www.mysite.com ???
It means that the replace should output "(site hidden) test www.mysite.com"
Thanks !