#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(^(?:[01]\d|2[0-3]|[0-59]):[0-5]\d:[0-5]\d)|(^(?:[0-5]\d|2[123]|[0-59]):[0-5]\d)"
Local $sString = "00:00 Intro" & @CRLF & _
"01:03 Pricing and features -" & @CRLF & _
"03:14 - Practicality " & @CRLF & _
"1:25:00" & @CRLF & _
"05:44 Under the bonnet" & @CRLF & _
"06:51 - Driving" & @CRLF & _
"30:00 Test time length" & @CRLF & _
"11:04" & @CRLF & _
"11:21 Safety" & @CRLF & _
"11:46Test no space" & @CRLF & _
"12:20 Verdict" & @CRLF & _
"08:45: Test extra colon" & @CRLF & _
"12:40 + Test char +" & @CRLF & _
"12:45 . Test char ." & @CRLF & _
"4:22 - Test timestamp" & @CRLF & _
"1:25:00 Test trailing text" & @CRLF & _
"01:30:25 - Another chapter" & @CRLF & _
"1:30:25 - Another chapter" & @CRLF & _
"75:00" & @CRLF & _
"30:00" & @CRLF & _
"120" & @CRLF & _
"2" & @CRLF & _
"25" & @CRLF & _
"2:30 Chapter"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH)
Local $aFullArray[0]
For $i = 0 To UBound($aArray) -1
_ArrayConcatenate($aFullArray, $aArray[$i])
Next
$aArray = $aFullArray
; Present the entire match result
_ArrayDisplay($aArray, "Result")
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm