#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(((([a-zA-Z0-9]{2,255})+[/.]|([a-zA-Z0-9]{2,255})+[/_]|([a-zA-Z0-9]{2,255})+[/-])+[a-zA-Z0-9]{2,255})|[a-zA-Z0-9]{2,255})+@(((([a-zA-Z0-9]{2,255})+[/.]|([a-zA-Z0-9]{2,255})+[/_]|([a-zA-Z0-9]{2,255})+[/-])+[a-zA-Z0-9]{2,255})|[a-zA-Z0-9]{2,255})+\.[a-z]{2,64}"
Local $sString = "valid.email@example.com" & @CRLF & _
"john.doe123@example.co.uk" & @CRLF & _
"alice_smith@company.org" & @CRLF & _
"user1234@emailprovider.net" & @CRLF & _
"test.email1234@email-domain.com" & @CRLF & _
"support@website.info" & @CRLF & _
"jane.doe@emailprovider.org" & @CRLF & _
"contact_us123@example.net" & @CRLF & _
"my.email123@email-provider.co" & @CRLF & _
"" & @CRLF & _
"" & @CRLF & _
"a@ce.ce" & @CRLF & _
"invalid.email@missingtld" & @CRLF & _
"john.doe@invaliddomain.c" & @CRLF & _
"spaces in@email.com" & @CRLF & _
"special!chars@email.com" & @CRLF & _
"noatemail.com" & @CRLF & _
"double..dots@email.com" & @CRLF & _
"@missingusername.com" & @CRLF & _
"user@inva@lid.com" & @CRLF & _
"missingatsigndomain.com"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYFULLMATCH)
; 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