I need to parse url240 and url360 from a string. But i cant do it. On PHP it is very easy:
preg_match('/&url240=(.*?)&/mis', $string, $C);
But I cant do it on javascript. My javascript code:
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);
It looks like you actually want to use
exec
and notmatch
, so you can get your capture groupIf you want to find multiple things using
exec
, you can put it in a loop, for example