日期:2014-05-16 浏览次数:20319 次
var re=/^((http|https|ftp):\/\/)?(\w(\:\w)?@)?([0-9a-z_-]+\.)*?([a-z0-9-]+\.[a-z]{2,6}(\.[a-z]{2})?(\:[0-9]{2,6})?)((\/[^?#<>\/\\*":]*)+(\?[^#]*)?(#.*)?)?$/i; assert(re.test("www.jamcode.org")); assert(re.test("http://www.jamcode.org")); assert(re.test("http://www.jamcode.org/robots.txt")); assert(re.test("www.jamcode.org/robots.txt")); assert(re.test("https://www.jamcode.org/favicon.ico")); assert(re.test("http://www.jamcode.org/?search=Go")); //.............. //..............