#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?ms)EventCode=(4624|4634|4625)\s+.*\.adm"
Local $sString = "03/08/2024 04:19:49 PM" & @CRLF & _
"LogName=Security" & @CRLF & _
"EventCode=4634" & @CRLF & _
"EventType=0" & @CRLF & _
"ComputerName=XXX" & @CRLF & _
"SourceName=Microsoft Windows security auditing." & @CRLF & _
"Type=Information" & @CRLF & _
"RecordNumber=XXX" & @CRLF & _
"Keywords=Audit Success" & @CRLF & _
"TaskCategory=Logoff" & @CRLF & _
"OpCode=Info" & @CRLF & _
"Message=An account was logged off." & @CRLF & _
"" & @CRLF & _
"Subject:" & @CRLF & _
" Security ID: DOMINIO\user.adm" & @CRLF & _
" Account Name: utente" & @CRLF & _
" Account Domain: AMADORI" & @CRLF & _
" Logon ID: XXX" & @CRLF & _
"" & @CRLF & _
"Logon Type: 3" & @CRLF & _
"" & @CRLF & _
"This event is generated when a logon session is destroyed. It may be positively correlated with a logon event using the Logon ID value. Logon IDs are only unique between reboots on the same computer."
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