Damein Posted April 27, 2011 Share Posted April 27, 2011 So I saw in the help file there is an or argument "|" but I can't seem to figure out how to use it. Here is my dilemma, I need to pull some data from a string, but something changes. Here is what they can be: StringRegExp($sSource,'(?i)(?s)<td class="twc-col-3 twc-line-precip">Chance of Rain:<br><strong>(.*?)</strong></td>',1) OR StringRegExp($sSource,'(?i)(?s)<td class="twc-col-3 twc-line-precip">Chance of Precip:<br><strong>(.*?)</strong></td>',1) Now I can do a @Error on the first one and run the second, but if I can just slim it down to one StringRegExp, I would prefer that. Thanks! 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...
jvanegmond Posted April 27, 2011 Share Posted April 27, 2011 StringRegExp($sSource,'(?i)(?s)<td class="twc-col-3 twc-line-precip">Chance of (Precip|Rain):<br><strong>(.*?)</strong></td>',1) or just to future proof your applicaiton when there is a Chance of Meteor Shower: StringRegExp($sSource,'(?i)(?s)<td class="twc-col-3 twc-line-precip">Chance of (.*?):<br><strong>(.*?)</strong></td>',1) github.com/jvanegmond Link to comment Share on other sites More sharing options...
Damein Posted April 27, 2011 Author Share Posted April 27, 2011 Resolved in IRC thanks to Manadar 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