Jump to content

Need some help with StringRegExp


Recommended Posts

Hi.

Can you correct me please:

$html = _IEBodyReadHTML($ie)
    $readtime = StringRegExp($html, "v [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2} h", 1)
    $hours = $readtime[0]
    $minutes = $readtime[1]
    $sec = $readtime[2]

I got error.

I want to get hours, minutes and sec as you see.

The string in html looks like this:

v 0:04:17 h

Edited by DoctorSLO
Link to comment
Share on other sites

$str = 'v 0:04:17 h'

;~ $html = _IEBodyReadHTML($ie)
$readtime = StringRegExp($str, '(\d+):(\d+):(\d+)', 3)
$hours = $readtime[0]
$minutes = $readtime[1]
$sec = $readtime[2]

ConsoleWrite($hours & ':' & $minutes & ':' &$sec & @CRLF)

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...