#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "\S+\@\S+"
Local $sString = "From: Avanan" & @CRLF & _
"Sent: Thursday, December 5, 2024 2:39 PM" & @CRLF & _
"To: Support" & @CRLF & _
"Subject: Security event detected" & @CRLF & _
"" & @CRLF & _
"Hello," & @CRLF & _
"Please look at the details of the following anomaly event." & @CRLF & _
"Details:" & @CRLF & _
"Dana@acme.com performed geo-suspicious events: logged in from United States (216.221.27.67) and after 1 minute logged in from United States (173.160.110.50)"
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