#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?ms)DbFileInput\.DbFileInput.*<Query>(.*?)<\/Query>"
Local $sString = "<?xml version="1.0"?>" & @CRLF & _
"<AlteryxDocument yxmdVer="2023.2" RunE2="T">" & @CRLF & _
" <Nodes>" & @CRLF & _
" <Node ToolID="1">" & @CRLF & _
" <GuiSettings Plugin="AlteryxBasePluginsGui.DbFileInput.DbFileInput">" & @CRLF & _
" <Position x="246" y="222" />" & @CRLF & _
" </GuiSettings>" & @CRLF & _
" <Properties>" & @CRLF & _
" <Configuration>" & @CRLF & _
" <Passwords />" & @CRLF & _
" <File />" & @CRLF & _
" <FormatSpecificOptions UseDcm="true" Format="23" RecordLimit="">" & @CRLF & _
" <Query>select * " & @CRLF & _
"from "XXXX_01"."PUBLIC"."CASES_GB"</Query>" & @CRLF & _
" <TableStyle>Quoted</TableStyle>" & @CRLF & _
" <CacheData>False</CacheData>" & @CRLF & _
" <Table />" & @CRLF & _
" <SessionReadOnly>True</SessionReadOnly>" & @CRLF & _
" <ReadUncommitted>False</ReadUncommitted>" & @CRLF & _
" <Connection DcmType="ConnectionId">829c98d7-4345-4f8a-98fe-ea278c707529</Connection>" & @CRLF & _
" <NoProgress>True</NoProgress>" & @CRLF & _
" <PostSQL />" & @CRLF & _
" <PreSQLOnConfig>True</PreSQLOnConfig>" & @CRLF & _
" <PreSQL />" & @CRLF & _
" </FormatSpecificOptions>" & @CRLF & _
" </Configuration>" & @CRLF & _
" <Annotation DisplayMode="0">" & @CRLF & _
" <Name />" & @CRLF & _
" <DefaultAnnotationText>dcm:Snowflake — fmv_cred" & @CRLF & _
"Query=select * " & @CRLF & _
"from "XXXXX"....</DefaultAnnotationText>" & @CRLF & _
" <Left value="False" />" & @CRLF & _
" </Annotation>" & @CRLF & _
" <MetaInfo connection="Output">" & @CRLF & _
" <RecordInfo>" & @CRLF & _
" <Field name="claimnumber" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="chartno" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="billnumber" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="account" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="date" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="Date" />" & @CRLF & _
" <Field name="caseno" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="caseid" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="patientname" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="dob" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="Date" />" & @CRLF & _
" <Field name="patientphone" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="policyholder" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="policynumber" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="insurancename" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="casetypename" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="doa" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="Date" />" & @CRLF & _
" <Field name="specialty" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="provider" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="billamount" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="Double" />" & @CRLF & _
" <Field name="paid" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="Double" />" & @CRLF & _
" <Field name="balance" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="Double" />" & @CRLF & _
" <Field name="firstvisitdate" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="Date" />" & @CRLF & _
" <Field name="lastvisitdate" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="Date" />" & @CRLF & _
" <Field name="dos" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="days" scale="0" size="21" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="FixedDecimal" />" & @CRLF & _
" <Field name="billdate" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="Date" />" & @CRLF & _
" <Field name="status" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="username" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="doctor" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="readingdoctor" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="doctorlocation" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="pomid" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="noofvisits" scale="0" size="21" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="FixedDecimal" />" & @CRLF & _
" <Field name="pomgenerateddate" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="Date" />" & @CRLF & _
" <Field name="pomstampeddateone" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="billnote" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="referringdoctor" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="pomstampeddate" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="Date" />" & @CRLF & _
" <Field name="billingaddress" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="treatingdoctor_0_doctorname" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" <Field name="treatingdoctor_0_npi" size="2048" source="File: select * 
from "MEDSOL_01"."PUBLIC"."CASES_GB"" type="V_WString" />" & @CRLF & _
" </RecordInfo>" & @CRLF & _
" </MetaInfo>" & @CRLF & _
" </Properties>" & @CRLF & _
" <EngineSettings EngineDll="AlteryxBasePluginsEngine.dll" EngineDllEntryPoint="AlteryxDbFileInput" />" & @CRLF & _
" </Node>" & @CRLF & _
" <Node ToolID="2">" & @CRLF & _
" <GuiSettings Plugin="AlteryxBasePluginsGui.BrowseV2.BrowseV2">" & @CRLF & _
" <Position x="366" y="222" />" & @CRLF & _
" </GuiSettings>" & @CRLF & _
" <Properties>" & @CRLF & _
" <Configuration />" & @CRLF & _
" <Annotation DisplayMode="0">" & @CRLF & _
" <Name />" & @CRLF & _
" <DefaultAnnotationText />" & @CRLF & _
" <Left value="False" />" & @CRLF & _
" </Annotation>" & @CRLF & _
" </Properties>" & @CRLF & _
" <EngineSettings EngineDll="AlteryxBasePluginsEngine.dll" EngineDllEntryPoint="AlteryxBrowseV2" />" & @CRLF & _
" </Node>" & @CRLF & _
" </Nodes>" & @CRLF & _
" <Connections>" & @CRLF & _
" <Connection>" & @CRLF & _
" <Origin ToolID="1" Connection="Output" />" & @CRLF & _
" <Destination ToolID="2" Connection="Input" />" & @CRLF & _
" </Connection>" & @CRLF & _
" </Connections>" & @CRLF & _
" <Properties>" & @CRLF & _
" <Memory default="True" />" & @CRLF & _
" <GlobalRecordLimit value="0" />" & @CRLF & _
" <TempFiles default="True" />" & @CRLF & _
" <Annotation on="True" includeToolName="False" />" & @CRLF & _
" <ConvErrorLimit value="10" />" & @CRLF & _
" <ConvErrorLimit_Stop value="False" />" & @CRLF & _
" <CancelOnError value="False" />" & @CRLF & _
" <DisableBrowse value="False" />" & @CRLF & _
" <EnablePerformanceProfiling value="False" />" & @CRLF & _
" <RunWithE2 value="True" />" & @CRLF & _
" <SortedGrouping value="True" />" & @CRLF & _
" <PredictiveToolsCodePage value="1252" />" & @CRLF & _
" <DisableAllOutput value="False" />" & @CRLF & _
" <ShowAllMacroMessages value="False" />" & @CRLF & _
" <ShowConnectionStatusIsOn value="True" />" & @CRLF & _
" <ShowConnectionStatusOnlyWhenRunning value="False" />" & @CRLF & _
" <ZoomLevel value="0" />" & @CRLF & _
" <LayoutType>Horizontal</LayoutType>" & @CRLF & _
" <MetaInfo>" & @CRLF & _
" <NameIsFileName value="True" />" & @CRLF & _
" <Name>Test</Name>" & @CRLF & _
" <Description />" & @CRLF & _
" <RootToolName />" & @CRLF & _
" <ToolVersion />" & @CRLF & _
" <ToolInDb value="False" />" & @CRLF & _
" <CategoryName />" & @CRLF & _
" <SearchTags />" & @CRLF & _
" <Author />" & @CRLF & _
" <Company />" & @CRLF & _
" <Copyright />" & @CRLF & _
" <DescriptionLink actual="" displayed="" />" & @CRLF & _
" <Example>" & @CRLF & _
" <Description />" & @CRLF & _
" <File />" & @CRLF & _
" </Example>" & @CRLF & _
" <WorkflowId value="6d029b0d-30da-40ad-819f-0d8b2dd496cb" />" & @CRLF & _
" <Telemetry>" & @CRLF & _
" <PreviousWorkflowId value="2fab71ce-8734-4c9a-9f05-e9279b77b7a8" />" & @CRLF & _
" <OriginWorkflowId value="2fab71ce-8734-4c9a-9f05-e9279b77b7a8" />" & @CRLF & _
" </Telemetry>" & @CRLF & _
" <PlatformWorkflowId value="" />" & @CRLF & _
" </MetaInfo>" & @CRLF & _
" <Events>" & @CRLF & _
" <Enabled value="True" />" & @CRLF & _
" </Events>" & @CRLF & _
" </Properties>" & @CRLF & _
"</AlteryxDocument>"
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