#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)<(script|style)[^>]*>[\s\S]*?<\/\1>|<\/?[^>]+>"
Local $sString = "<div class="my_class">" & @CRLF & _
" <div class="copy">" & @CRLF & _
" © 2018 Texto" & @CRLF & _
" </div>" & @CRLF & _
" </div>" & @CRLF & _
"" & @CRLF & _
"<div class="my_class">" & @CRLF & _
" <h1>¿como estas?</h1>" & @CRLF & _
" <div class="copy">" & @CRLF & _
" © 2018 Texto" & @CRLF & _
" </div>" & @CRLF & _
"<script>" & @CRLF & _
"function hola(){" & @CRLF & _
"" & @CRLF & _
"}" & @CRLF & _
"</script>" & @CRLF & _
"<style>" & @CRLF & _
".red{" & @CRLF & _
" background-color: red;" & @CRLF & _
"}" & @CRLF & _
"</style>" & @CRLF & _
"" & @CRLF & _
""
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