#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(\S)<\/[^>]*>\s*<[^>]*>(\S)"
Local $sString = "<Inventory>" & @CRLF & _
" <Item>" & @CRLF & _
" <Name>Super Mario Bros</Name>" & @CRLF & _
" <Count>14</Count>" & @CRLF & _
" <Price>29,99</Price>" & @CRLF & _
" <Comment>-No Comment-</Comment>" & @CRLF & _
" <Artist>N/A</Artist>" & @CRLF & _
" <Publisher>Nintendo</Publisher>" & @CRLF & _
" <Genre>Video Games</Genre>" & @CRLF & _
" <Year>1985</Year>" & @CRLF & _
" <ProductID>001</ProductID>" & @CRLF & _
" </Item>" & @CRLF & _
" <Item>" & @CRLF & _
" <Name>The Legend of Zelda</Name>" & @CRLF & _
" <Count>12</Count>" & @CRLF & _
" <Price>34,99</Price>" & @CRLF & _
" <Comment>-No Comment-</Comment>" & @CRLF & _
" <Artist>N/A</Artist>" & @CRLF & _
" <Publisher>Nintendo</Publisher>" & @CRLF & _
" <Genre>Video Games</Genre>" & @CRLF & _
" <Year>1986</Year>" & @CRLF & _
" <ProductID>002</ProductID>" & @CRLF & _
" </Item>" & @CRLF & _
"</Inventory>"
Local $sSubst = "$1","$2"
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