#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "([\s\S]*)(?=<div id="content")|(?=<div id="footer)([\s\S]*)"
Local $sString = "hello this is some text I don't want" & @CRLF & _
"asdf" & @CRLF & _
"asdfasd" & @CRLF & _
"ff" & @CRLF & _
"<div id="content" class="other">" & @CRLF & _
"i have this other stuff " & @CRLF & _
"<div>More stuff</div>" & @CRLF & _
"<div id="footer> " & @CRLF & _
"hello^[^_]*_" & @CRLF & _
"asd;flkjasd" & @CRLF & _
"f;kas" & @CRLF & _
"dfas" & @CRLF & _
"df" & @CRLF & _
"asdf a2 5<div id="footer"><div id="content></div>"
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