#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^START\b.*(?:\R(?!START\b|END_OF_MSG\b).*)*"
Local $sString = "HELLO" & @CRLF & _
"START ABC DEF GHI JKL" & @CRLF & _
"QWER RANDOM TEXT 213%@#!" & @CRLF & _
"UIOP RANDOMZXCVB123456" & @CRLF & _
"START ABC DEF GHI JKL" & @CRLF & _
"ZZZZZ RANDOMTEXT213%@#!" & @CRLF & _
"11111 RANDOMZXCVB123456" & @CRLF & _
"$$$$$$ SOMEMORETEXT" & @CRLF & _
"START ABC DEF GHI JKL" & @CRLF & _
"QWER RANDOMTEXT213%@#!" & @CRLF & _
"$$$$$ RANDOMZXCVB123456" & @CRLF & _
"END_OF_MSG"
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