#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = ".*?UserID="(?<UserID>.*?)".*?UserName="(?<UserName>.*?)".*?NetworkAccessPointID="(?<IPAddress>.*?)".*?EventDateTime="(?<DateTime>.*?)".*?EventOutcomeIndicator="(?<OutcomeIndicator>.*?)".*?csd-code="(?<csd_code>.*?)".*?AuditEnterpriseSiteID="(?<Site>.*?)".*?ParticipantObjectID="(?<PatientID>.*?)".*?ParticipantObjectTypeCode="(?<ObjectTypeCode>.*?)".*?"
Local $sString = "<AuditMessage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">" & @CRLF & _
" <ActiveParticipant UserID="10361" UserIsRequestor="true" UserName="Alexander Hardin" NetworkAccessPointID="184.190.165.174" NetworkAccessPointTypeCode="2" />" & @CRLF & _
" <EventIdentification EventDateTime="2022-08-15T04:26:37+0000" EventOutcomeIndicator="0" EventActionCode="R">" & @CRLF & _
" <EventID codeSystemName="DCM" csd-code="110110" originalText="Patient Record" />" & @CRLF & _
" </EventIdentification>" & @CRLF & _
" <AuditSourceIdentification AuditSourceID="Carepointe" AuditEnterpriseSiteID="AZ" />" & @CRLF & _
" <ParticipantObjectIdentification ParticipantObjectID="" ParticipantObjectTypeCodeRole="1" ParticipantObjectTypeCode="1" ParticipantObjectDataLifeCycle="6">" & @CRLF & _
" <ParticipantObjectIDTypeCode>2</ParticipantObjectIDTypeCode>" & @CRLF & _
" <ParticipantObjectQuery>U0VMRUNUIFVzZXJfSUQsIEZpcnN0TmFtZSwgTGFzdE5hbWUsIENvbXBhbnksIFJvbGVfSUQgRlJPTSB0YmxfdXNlcnMgV0hFUkUgVXNlcl9JRCA9IDp1aWQ=</ParticipantObjectQuery>" & @CRLF & _
" <ParticipantObjectDetail type="User_ID" value="MTAzNjE=" />" & @CRLF & _
" </ParticipantObjectIdentification>" & @CRLF & _
" <DICOMObjectDescriptionContents>" & @CRLF & _
" <Anonymized>0</Anonymized>" & @CRLF & _
" <Encrypted>0</Encrypted>" & @CRLF & _
" </DICOMObjectDescriptionContents>" & @CRLF & _
"</AuditMessage>"
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