#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^Line\s(?:(\d+)\s)?\s*:\s+(\d+)?.*?Invoice does not foot Reported.*$|^(?!Line\s(?:(\d+)\s)?\s*:\s+(\d+)?.*).+"
Local $sString = "Line : 1 Invoice does not foot Reported" & @CRLF & _
"Line : 2 Could not parse INVOICE_DATE value" & @CRLF & _
"Line 3 : Could not parse ADJUSTMENT_AMOUNT value" & @CRLF & _
"Line 4 : MATH ERROR" & @CRLF & _
"cl_id is a required field" & @CRLF & _
"File Error : The file does not contain delimiters" & @CRLF & _
"lf_name is a required field"
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