示例1:http://news.jinti.com/news/20090901/251947.htm
示例2:http://news.jinti.com/news/20098201/247.htm
示例3:http://news.jinti.com/news/20101001/3219723.htm
如何用js正则取流水号?结果应该是:2519472473219723
示例2:http://news.jinti.com/news/20098201/247.htm
示例3:http://news.jinti.com/news/20101001/3219723.htm
如何用js正则取流水号?结果应该是:2519472473219723
解决方案 »
- mousewheel 在 jquery 1.8.2 下无效
- js jquery 页面搜索
- 如保使当前网页中的播放视频自动暂停
- jqGrid中,设置行背景色的方法是什么呀
- 网络记事本 怎么实现的
- jQuery VS JavaScript!
- 点页面右上角那个"X"时能不能弹出一个确认对话框?
- 我使用window.open与window.showModalDialog和打开的页面高度和宽度为什么不一样?我想使用showModalDialog打开页面大小为width:320px,hei
- 在from中怎么访问iframe中的控件?
- 用户名检测问题!!!!在线等待!!
- 怎么跳出each函数???死活跳不出来啊
- 下面这段javascript在IE下能work, FF下不行,怎么修改
var str = "http://news.jinti.com/news/20090901/251947.htm"
var no = str.match(/(\d+)\.htm/i);alert(no[1]);
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<script language="JavaScript" type="text/javascript">
window.onload=function(){
var s1="http://news.jinti.com/news/20090901/251947.htm ";
var s2="http://news.jinti.com/news/20098201/247.htm" ;
var s3="http://news.jinti.com/news/20101001/3219723.htm ";
var rex=/(\d+).htm/g;
if(rex.test(s1)) alert(RegExp.$1);
}
</script>
</head>
<body>
</body>
</html>
str.match(/\d+(?=\.htm)/)[0];