/\/keyNum\/(\d{1,2})\/?/.exec(window.location.href);

window.location.href  获取url
keyNum可以替换为自己的key值
exec()匹配并返回匹配到的数据

相关文章: