#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "^(?i)([ !?¿¡.,;:—–'\x22\n\r-]|\x3C/?[ibuc]\x3E|\x3Cc:#[0-9a-fA-F]{6}\x3E|a+h+|o+h+|meh|e+h+|hm+|(g|a+r)r+|(a+|o+|e+)w+|b?p?g?ah+|phe+w+|o+uch|yack|n*h*u+n*h+|r*(u+|a+)r*n*g*h+|r+aa+|(e|h?i*|hi*-)ya+h*|heh*|a*ha+h*|oo+(f|h)|he+y|hyuh|whe+w|s+(s|h)h+|b?zz+t?|mm+|wh?(oo+|a+|o+a+)h?w?|wo+h?w?|bla+h*|whoo+sh|tsk|oi|mwah+|pff+t*|ps+(h|t)?|um+|ahem|wh?o+-ho+|(wh?)?oo+ps?(ie|y)?|e+u+gh+|y+ee+|bo+m)+$"
Local $sString = "¿Ah?" & @CRLF & _
"" & @CRLF & _
"¡Oh!" & @CRLF & _
"" & @CRLF & _
"Arrgh" & @CRLF & _
"" & @CRLF & _
"Hey" & @CRLF & _
"" & @CRLF & _
"Uh, ah, bah, whooops." & @CRLF & _
"" & @CRLF & _
"Mmmmm" & @CRLF & _
"" & @CRLF & _
"¿Booooom?"
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