#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "((<([a-zA-Z0-9]*:)*matchNode[^>]*)\/\s*>)|(((<([a-zA-Z0-9]*:)*matchNode[\s\S]*?)>(([\s\S]*?)))<\/([a-zA-Z0-9]*:)*matchNode>)"
Local $sString = "<?xml version="1.0" encoding="UTF-8"?>" & @CRLF & _
"<root xmlns:xx12="www.example.com">" & @CRLF & _
" <xx12:matchNode so="what">also matched</xx12:matchNode>" & @CRLF & _
" <matchNode/>" & @CRLF & _
" <matchNode>matched</matchNode>" & @CRLF & _
" <xx12:matchNode/>" & @CRLF & _
" <unmatchNode>" & @CRLF & _
" </unmatchNode>" & @CRLF & _
" <xx12:matchNode>also matched</xx12:matchNode>" & @CRLF & _
" <matchNode attr="12" test="false">" & @CRLF & _
" matched" & @CRLF & _
" </matchNode>" & @CRLF & _
"</root>"
Local $sSubst = "$2$6>(obfuscated...)</$3$7matchNode>"
Local $sResult = StringRegExpReplace($sString, $sRegex, $sSubst)
MsgBox($MB_SYSTEMMODAL, "Result", $sResult)
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