Jump to content
Sign in to follow this  
oMBRa

Help with StringRegExp

Recommended Posts

oMBRa

I have this:

<td align="right" valign="top" class="rankingHeader">Random:</td>
<td align="middle" valign="top" class="rankingRow">0</td>
<td align="middle" valign="top" class="rankingRow">5</td>
<td align="middle" valign="top" class="rankingRow">0.00 %</td>

how to get ''0'' and ''5'' with StringRegExp??

Share this post


Link to post
Share on other sites
dbzfanatic

Not sure about RegExp but you could get the source and do a StringBetween() or StringInStr(). You should also try out the tester made by szhlopp.

Share this post


Link to post
Share on other sites
oMBRa

nevermind I resolved right this:

$PosR = StringInStr($Source, 'Random:')
$PosR = StringRegExp($Source, '"rankingRow">(.*?)</(?i)td>', 3, $PosR)
MsgBox(0, '', $PosR[0] & @LF & $PosR[1])

Share this post


Link to post
Share on other sites
zerobazar

Or, depending how is formated your $source (need to have each line terminated by linefeed and/or carriage return), this :

$PosR = StringRegExp($Source, ".*>(\d)<.*", 3)
MsgBox(0, '', $PosR[0] & @LF & $PosR[1])

should be sufficient.

Best Regards.

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  

×