#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?mi)^([^\s\@])+\@(([^\s\@\.])+\.)+([^\s\.]{2,})+$"
Local $sString = "test@rws.lt" & @CRLF & _
"res+ds@gmail.com" & @CRLF & _
"res-dsaf@f.com" & @CRLF & _
"4334-@fdf.fdsfdsfdsfs.dfsd" & @CRLF & _
"e@ds.lt" & @CRLF & _
"w.w@f.lt" & @CRLF & _
"w--w--we@d.lr" & @CRLF & _
"we@rer-rer.lt" & @CRLF & _
"wee@we.co.uk" & @CRLF & _
"mindaugas.dsd@dsfs.com" & @CRLF & _
"c@c.com" & @CRLF & _
"xn--iema-kbbc.lt@xn--iema-kbbc.lt" & @CRLF & _
""Joe.\\Blow"@example.com" & @CRLF & _
"bc.123@example.com" & @CRLF & _
"reŠna@g.com" & @CRLF & _
"квіточка@пошта.укр" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
""Fred\ Bloggs"@example.com" & @CRLF & _
"dsad@dfs.c" & @CRLF & _
"ewr@rsrew@dsad.com" & @CRLF & _
"@gf.com" & @CRLF & _
"ree+er@.com" & @CRLF & _
"res@.lt" & @CRLF & _
"@.lt" & @CRLF & _
"res.lt" & @CRLF & _
"sad@" & @CRLF & _
"s@fdf..com" & @CRLF & _
"es@fdf..com" & @CRLF & _
"w@fdsf." & @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