#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)^(?'Username'[-\w\d\.]+?)(?:\s+at\s+|\s+\[at\]\s+|\s*@\s*|\s*(?:[\[\]@]){3}\s*)(?'Domain'[-\w\d\.]*?)\s*(?:dot|\.|(?:[\[\]dot\.]){3,5})\s*(?'TLD'\w+)$"
Local $sString = "some.email at gmail dot com" & @CRLF & _
"" & @CRLF & _
"asdf-FDSA at ghjkl . net" & @CRLF & _
"" & @CRLF & _
"thomas at yahoo .de" & @CRLF & _
"" & @CRLF & _
"josh@awesomecompanyname dot com" & @CRLF & _
"" & @CRLF & _
"mona.lisa [@] domain [dot] com" & @CRLF & _
"" & @CRLF & _
"stephen.spielberg [@] domain [.] com" & @CRLF & _
"" & @CRLF & _
"lol.dzdz [at] fe dot com" & @CRLF & _
"" & @CRLF & _
"He is not at his best. Lorem Ipsum." & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"Hit "Perform a substitution" to see some magic happen."
Local $sSubst = "\1@\2.\3"
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