#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?<!\w)\b(?:(?<hour_digit>\d+)(?:\s*(?:more|another))?\s*hours?)?(?:(?:\s*(?:or|up to|and|to))*\s*(?<minute_digit>\d+)(?:\s*(?:more|another))?\s*minutes?)?(?:(?:\s*(?:or|up to|and|to))*\h*(?<second_digit>\d+)(?:\s*(?:more|another))?\s*seconds?)?\b(?!\w)"
Local $sString = "1 second" & @CRLF & _
"21 seconds" & @CRLF & _
"1 minutes" & @CRLF & _
"21 minutes" & @CRLF & _
"1 hour" & @CRLF & _
"11 hours" & @CRLF & _
"2 more seconds" & @CRLF & _
"1 more second" & @CRLF & _
"12 more minutes" & @CRLF & _
"21 more hours" & @CRLF & _
"11 hours" & @CRLF & _
"5 hours 5 minutes to 6 hours 6 minutes" & @CRLF & _
"7 hours 7 minutes" & @CRLF & _
"9 hours or up to 10 hours" & @CRLF & _
"5 hours and 15 minutes" & @CRLF & _
"For the first step, wash the clothes for 15 minutes. While the clothes are washing, hold your breath for up to 5 minutes."
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