0
我需要從字符串中解析url240和url360。但我不能這樣做。在PHP這是很容易的:javascript str-match無法使用
preg_match('/&url240=(.*?)&/mis', $string, $C);
但我不能這樣做的JavaScript。我的javascript代碼:
var str = "&url240=http://cs506410v4.vk.me/u170785079/videos/d10bdfccf6.240.mp4&url360=http://cs506410v4.vk.me/u170785079/videos/d10bdfccf6.360.mp4&url480=";
var n=str.match(/url240=/gi);
alert(n);
'alert()'說什麼? – Pointy
在Chrome和Firefox中,我使用該代碼獲得了'url240 ='。那是錯的嗎? – 2013-08-17 21:19:56
爲什麼對這個問題downvote? –