#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "<script.*?/script>(*SKIP)(*FAIL)|text|simple"
Local $sString = "This has no replacements" & @CRLF & _
"" & @CRLF & _
"This simple text has no script tag" & @CRLF & _
"" & @CRLF & _
"This simple text ends with a script tag <script language="javascript">simple simple text text</script>" & @CRLF & _
"" & @CRLF & _
"This is simple html text is split by a script tag <script language="javascript">simple simple text text</script> text" & @CRLF & _
"" & @CRLF & _
"<script language="javascript">simple simple text text</script> this text starts with a script tag"
Local $sSubst = "***replacement***"
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