var a = 'url("file:///C:/Users/Administrator/Desktop/slimbox/example.jpg")'; var as = a.split("/"); alert(as[as.length-1].replace("\"\)", ""));
pos1 = lastindexOf("/"); pos2 = lastindexOf(")");
var str = 'url("file:///C:/Users/Administrator/Desktop/slimbox/example.jpg")'; alert(/\/([^\/\)]+)"\)/.exec(str)[1])
我取非记错了,把^写在[]前面了,所以没调出来,这个应该可以了 var a = 'url("file:///C:/Users/Administrator/Desktop/slimbox/example.jpg")'; var as =/([^\/]+)\"\)$/.exec(a)[1]; alert(as);
var str = 'url("file:///C:/Users/Administrator/Desktop/slimbox/example.jpg")'; alert(/\/([^\/\)]+)\)/.exec(str)[1])
var as = a.split("/");
alert(as[as.length-1].replace("\"\)", ""));
pos2 = lastindexOf(")");
alert(/\/([^\/\)]+)"\)/.exec(str)[1])
var a = 'url("file:///C:/Users/Administrator/Desktop/slimbox/example.jpg")';
var as =/([^\/]+)\"\)$/.exec(a)[1];
alert(as);
alert(/\/([^\/\)]+)\)/.exec(str)[1])
<script language=javascript>var str = 'url("file:///C:/Users/Administrator/Desktop/slimbox/example.jpg")';
var s1 = str.substr(str.lastindexOf("/") );
alert(s1);</script>