Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
188
rated 0 times [  189] [ 1]  / answers: 1 / hits: 23795  / 13 Years ago, sat, january 28, 2012, 12:00:00

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:



var newstring = string.match(/set=[^ ]+/)[0]; 


returns:



a.265956512115091.68575.100001022542275&type=1

More From » string

 Answers
180
try this : 

var g=string.match(/set=[a-z].([^.]+)/);

g[1] will have the value


http://jsbin.com/anuhog/edit#source


[#87763] Thursday, January 26, 2012, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sidneyh

Total Points: 118
Total Questions: 108
Total Answers: 105

Location: Mali
Member since Fri, Jun 18, 2021
3 Years ago
sidneyh questions
Tue, Jun 7, 22, 00:00, 2 Years ago
Wed, Apr 13, 22, 00:00, 2 Years ago
Wed, Aug 12, 20, 00:00, 4 Years ago
Wed, Jun 3, 20, 00:00, 4 Years ago
Fri, Apr 24, 20, 00:00, 4 Years ago
;