需要正则表达式来验证.net的URL验证 [英] Need Regex for Url Validation for .net
本文介绍了需要正则表达式来验证.net的URL验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
需要正则表达式进行网址验证
规则:
1.即使(http或https)是否包括在内。
2.它不包含其他协议,如ftp,mailto
3.它不应包含子域URL和/之后.com
4. www必须包含在网址
5.它验证这种类型的domail还
.firm.in
.co.uk
.co.cc
在www.example示例点后的.com包含[az]
解决方案
的[2,4] + [。] + [2]字母^(HTTP [S]://)?[。] [W] {3}([。] [A-Z0-9] +)+([。] [AZ] {2,4})([ az] {2})
试试这个:
^((http | ftp | https | www)://)?([\ w +?\。\ w +])+([a-zA-Z0-9 \〜\! \ @ \#\
Need Regular Expression for url validation
Rules:
1. It should validate even if (http or https) is included or not.
2. it not contain other protocols like ftp, mailto
3. It should not contain sub domain URL's and "/" after .com
4. www is must included in url
5. it validate this type of domail also
.firm.in
.co.uk
.co.cc
In www.example.com after example dot .. it contain [2,4]+[.]+[2] letter of [a-z]
解决方案
^(http[s]?://)?[w]{3}[.]([a-z0-9]+[.])+([a-z]{2,4}[.])([a-z]{2})
Try this:
^((http|ftp|https|www)://)?([\w+?\.\w+])+([a-zA-Z0-9\~\!\@\#\
这篇关于需要正则表达式来验证.net的URL验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文