标签:name match pre 判断 amp ram 字符 ati blog
/// <summary> /// 判断一个字符串是否为url /// </summary> /// <param name="str"></param> /// <returns></returns> public static bool IsUrl(string str) { try { string Url = @"^http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?$"; return Regex.IsMatch(str, Url); } catch (Exception ex) { return false; } }
标签:name match pre 判断 amp ram 字符 ati blog
原文地址:http://www.cnblogs.com/testsec/p/6095702.html