#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)((?s).*EventCode=4688*.)((?si).*(%%1936|%%1938TokenElevationTypeDefault|TokenElevationTypeLimited))" & @CRLF & _
""
Local $sString = "A new process has been created." & @CRLF & _
"" & @CRLF & _
"Creator Subject:" & @CRLF & _
" Security ID: SYSTEM" & @CRLF & _
" Account Name: RFSH$" & @CRLF & _
" Account Domain: LAB" & @CRLF & _
" Logon ID: 0x3E7" & @CRLF & _
" EventCode=4688" & @CRLF & _
"Target Subject:" & @CRLF & _
" Security ID: LAB\rsmith" & @CRLF & _
" Account Name: rsmith" & @CRLF & _
" Account Domain: LAB" & @CRLF & _
" Logon ID: 0x2C9D82" & @CRLF & _
"" & @CRLF & _
"Process Information:" & @CRLF & _
" New Process ID: 0x2e0e4" & @CRLF & _
" New Process Name: C:\Windows\System32\RuntimeBroker.exe" & @CRLF & _
" Token Elevation Type: %%1936" & @CRLF & _
" Mandatory Label: Mandatory Label\Medium Mandatory Level" & @CRLF & _
" Creator Process ID: 0x268" & @CRLF & _
" Creator Process Name: C:\Windows\System32\svchost.exe" & @CRLF & _
" Process Command Line:" & @CRLF & _
""
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