Damein Posted April 23, 2012 Share Posted April 23, 2012 So someone gave me this to hep me with a script awhile back. Sadly, I just took the code and used it without trying to understand it. Well, that isn't helping me now. I need to do the same thing, but with a different string.Here is the codeStringRegExp($sSource, "(?i)<img\ssrc=.+(http.+\.png).*column 1.*-->", 1)Now its pulling data from this:http://www.weather.com/weather/today/Jeffersonville+IN+47130So what I want to know is, what do all of the arguments mean in this StringRegExp? Because I tried using them myself, but I couldn't get it to work with the other webpage.I am trying to get the times from this websitehttp://www.weather.com/weather/hourbyhour/graph/47130Specifically<div class="hbhWxHour" id="hbhWxHour0"> <div class="hbhWxDate"><div>Mon<br>Apr 23</div></div> <div class="hbhWxTime"><div>4 pm</div></div> <div class="hbhWxImg"><div style="cursor:pointer;" onclick="gotoTableView('/weather/hourbyhour/47130','16')"><img src="http://i.imwx.com/web/common/wxicons/45/24.gif" alt="" width="45" height="45" border="0"></div></div> <div class="hbhWxTemp"><div>61.0° </div></div> <div class="hbhWxPrecip"><div><span>Precip:</span><br>10%</div></div> </div><!-- hbhWxHour -->I am heading out the door now, so I will post more info later if need be. Pretty much I need to be able to grab the "4 pm" from that one, and then be able to do it for all the other times as well. But mine for some reason just grabs the "11 pm", which is:<div class="hbhWxHour" id="hbhWxHour7"> <div class="hbhWxDate hbhWxDateSpacer"><div> <br> </div></div> <div class="hbhWxTime"><div>11 pm</div></div> <div class="hbhWxImg"><div style="cursor:pointer;" onclick="gotoTableView('/weather/hourbyhour/47130','23',',')"><img src="http://i.imwx.com/web/common/wxicons/45/33.gif" alt="" width="45" height="45" border="0"></div></div> <div class="hbhWxTemp"><div>48.0° </div></div> <div class="hbhWxPrecip"><div><span>Precip:</span><br>0%</div></div> </div><!-- hbhWxHour -->For some reason.Anyways, thanks in advance! Most recent sig. I made Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic Link to comment Share on other sites More sharing options...
Damein Posted April 24, 2012 Author Share Posted April 24, 2012 Just as a little FYI. I don't want someone to code this for me exactly. I just want them to break each argument down for me so I can better understand whats going on Most recent sig. I made Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 24, 2012 Moderators Share Posted April 24, 2012 Damein,I do not think you are going to have much luck asking for a personal course in SRE parsing. The best way ahead is to start learning about SREs yourself and then posing specific questions when you come across problems applying one in your code. I always recommend this site as a good point to start learning about SREs - although jchd has a soft spot for this one. Good luck. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Damein Posted April 24, 2012 Author Share Posted April 24, 2012 Alright, I made a round-a-bout way to do this myself, but I had to split the source two ways. $Time1Start = StringRegExp($sSource, '(?s)id="hbhWxHour0">(.+?)<!--', 1) $Time1 = StringRegExp($Time1Start[0], '(?s)<div class="hbhWxTime"><div>(.+?)</div>', 1) But thanks, I'll look into that Most recent sig. I made Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic 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