gcue Posted August 16, 2011 Share Posted August 16, 2011 hello. i am trying to download Bloomberg update from their site. they often change the date format which the update filename contains. for example last month it was upgr080711.exe and this month its upgr08072011.exe so i often have to switch this to accomodate StringRegExp($sHTML, "http://bdn-ak.bloomberg.com/software/trv/bupd\d\d\d\d\d\d.exe", 2) is there something that will work for both date formats (wether they are 6 digits or 8)? thanks =) Link to comment Share on other sites More sharing options...
kaotkbliss Posted August 16, 2011 Share Posted August 16, 2011 I'm not good with StringregExp yet, but I remember something about getting all character between 2 non capture groups which in your example, looks like upgr and .exe hopefully it helps. 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
PowerCat Posted August 16, 2011 Share Posted August 16, 2011 My lazy way: $mark1 = StringinStr($shtml, "software/trv/bupd") $mark2 = StringinStr($html, ".exe", 0, 1, $mark1) $url = StringMid($sHTML, $mark1, $mark2 - $mark1) Then add what you need. Link to comment Share on other sites More sharing options...
gcue Posted August 16, 2011 Author Share Posted August 16, 2011 (edited) thanks for your help but doesn't it seem a bit messy? wouldnt stringregexp be cleaner and safer? Edited August 16, 2011 by gcue Link to comment Share on other sites More sharing options...
PowerCat Posted August 16, 2011 Share Posted August 16, 2011 thanks for your help but doesn't it seem a bit messy? wouldnt stringregexp be cleaner and safer? Well yes, it's dirty. But it works, right? Link to comment Share on other sites More sharing options...
gcue Posted August 16, 2011 Author Share Posted August 16, 2011 this looks to be working! StringRegExp($sHTML, "http://bdn-ak.bloomberg.com/software/trv/bupd[\d]+.exe", 2) thanks again for the leads/help Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now