I have comment box when i type the comment and if comment have any link then i automatically convert to the link by following way.
protected string MakeLink(string txt)
{
Regex regx = new Regex("(http|https)://([a-zA-Z0-9\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)_\\-\\=\\+\\\\\\/\\?\\.\\:\\;\\'\\,]*)?", RegexOptions.IgnoreCase);
MatchCollection mactches = regx.Matches(txt);
foreach (Match match in mactches)
{
txt = txt.Replace(match.Value, "<a href='" + match.Value + "'>" + match.Value + "</a>");
}
return txt;
}
when i put the tag will show like this " lt;a href='http://asd.com'gt;http://asd.com lt;/a gt; " [ right now i removed & otherwise it create link in my Question. ]