#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)<<(.*?\n*)*?>>"
Local $sString = "Organisation Name <<me.company.name>>" & @CRLF & _
"ABN/ACN <<me.company.abn>>" & @CRLF & _
"Contact Name <<me.name>>" & @CRLF & _
"<<me.PhoneNumber" & @CRLF & _
"'Another line" & @CRLF & _
">>" & @CRLF & _
"Email <<me.emailAddress>>" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"Invoice Address " & @CRLF & _
"Notice Address (if not invoice Address) " & @CRLF & _
"<<table(“tableSites ”,me.company.sites,1)" & @CRLF & _
"’table first parameter is the bookmark that contains the table" & @CRLF & _
"‘The collection to apply to the table" & @CRLF & _
"‘and a number of rows that makes up the header (these are ignored)" & @CRLF & _
">>" & @CRLF & _
"Connection Site Address NMI Start Date" & @CRLF & _
"<<codeobject.item.addressObject.Address>> <<codeobject.item.nmi>> <<codeobject.item.CurrentPricing.StartPeriod>>" & @CRLF & _
" " & @CRLF & _
""
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