How to match specific number from text - Ruby regex -


    id="profile_photo_link" href="/photo83085640_283973341" onclick="return showphoto('83085640_283973341', 'album8308564     0_0/rev',   {temp:{base:&quot;http://cs301701.vk.me/v301701640/&quot;,x_:[&quot;181d/n_1czoigh0s&quot;,556,313]},  jumpto:     {z: 'albums83085640'}}, event)">  <img width="200" height="205" src="http://cs301701.vk.me/v301701640/4a03/mfkv3wohrqu.jpg     " alt="Сергей on-line Консультации Василюк"> 

how match this(83085640) number text above ruby regex ? start of regex must after showphoto(' text , ends @ point _ after numbers

please help!

you need following:

my_text = "showphoto('83085640_283973341',";    #input string. i'm using part of here convenience. pat = /showphoto\('(\d*)_/;    #the regexp pattern per requirements.  puts(pat.match(my_text)[1]); 

output:

83085640 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -