hankknight
asked on
ASP.NET / VB / REGEX: Automatically Parse http and https Links
Using ASP.NET and VP and REGEX, how can I make links beginning with http:// and https:// HTML links?
http://example.info
should become
<a href="http://example.info">http://example.info</a>
I would like the code below to be modified:
http://example.info
should become
<a href="http://example.info">http://example.info</a>
I would like the code below to be modified:
input = RegularExpressions.Regex.Replace(input, VbNewLine, VbNewLine +"<br />")
input = RegularExpressions.Regex.Replace(input, "(\www\.\S+[^\s@,.""']+)", "<a href=""http://$1"">$1</a>")
input = RegularExpressions.Regex.Replace(input, "([^\s@,.""']+\@\S+\.[^\s@,.""']+)", "<a href=""mailto:$1"">$1</a>")
input = RegularExpressions.Regex.Replace(input, " ", " ")
return input
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.