#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?im)^(?=.{1,64}@)(?:("[^"\\]*(?:\\.[^"\\]*)*"@)|((?:(?:\([^)]*\)|[^\W_])(?:\.(?!\.)|[-!#\$%&'\*\+\/=\?\^`\{\}\|~\w]|\([^)]*\))*)?[^\W_](?:\([^)]*\))?@))(?=.{1,255}$)(?:(\[[^\[\]]+\])|((?:(?=.{1,63}\.)[^\W_][-\w]*[^\W_]*\.)+[^\W_](?:[^\W_]|-){0,22}[^\W_])|((?=.{1,63}$)[^\W_][-\w]*))$"
Local $sString = "info@kamikaze.uk" & @CRLF & _
"alfred@live.nl" & @CRLF & _
"dubai@organon.it" & @CRLF & _
"karel.de.koning@hetnet.nl" & @CRLF & _
"decock@upc.nl" & @CRLF & _
"jiazhe_xu@sina.cn" & @CRLF & _
"xfunkblasterx@yahoomail.org" & @CRLF & _
"super-duper-email@hotmail.com" & @CRLF & _
"" & @CRLF & _
""John..Doe"@example.com" & @CRLF & _
"john.smith(comment)@example.com" & @CRLF & _
"(comment)john.smith@example.com" & @CRLF & _
"john.smith@worldwideweb.123com_org" & @CRLF & _
""John."(),:;<>@[\].Doe"@.123radio_tv" & @CRLF & _
""much.more unusual"@example.com" & @CRLF & _
"other.email-with-dash@example.com" & @CRLF & _
"disposable.style.email.with+symbol@example.com" & @CRLF & _
""()<>[]:,;@\\"!#$%&'-/=?^_`{}| ~.a"@example.org" & @CRLF & _
"" & @CRLF & _
"smith@[IPv6:2001:db8::1]" & @CRLF & _
"jsmith@[192.168.2.1]"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH)
Local $aFullArray[0]
For $i = 0 To UBound($aArray) -1
_ArrayConcatenate($aFullArray, $aArray[$i])
Next
$aArray = $aFullArray
; Present the entire match result
_ArrayDisplay($aArray, "Result")
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