#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?mi)((?:password=|user=)[^\n]*$|\<property key=\"variableNames\"\/\>\n|\<property key=\"variableValues\"\/\>\n)"
Local $sString = "<maplayer simplifyAlgorithm="0" minimumScale="0" maximumScale="2500" simplifyDrawingHints="0" readOnly="0" minLabelScale="0" maxLabelScale="1e+08" simplifyDrawingTol="1" geometry="Point" simplifyMaxScale="1" type="vector" hasScaleBasedVisibilityFlag="1" simplifyLocal="1" scaleBasedLabelVisibilityFlag="0">" & @CRLF & _
" <id></id>" & @CRLF & _
" <datasource>port=1521 user=test_user password=test_passwd</datasource>" & @CRLF & _
" <keywordList>" & @CRLF & _
" <value></value>" & @CRLF & _
" </keywordList>" & @CRLF & _
" <featformsuppress>0</featformsuppress>" & @CRLF & _
" <editorlayout>generatedlayout</editorlayout>" & @CRLF & _
" <widgets/>" & @CRLF & _
" <conditionalstyles>" & @CRLF & _
" <rowstyles/>" & @CRLF & _
" <fieldstyles/>" & @CRLF & _
" </conditionalstyles>" & @CRLF & _
" </maplayer>" & @CRLF & _
" </projectlayers>" & @CRLF & _
" <properties>" & @CRLF & _
" <Variables>" & @CRLF & _
" <variableNames type="QStringList">" & @CRLF & _
" <value>paswd</value>" & @CRLF & _
" <value>user</value>" & @CRLF & _
" </variableNames>" & @CRLF & _
" <variableValues type="QStringList">" & @CRLF & _
" <value>5zdgf</value>" & @CRLF & _
" <value>dgdgdgfdg</value>" & @CRLF & _
" </variableValues>" & @CRLF & _
" </Variables>" & @CRLF & _
" <customproperties>" & @CRLF & _
" <property key="labeling/textColorR" value="0"/>" & @CRLF & _
" <property key="labeling/textTransp" value="0"/>" & @CRLF & _
" <property key="labeling/upsidedownLabels" value="0"/>" & @CRLF & _
" <property key="labeling/useSubstitutions" value="false"/>" & @CRLF & _
" <property key="labeling/wrapChar" value=""/>" & @CRLF & _
" <property key="labeling/xOffset" value="0"/>" & @CRLF & _
" <property key="labeling/yOffset" value="0"/>" & @CRLF & _
" <property key="labeling/zIndex" value="0"/>" & @CRLF & _
" <property key="variableNames"/>" & @CRLF & _
" <property key="variableValues"/>" & @CRLF & _
" </customproperties>"
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