#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)Script module: (?<scriptModule>.*)\W\W\W\s(?<lastLine>[\W\w]+)$"
Local $sString = "12/10/2019 07:40:23 AM" & @CRLF & _
" LogName=ARAdminService" & @CRLF & _
" SourceName=ARAdminSvc" & @CRLF & _
" EventCode=1521" & @CRLF & _
" EventType=4" & @CRLF & _
" Type=Information" & @CRLF & _
" ComputerName=wmidcars73.idexcorpnet.com" & @CRLF & _
" User=NOT_TRANSLATED" & @CRLF & _
" Sid=S-1-5-21-2094280246-649338158-1033845588-46148" & @CRLF & _
" SidType=0" & @CRLF & _
" TaskCategory=ScheduledTask" & @CRLF & _
" OpCode=Info" & @CRLF & _
" RecordNumber=11331718" & @CRLF & _
" Keywords=Classic" & @CRLF & _
" Message=Scheduled task has reported an event. " & @CRLF & _
" " & @CRLF & _
" Task ID: 089546a0-3a4b-4b66-9e4e-43bc9a1f48a6 " & @CRLF & _
" " & @CRLF & _
" Object name: Exo-Process-Changes " & @CRLF & _
" " & @CRLF & _
" Start date: 12/10/2019 " & @CRLF & _
" " & @CRLF & _
" Start time: 7:40:00 AM " & @CRLF & _
" " & @CRLF & _
" Script module: Exo-Process-Changes " & @CRLF & _
" " & @CRLF & _
" Task execution was completed"
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