我已经编写了一个正则表达式来验证URL,它可能是以下任一格式:
google.com
www.google.com
http://www.google.com
https://www.google.com
我使用过
Regex urlRx = new Regex(@"^(http|ftp|https|www)://([\w+?\.\w+])+([a-zA-Z0-9\~\!\@\#\$\%\^\&\*\(\)_\-\=\+\\\/\?\.\:\;\'\,]*)?$", RegexOptions.IgnoreCase);
它适用于http和https协议。但无法用于google.com和www.google.com。
请帮我解决这个问题。
谢谢