Regex for hyperlink and hypen problem
- by Maria
I am trying to find links in user entered text and convert them to link automatically.
I am using current Regex as following, which good to find hyperlinks from text.
Regex regexResolveUrl = new Regex("((http://|www\\.)([A-Z0-9.-:]{1,})\\.[0-9A-Z?;~&#=\\-_\\./]{2,})", RegexOptions.Compiled | RegexOptions.IgnoreCase);
It is working good for almost all links so far i came across but it is giving problem when i want to detect links with hypen.
i.e. www.abc-xyz.com will not work, with above regex, can anyone help me with this?