Using javascript -- I need to pull out and examine the number that appears just before the "jpg" file extension, in this case "300".
var filename = 2012_honda_odyssey_passenger-minivan_ex_s_oem_2_300.jpg
What's the best way to pull this number out -- I can alway assume it will be between the last "_" in the string and this final "." before the file extension.
I'm guessing that I need to do something with regex. Like this ....
var num = parseInt(filename.match(/some-regex-here/), 10);
addition
I did come up with this ... but it seemed very kludgy.
var filename = "2012_honda_odyssey_passenger-minivan_ex_s_oem_2_300.jpg";
var num = parseInt(filename.split('_').splice(-1,1).toString().split(".").splice(0,1).toString(), 10);