#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?<=START)(?s)(.*?)(?=Closing)"
Local $sString = "more useless gibberish at the begininng..." & @CRLF & _
"separated by new lines..." & @CRLF & _
"" & @CRLF & _
"START Fund Class Fund Number Fund Currency" & @CRLF & _
"XYZ XYZ XYZ USD" & @CRLF & _
"" & @CRLF & _
" bunch of text with lots of newlines in between... Closing 11.11 1,111.11 111,111.11" & @CRLF & _
"" & @CRLF & _
"more useless gibberish between the groups..." & @CRLF & _
"separated by new lines..." & @CRLF & _
"" & @CRLF & _
"START Fund Class Fund Number Fund Currency" & @CRLF & _
"XYZ XYZ XYZ USD" & @CRLF & _
"" & @CRLF & _
"The word START appears in the middle sometimes multiple times, but it's fine bunch of text with lots of newlines in between... Closing 22.22 2,222.22 222,222.22" & @CRLF & _
"" & @CRLF & _
"more useless gibberish at the end..." & @CRLF & _
"separated by new lines..."
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