#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "<\?xml(.+?)\?>"
Local $sString = "<?xml version="1.0" encoding="utf-8"?>" & @CRLF & _
"<ns1:StudySQL_response xmlns:ns1="urn:global:cs:jdbc:study">" & @CRLF & _
"<Statement_response>" & @CRLF & _
" <row>" & @CRLF & _
" <XMLTYPE.GETSTRINGVAL(MESSAGE)><study studypid="200">" & @CRLF & _
" <studyname>&quot;Immume Treat Phase3&quot;</studyname>" & @CRLF & _
" <statusCD>ongoing</statusCD>" & @CRLF & _
" <clinicalphase>III</clinicalphase>" & @CRLF & _
" <primaryIndication>for lung cancer</primaryIndication>" & @CRLF & _
" <startDate>2010-Jun-28</startDate>" & @CRLF & _
"</study>" & @CRLF & _
"</XMLTYPE.GETSTRINGVAL(MESSAGE)>" & @CRLF & _
" </row>" & @CRLF & _
" <row>" & @CRLF & _
" <XMLTYPE.GETSTRINGVAL(MESSAGE)><study studypid="201">" & @CRLF & _
" <studyname>&quot;ABPM Study&quot;</studyname>" & @CRLF & _
" <statusCD>on hold</statusCD>" & @CRLF & _
" <clinicalphase>III</clinicalphase>" & @CRLF & _
" <primaryIndication>skin cancel</primaryIndication>" & @CRLF & _
" <startDate>2015-Mar-08</startDate>" & @CRLF & _
"</study>" & @CRLF & _
"</XMLTYPE.GETSTRINGVAL(MESSAGE)>" & @CRLF & _
" </row>" & @CRLF & _
"</Statement_response>" & @CRLF & _
"</ns1:StudySQL_response>" & @CRLF & _
""
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