#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "^\[MSG\]\n[\d ]+\n{2}\d{15}\n\d{4}mV\n\d{2}\n\d,\d,\d\n?\*{0,2}(\d{10})?\*{0,2}\n{2}\[READINGS\]\n(?m:([\d\s,]*))\[MSGEND\]$"
Local $sString = "[MSG]" & @CRLF & _
"4 031116 080423" & @CRLF & _
"" & @CRLF & _
"543215432154321" & @CRLF & _
"3711mV" & @CRLF & _
"30" & @CRLF & _
"1,0,0" & @CRLF & _
"**1234567890**" & @CRLF & _
"" & @CRLF & _
"[READINGS]" & @CRLF & _
"00451,00450,00402,06017" & @CRLF & _
"00000,021116 083000" & @CRLF & _
"00000" & @CRLF & _
"00000" & @CRLF & _
"00000" & @CRLF & _
"00000,031116 080000" & @CRLF & _
"[MSGEND]"
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