#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^.+Severity: 20.*\R^.*\R(?![\s\S]*Severity: 20)"
Local $sString = "2020-01-27 11:12:00.72 Backup Log was backed up. Database: ReportServerTempDB, creation date(time): 2019/05/22(12:31:06), first LSN: 79:1911:1, last LSN: 79:1933:1, number of dump devices: 1, device information: (FILE=1, TYPE=DISK: {'E:\SQLLogDumps\ReportServerTempDB_tlog_20200127111200.trn'}). This is an informational message only. No user action is required." & @CRLF & _
"2020-01-27 11:21:47.95 Logon Error: 17806, Severity: 20, State: 14." & @CRLF & _
"2020-01-27 11:21:47.95 Logon Occurrence number one" & @CRLF & _
"2020-01-27 11:21:47.95 Logon Error: 18452, Severity: 14, State: 1." & @CRLF & _
"2020-01-27 11:21:47.95 Logon Login failed. The login is from an untrusted domain and cannot be used with Integrated authentication. [CLIENT: 192.168.4.208]" & @CRLF & _
"2020-01-27 11:21:47.95 Logon Error: 17806, Severity: 20, State: 14." & @CRLF & _
"2020-01-27 11:21:47.95 Logon Occurrence number two" & @CRLF & _
"2020-01-27 11:21:47.95 Logon Error: 18452, Severity: 14, State: 1." & @CRLF & _
"2020-01-27 11:21:47.95 Logon Login failed. The login is from an untrusted domain and cannot be used with Integrated authentication. [CLIENT: 192.168.4.208]"
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