我读过regex文档,但不知道如何实现。
我有这样的http://testhermes.tumblr.com/post/108728110699/hermes-instagram-photo-sit-back-and-relax?index=1,我想在"108728110699“和index= "1”之后取数字。
你能帮帮我吗。谢谢。
发布于 2015-01-27 10:14:18
var url = "http://testhermes.tumblr.com/post/108728110699/hermes-instagram-photo-sit-back-and-relax?index=1";
url = url.match(/\d+/g);
alert(url[0]); //108728110699
alert(url[1]); //1<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
https://stackoverflow.com/questions/28167828
复制相似问题