#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mi)\b[A-Z0-9._%+-]+(\s*@\s*|\s*[@\[\{\(]*(\s*(@)\s*|\s+([@\[\{\(]*at[\]\}\)]*)\s+)[\]\}\)]*\s*)([A-Z0-9-])+((\s*[\[\{\(]*\s*(dot|\.)\s*[\]\}\)]*\s*)+[A-Z]{2,6})+\b"
Local $sString = "Hello hi_there@gmail.com, welcome to Gskinner!" & @CRLF & _
"Hello hi_there [at] gmail [dot] com, welcome to Gskinner!" & @CRLF & _
"Hello hi_there (at) gmail (dot) co (dot) uk, welcome to Gskinner!" & @CRLF & _
"Hello jam+jim @ googlemail.com, welcome to Gskinner!" & @CRLF & _
"Hello heythere {at} guardian [dot] co (dot) uk, welcome to Gskinner!" & @CRLF & _
"Hello contact [[[@]]] jazzit (dot) hr, welcome to Gskinner!" & @CRLF & _
"obfuscated_emails = [" & @CRLF & _
" "moo@doo.com"," & @CRLF & _
" "m_oo@doo.co.uk"," & @CRLF & _
" "moo @@ doo.com"," & @CRLF & _
" "moo @ doo . com"," & @CRLF & _
" "moo @ doo.com"," & @CRLF & _
" "moo@doo . com"," & @CRLF & _
" "moo@doo . co . uk"," & @CRLF & _
" "moo@doo. co. uk"," & @CRLF & _
" "m_oo @ doo.com"," & @CRLF & _
" "moo [at] doo.com"," & @CRLF & _
" "moo [at] doo . com"," & @CRLF & _
" "moo [at] doo [dot] com"," & @CRLF & _
" "m_oo [at] doo [dot] co [dot] uk"," & @CRLF & _
" "moo at doo.com"," & @CRLF & _
" "moo at doo . co . uk"," & @CRLF & _
" "m_oo at doo . com"," & @CRLF & _
" "moo at doo dot com"" & @CRLF & _
"]" & @CRLF & _
"Email him directly at firstname.lastname@companyname.com" & @CRLF & _
"word wordWithAtintheend. anotherword" & @CRLF & _
"roofcrafters-certifications.jpg , location.href" & @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