How can I parse this string on a javascript,
var string = "http://www.facebook.com/photo.php?fbid=322916384419110&set=a.265956512115091.68575.100001022542275&type=1";
I just want to get the “265956512115091” on the string. I somehow parse this string but, still not enough to get what I wanted.
my code:
JavaScript
x
2
1
var newstring = string.match(/set=[^ ]+/)[0];
2
returns:
JavaScript
1
2
1
a.265956512115091.68575.100001022542275&type=1
2
Advertisement
Answer
JavaScript
1
6
1
try this :
2
3
var g=string.match(/set=[a-z].([^.]+)/);
4
5
g[1] will have the value
6