#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mi)\bfield\b\(.*\)\s*\n*\{[^\}]*\s+FieldClass = FlowField;[^\}]*\}" & @CRLF & _
""
Local $sString = "table 9070 "Accounting Services Cue"" & @CRLF & _
"{" & @CRLF & _
" Caption = 'Accounting Services Cue';" & @CRLF & _
"" & @CRLF & _
" fields" & @CRLF & _
" {" & @CRLF & _
" field(1; "Primary Key"; Code[10])" & @CRLF & _
" {" & @CRLF & _
" Caption = 'Primary Key';" & @CRLF & _
" }" & @CRLF & _
" field(2; "Requests to Approve"; Integer)" & @CRLF & _
" {" & @CRLF & _
" CalcFormula = Count ("Approval Entry" WHERE (Status = CONST (Open)," & @CRLF & _
" "Approver ID" = CONST ('USERID')));" & @CRLF & _
" Caption = 'Requests to Approve';" & @CRLF & _
" Editable = false;" & @CRLF & _
" FieldClass = FlowField;" & @CRLF & _
" }" & @CRLF & _
" field(4; "Ongoing Sales Invoices"; Integer)" & @CRLF & _
" {" & @CRLF & _
" CalcFormula = Count ("Sales Header" WHERE ("Document Type" = FILTER (Invoice)));" & @CRLF & _
" Caption = 'Ongoing Sales Invoices';" & @CRLF & _
" FieldClass = FlowField;" & @CRLF & _
" }" & @CRLF & _
" field(5; "My Incoming Documents"; Integer)" & @CRLF & _
" {" & @CRLF & _
" CalcFormula = Count ("Incoming Document");" & @CRLF & _
" Caption = 'My Incoming Documents';" & @CRLF & _
" FieldClass = FlowField;" & @CRLF & _
" }" & @CRLF & _
" field(20; "User ID Filter"; Code[50])" & @CRLF & _
" {" & @CRLF & _
" Caption = 'User ID Filter';" & @CRLF & _
" FieldClass = FlowFilter;" & @CRLF & _
" }" & @CRLF & _
" }" & @CRLF & _
"" & @CRLF & _
" keys" & @CRLF & _
" {" & @CRLF & _
" key(Key1; "Primary Key")" & @CRLF & _
" {" & @CRLF & _
" Clustered = true;" & @CRLF & _
" }" & @CRLF & _
" }" & @CRLF & _
"" & @CRLF & _
" fieldgroups" & @CRLF & _
" {" & @CRLF & _
" }" & @CRLF & _
"}" & @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