#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63}$"
Local $sString = "Format: minimum 2 characters @ minimum 3 characters . 2 - 63 characters" & @CRLF & _
"" & @CRLF & _
"the g modifier let's us match multiple times in one string. the m modifier is useful here because it lets us treat each line as a seperate entry. Though in practice you probably dont need it for a simple one line email field" & @CRLF & _
"" & @CRLF & _
"Jim@stuff.co.uk" & @CRLF & _
"" & @CRLF & _
"Jim@google.com" & @CRLF & _
"" & @CRLF & _
"Henry@h.com" & @CRLF & _
"" & @CRLF & _
"Joe @m.net" & @CRLF & _
"" & @CRLF & _
"Joe@m.net" & @CRLF & _
"" & @CRLF & _
"Joe@mo.net" & @CRLF & _
"" & @CRLF & _
"Joe@sam.net" & @CRLF & _
"" & @CRLF & _
"a@sam.net" & @CRLF & _
"" & @CRLF & _
"mo@sam.org" & @CRLF & _
"" & @CRLF & _
"12@sam.org" & @CRLF & _
"" & @CRLF & _
"Jon@sam.c" & @CRLF & _
"" & @CRLF & _
"Jon@sam.co" & @CRLF & _
"" & @CRLF & _
""
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