#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)^(?:#|//)_+NOT_FOR_CUSTOMER_BEGIN_+(?:\n.*)*?\n(?:#|//)_+NOT_FOR_CUSTOMER_END_+\n*"
Local $sString = "i want this" & @CRLF & _
"#____NOT_FOR_CUSTOMER_BEGIN________" & @CRLF & _
"not this" & @CRLF & _
"nor this" & @CRLF & _
"#________NOT_FOR_CUSTOMER_END____" & @CRLF & _
"and this" & @CRLF & _
"//____NOT_FOR_CUSTOMER_BEGIN__" & @CRLF & _
"not this again" & @CRLF & _
"nor this again" & @CRLF & _
"//__________NOT_FOR_CUSTOMER_END____" & @CRLF & _
"and this again"
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