Jump to content
Sign in to follow this  
DoctorSLO

need help for StringRegExp

Recommended Posts

DoctorSLO

Hi.

Can someone help me to get this in StringRegExp ?

I want to get this time 0:08:30 from this

src="img/un/a/clock.gif" width=18> 0:08:30</TD>

I do this

$Time = StringRegExp('img/un/a/clock.gif" width=18> 0:08:30</TD>', 'img/un/a/clock.gif" width=18> ([0-9]{1,3}):([0-9]{1,2}):([0-9]{1,2})</TD>', 1)
If @error == 0 Then
$hTime = $Time[0]
$mTime = $Time[1]
$sTime = $Time[2]
EndIf

I know that this is incorrect ... please tell me how to do it correctly ...

Thx

EDIT: hTime are hours, mTime are minutes, sTime are sec.

Edited by DoctorSLO

Share this post


Link to post
Share on other sites
martin

Hi.

Can someone help me to get this in StringRegExp ?

I want to get this time 0:08:30 from this

src="img/un/a/clock.gif" width=18> 0:08:30</TD>

I do this

$Time = StringRegExp('img/un/a/clock.gif" width=18> 0:08:30</TD>', 'img/un/a/clock.gif" width=18> ([0-9]{1,3}):([0-9]{1,2}):([0-9]{1,2})</TD>', 1)
If @error == 0 Then
$hTime = $Time[0]
$mTime = $Time[1]
$sTime = $Time[2]
EndIf

I know that this is incorrect ... please tell me how to do it correctly ...

Thx

EDIT: hTime are hours, mTime are minutes, sTime are sec.

This should work

$Time = StringRegExp('img/un/a/clock.gif" width=18> 0:08:30</TD>', '[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}', 1)
If @error = 0 Then
    For $n = 0 To UBound($Time) - 1
        ConsoleWrite("$TIme[" & $n & "] = " & $Time[$n] & @CRLF)
    Next
EndIf

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.