#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?s)<tag-1>.*?</tag-1>"
Local $sString = "<p>You will find below reports for customer <b>[CustomerName]</b> dated <b>[ReportdDate]</b></p>" & @CRLF & _
"<tag-1>" & @CRLF & _
"<h3>Title1</h3>" & @CRLF & _
"<table>" & @CRLF & _
" <thead id="t01">" & @CRLF & _
" <tr>" & @CRLF & _
" <th align='center' width='80'>Order Nr</th>" & @CRLF & _
" <th align='left' width='400'>Planning date</th> " & @CRLF & _
" <th align='left' width='200'>Info</th> " & @CRLF & _
" <th align='center' width='200'>Site Name</th> " & @CRLF & _
" </tr>" & @CRLF & _
" </thead>" & @CRLF & _
" <tbody>" & @CRLF & _
" [TableTodo]" & @CRLF & _
" </tbody>" & @CRLF & _
"</table>" & @CRLF & _
"</tag-1>" & @CRLF & _
"<tag-2>" & @CRLF & _
"<h3>Title2</h3>" & @CRLF & _
"<table>" & @CRLF & _
" <thead id="t01">" & @CRLF & _
" <tr>" & @CRLF & _
" <th align='center' width='80'>Order Nr</th>" & @CRLF & _
" <th align='left' width='100'>Date</th> " & @CRLF & _
" <th align='left' width='400'>Info</th> " & @CRLF & _
" <th align='center' width='200'>Site Name</th> " & @CRLF & _
" </tr>" & @CRLF & _
" </thead>" & @CRLF & _
" <tbody>" & @CRLF & _
" [TableTodo]" & @CRLF & _
" </tbody>" & @CRLF & _
"</table>" & @CRLF & _
"</tag-2>"
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