#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)[A-Za-z.-]+@[A-Za-z.-]+"
Local $sString = "Hello," & @CRLF & _
"I may openly talk about this@that.com" & @CRLF & _
"and also mr.nobody@some-thing.org" & @CRLF & _
"" & @CRLF & _
"but thanks to the website administrator email addresses will be redacted to a uniform length. That way you realize that this was an email address but we leave no clue whatsoever about username, domain name or ending."
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