0
我想作一個URL重寫JavaScript中,我的問題是,如果我是這樣的:JavaScript網址重寫
var str='/test/service-34.htm',
exp='/test/service-[0-9]*.htm';
console.log(str.match(exp));
我會得到「/test/service-34.htm」作爲迴應,所以,如果我不能讓一個像更換:
/test/service-34.htm -> test.php?service=$1
失蹤*:P工作完美,ty。 系統不允許我標記這個anwser解決,4min能夠。 – chileodd