#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?s)cat\s+.*\.xml(.*)\[Expert@Arcus-mgmt1\]#\s?"
Local $sString = "cat namedQueries1.xml" & @CRLF & _
"<?xml version="1.0" encoding="ISO-8859-1" ?>" & @CRLF & _
"" & @CRLF & _
"<NamedQueriesConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="NamedCloudQueries.xsd">" & @CRLF & _
"" & @CRLF & _
" <NamedQuery>" & @CRLF & _
" <Name>SC2</Name>" & @CRLF & _
" <RequestedInformation>AssignedIP</RequestedInformation>" & @CRLF & _
" <Constraint>" & @CRLF & _
" <FieldName>VdcName</FieldName>" & @CRLF & _
" <Operator>Equals</Operator>" & @CRLF & _
" <Value>SC2</Value> " & @CRLF & _
" </Constraint> " & @CRLF & _
" </NamedQuery>" & @CRLF & _
" " & @CRLF & _
" <NamedQuery>" & @CRLF & _
" <Name>SC1</Name>" & @CRLF & _
" <RequestedInformation>AssignedIP</RequestedInformation>" & @CRLF & _
" <Constraint>" & @CRLF & _
" <FieldName>VdcName</FieldName>" & @CRLF & _
" <Operator>Equals</Operator>" & @CRLF & _
" <Value>SC1</Value> " & @CRLF & _
" </Constraint> " & @CRLF & _
" </NamedQuery>" & @CRLF & _
" " & @CRLF & _
"</NamedQueriesConfiguration>[Expert@Arcus-mgmt1]#"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYFULLMATCH)
; 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