I'm using the following method to parse URLs:
Regex.Replace(text, @"((www\.|(http|https|ftp)\://)[.a-z0-9-]+\.[a-z0-9\/_:@=.+?,##%&~-]*[^.|\'|\# |!|\(|?|,| |>|<|;|\)])",
"<a href=\"$1\" target=\"_blank\">$1</a>", RegexOptions.IgnoreCase).Replace("href=\"www.", "href=\"http://www.");
It works great, but:
asdhttp://google.com will be parsed, so how can I disallow characters before "http://" / "www"?
When a URL is inside a tag, I don't want it to be parsed:
[url]http://google.com[/url]
How can I do that?