var strRegex = "^((https|http|ftp|rtsp|mms)?://)";
strRegex += "?(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?"; //ftp的user@
strRegex += "(([0-9]{1,3}\.){3}[0-9]{1,3}"; // IP形式的URL- 199.194.52.184
strRegex += "|"; // 允许IP和DOMAIN(域名)
strRegex += "([0-9a-z_!~*'()-]+\.)*"; // 域名- www.
strRegex += "([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\."; // 二级域名
strRegex += "[a-z]{2,6})"; // first level domain- .com or .museum
strRegex += "(:[0-9]{1,4})?"; // 端口- :80
strRegex += "((/?)|"; // a slash isn't required if there is no file name
strRegex += "(/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+/?)$";
var re=new RegExp(strRegex);