#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(FAIL|OK)$"
Local $sString = "2019-08-02 07:33:32 ---> OK" & @CRLF & _
"2019-08-02 08:32:42 ---> FAIL" & @CRLF & _
"2019-08-02 09:29:31 ---> OK" & @CRLF & _
"2019-08-02 10:29:23 ---> FAIL" & @CRLF & _
"2019-08-02 11:31:45 ---> OK" & @CRLF & _
"2019-08-02 12:30:55 ---> OK" & @CRLF & _
"2019-08-02 13:29:14 ---> FAIL" & @CRLF & _
"2019-08-02 14:29:19 ---> OK" & @CRLF & _
"2019-08-02 15:31:28 ---> OK" & @CRLF & _
"2019-08-02 16:28:39 ---> OK" & @CRLF & _
"2019-08-02 17:27:46 ---> OK" & @CRLF & _
"2019-08-03 05:28:31 ---> FAIL" & @CRLF & _
"2019-08-05 10:27:37 ---> OK" & @CRLF & _
"2019-08-05 11:26:39 ---> OK" & @CRLF & _
"2019-08-03 05:28:31 ---> FAIL"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYFULLMATCH)
; 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