#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?P<User>[a-zA-Z1-9\._]+)@(?P<Domain>[a-zA-Z1-9]+)\.(?P<D_EXT>[a-zA-Z]+)"
Local $sString = "my email is andy@delusion.org" & @CRLF & _
"my school email is andrew.newton18@mydiscoveryk8.org" & @CRLF & _
"daddy's email is mike@delusion.org" & @CRLF & _
"Zach H's email is hitchcockzach@gmail.com" & @CRLF & _
"Zach R's email is zrambler441@yahoo.com" & @CRLF & _
"Ryan's email is ryanmeth@icloud.com" & @CRLF & _
"Mateo's email is mateo@relhok.com" & @CRLF & _
"Kieran's email is kieran.derrington@gmail.com " & @CRLF & _
"Tyler's email is tbone.vaughn@icloud.com" & @CRLF & _
"" & @CRLF & _
"DON'T WORK:" & @CRLF & _
"" & @CRLF & _
"...@......." & @CRLF & _
"secreretface-2@loans.com" & @CRLF & _
""
Local $sSubst = "${User} at ${Domain}.${D_EXT}\n"
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