whats is the best way to find and replace url in string. Now I use regexp
Regex regx = new Regex("http(s)?://([\\w+?\\.\\w+])+([a-zA-Z0-9\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)_\\-\\=\\+\\\\\\/\\?\\.\\:\\;\\'\\,]*([a-zA-Z0-9\\?\\#\\=\\/]){1})?",
RegexOptions.IgnoreCase);
string output = regx.Replace(text, "<a href=\"$0\" target=\"_blank\">$0</a> ");
but this is ugly code and works badly, becouse it is not find www.server.com and http://server.nonexist is bad url bur regexp find this.
What is the best way to do fuction which get some long string and return string with html link?
for example
input = Lorem ipsum dolor sit http://www.server.com/ amet
output = Lorem ipsum dolor sit <a href="http://www.server.com/"> http://www.server.com/</a> amet