#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?P<event_message>A user account was unlocked\.)\s+Subject:\s+Security ID:\s+(?P<subject_security_id>.*?)\s+Account Name:\s+(?P<subject_account_name>.*?)\s+Account Domain:\s+(?P<subject_account_domain>.*?)\s+Logon ID:\s+(?P<subject_logon_id>.*?)\s+Target Account:\s+Security ID:(?P<target_security_id>.*?)\s+Account Name:\s+(?P<target_account_name>.*?)\s+Account Domain:\s+(?P<target_account_domain>.*)"
Local $sString = "A user account was unlocked. Subject: Security ID: S-1-5-21-173871781-544419543-443003237-500 Account Name: Administrator Account Domain: AV Logon ID: 0x1E3AD Target Account: Security ID: S-1-5-21-173871781-544419543-443003237-1111 Account Name: test Account Domain: AV"
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