<script type="text/
javascript">
var url = "http://www.***.com/n/2013/01/08/1037962.shtml";
//url = "http://www.***.com/mine/mine_show.aspx?id=1037962";
var reg = //d+.shtml|?id=d+/gi;
var result;
if((result = reg.exec(url)) != null){
result += "";
var id = result.match(/d+/g);
alert(id);
}
</script>