#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)(?:<!--.*?-->|<style[\S\s\n]*?<\/style>|<script[\S\s\n]*?<\/script>|rgb\(\d+,\x20\d+,\x20\d+\))(*SKIP)(*F)|\((.+?)\)\s*again"
Local $sString = "<!-- (Male) -->" & @CRLF & _
"<p>(Malē) again</p>" & @CRLF & _
"<p style="font-family: "verdana"; font-size: 18px; color: rgb(0, 0, 0);">Malē again</p>" & @CRLF & _
"<style>" & @CRLF & _
"code {" & @CRLF & _
" font-family: "verdana";" & @CRLF & _
" font-size: 18px;" & @CRLF & _
" color: black;" & @CRLF & _
" font-weight: bold !important;" & @CRLF & _
" line-height: 1.6 !important;" & @CRLF & _
" }" & @CRLF & _
"@media (min-width: 1281px) {" & @CRLF & _
"code {" & @CRLF & _
" font: 24px "verdana" bold !important;" & @CRLF & _
" }" & @CRLF & _
"}" & @CRLF & _
"</style>" & @CRLF & _
"<script type="text/javascript">" & @CRLF & _
"function googleTranslateElementInit() {" & @CRLF & _
" new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');" & @CRLF & _
"}" & @CRLF & _
"</script>"
Local $sSubst = "$1 - again"
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