Sign in to follow this  
Followers 0
Damein

StringRegExp OR argument?

3 posts in this topic

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!


MCR.jpg?t=1286371579

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

Share this post


Link to post
Share on other sites



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)

Share this post


Link to post
Share on other sites

Resolved in IRC thanks to Manadar :unsure:


MCR.jpg?t=1286371579

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0