Already checked here: C# Remove URL from String and here and here Remove URLs from text string.
I tried the regular expression from the last post:
Regex.Replace(txt, "!\b(((ht|f)tp(s?))\://)?(www.|[a-z].)[a-z0-9\-\.]+\.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk)(\:[0-9]+)*(/($|[a-z0-9\.\,\;\?\\'\\\\\+&%\$#\=~_\-]+))*\b!i", "")
And I also tried the regex to which is referred:
^(((ht|f)tp(s?))\://)?(www.|[a-zA-Z].)[a-zA-Z0-9\-\.]+\.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk)(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\;\?\'\\\+&%\$#\=~_\-]+))*$
But both do not remove the urls.
I want to remove all URLs from a string using VB. These URLs are not in an a
tag.
Example string:
This is https://www.example.com/an-example-url and http://www.example.com/and-some-friendlyurl?utm_campaign=test&id=4.<br/>.Themes.
Desired result:
This is and .<br/>.Themes.