#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?u)auth-sender:\h+(.+)\h*\R*"
Local $sString = " Received: from mail pickup service by fakeserver.m2w.com with Microsoft" & @CRLF & _
" SMTPSVC; Tue, 3 Dec 2019 14:36:35 -0800" & @CRLF & _
"auth-sender: santaana@fakeemail.com" & @CRLF & _
"Received: from 217.165.33.125 unverified ([217.165.33.125]) by" & @CRLF & _
" mmmeb08oc.m2w.com with M2W SMTP Server;" & @CRLF & _
" Tue, 03 Dec 2019 14:36:34 -0800" & @CRLF & _
"Date: Wed, 04 Dec 2019 02:32:18 +0400" & @CRLF & _
"From: "Coordinador MLV" <santaana@fakeemail.com>" & @CRLF & _
"To: <8736c321fd7cc61b92396b4f275614c7@fakeemail.comm>"
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