It looks like you actually want to use exec
and not match
, so you can get your capture group
var e = /&url240=(.*?)&/i.exec(str);
e[1]; // "http://cs506410v4.vk.me/u170785079/videos/d10bdfccf6.240.mp4"
If you want to find multiple things using exec
, you can put it in a loop, for example
var re = /(.)/g,
str = '123',
e;
while (e = re.exec(str)) console.log(e);
/* ["1", "1", index: 0, input: "123"]
["2", "2", index: 1, input: "123"]
["3", "3", index: 2, input: "123"] */