日期:2014-05-16 浏览次数:20429 次
<script language=javascript> var a="http://www.abc.com/temp/bbs/index.asp" var b="http://adfadf.com" var c="http://www.mmkkk.com/aaa/" var d="http://WWW.7799.net/" var e="http://www.xx.net/aaa/bbb/default.htm" var f="http://www.javaeye.com/topic/17434540002" var g="http://www.ccty.org/login.do?a=54&pwline=http://ccc.net/3ffa.php" var h="http://www.21cn.com/index" var i="http://www.safsaf.net/bbs/dispuser.asp?username=张三" function show(str) { re=/http:\/\/([^?]+\/)+([^\/]+(\?.*)?)$/ return (re.test(str))?RegExp.$2:"" } alert(show(a)) alert(show(b)) alert(show(c)) alert(show(d)) alert(show(e)) alert(show(f)) alert(show(g)) alert(show(h)) alert(show(i)) </script>