#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?i)(?>.*?)(nugenix|cialis|somethingelse)(?>.*?@)(?!.*?(nugenix|cialis|somethingelse))"
Local $sString = "// Match" & @CRLF & _
"Return-Path: <get-some-nugenix-for-health@whatever.yooooo.com>" & @CRLF & _
"Return-Path: <get-some-nugenix@-sakana15.com>" & @CRLF & _
"Return-Path: <nugenix-for-health@-sakana15.com>" & @CRLF & _
"<anycharacters+somethingelse+anyothercharacters+@" & @CRLF & _
"" & @CRLF & _
"// No match - Banned words in Sender and Domain" & @CRLF & _
"Return-Path: <get-some-nugenix-for-health@whatnugenixever.yooooo.com>" & @CRLF & _
"Return-Path: <get-some-nugenix-for-health@nugenixwhatever.yooooo.com>" & @CRLF & _
"Return-Path: <get-some-nugenix-for-health@whatever.yooooo.comnugenix>" & @CRLF & _
"Return-Path: <get-some--for-healthnugenix@whatnugenixever.yooooo.com>" & @CRLF & _
"Return-Path: <nugenixget-some-for-health@nugenixwhatever.yooooo.com>" & @CRLF & _
"" & @CRLF & _
"// No Match - Banned words only in domain" & @CRLF & _
"Return-Path: <get-some-for-health@whatever.yooooo.com>" & @CRLF & _
"Return-Path: <get-some-for-health@nugenixwhatever.yooooo.com>" & @CRLF & _
"Return-Path: <get-some-for-health@whatevernugenix.yooooo.com>" & @CRLF & _
"Return-Path: <get-some-for-health@whatever.yooooo.comnugenix>"
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