判断字符串是否 是url
2014-03-05 14:07
344 查看
public static bool IsUrl( string url) |
{ |
return Regex.IsMatch(url, @"^(((file|gopher|news|nntp|telnet|http|ftp|https|ftps|sftp)://)|(www\.))+(([a-zA-Z0-9\._-]+\.[a-zA-Z]{2,6})|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(/[a-zA-Z0-9\&%_\./-~-]*)?$" , |
RegexOptions.IgnoreCase); |
} |
相关文章推荐
- js/jquery获取当前页面URL地址并判断URL字符串中是否包含某个具体值(获取URL的?或者#)
- js 判断url的?后参数是否包含某个字符串
- 判断是否URL的正则表达式【Java和javascript】字符串是否包含中文
- 校验出生日期,校验身份证格式,校验会员账户:9开头数字,校验手机号码是否合法,判断字符串中的url是否都是图片格式字符串,通过图片url读取图片并将图片转换成base64编码
- 判断一个字符串是否为一个URL
- C# 判断一个字符串是否为url
- 判断一个url字符串的字节长度是否过长
- js/jquery获取当前页面URL地址并判断URL字符串中是否包含某个具体值
- 用MASM32来DIY判断字符串1是否为字符串2的子串的函数演示代码(源码+exe)(应用lstrcpyn()和lstrcmp(),区分大小写)
- iOS: 如何判断字符串是否相等?
- php判断是否包含字符串
- JAVA判断字符串中是否包含中文
- (java)判断一个字符串是否是合法的ipv4地址
- mysql 判断字符串是否数字
- jsp中使用equals()判断字符串是否相等时出现的问题(.equals("1")出现的异常)
- 字符串的转换、逆置、删除重复元素及判断是否为邮件格式
- C# 判断一个字符串是否数字开头
- 判断两个字符串是否互为旋转词 Python版
- 21.判断字符串是否为回文
- 判断是否为字符串