#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "((?<=<|<\/)|(?<= ))[A-Za-z0-9]+:| xmlns(:[A-Za-z0-9]+)?=".*?""
Local $sString = "<?xml version="1.0" encoding="utf-16"?>" & @CRLF & _
"<ArrayOfInserts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">" & @CRLF & _
" <insert>" & @CRLF & _
" <offer xmlns="http://schema.peters.com/doc_353/1/Types">0174587</offer>" & @CRLF & _
" <type2 xmlns="http://schema.peters.com/doc_353/1/Types">014717</type2>" & @CRLF & _
" <supplier xmlns="http://schema.peters.com/doc_353/1/Types">019172</supplier>" & @CRLF & _
" <id_frame xmlns="http://schema.peters.com/doc_353/1/Types" />" & @CRLF & _
" <type3 xmlns="http://schema.peters.com/doc_353/1/Types">" & @CRLF & _
" <type2 />" & @CRLF & _
" <main>false</main>" & @CRLF & _
" </type3>" & @CRLF & _
" <status xmlns="http://schema.peters.com/doc_353/1/Types">Some state</status>" & @CRLF & _
" </insert>" & @CRLF & _
"</ArrayOfInserts>"
Local $sSubst = ""
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