#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)<(?<tagName>\w+)(([^<]*\/>)|(.*?\/(\k<tagName>)>))"
Local $sString = " <child name = "child_name1" type = "child_type1"> <subchild id = "1" auth="auth1">Value1</subchild> </child> <child name = "child_name2" type = "child_type2"> <subchild id = "2" auth="auth1">Value2</subchild> <subchild id = "3" auth="auth2">Value3</subchild> <subchild id = "4" auth="auth3"></subchild> <subchild id = "5" auth="auth3"/> </child>"
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