#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "Received:\s+(?P<myfield>.+\;[\r|\n].+)"
Local $sString = "Received: by 10.52.65.232 with SMTP id a8csp4016332vdt;" & @CRLF & _
"Fri, 2 Jan 2015 12:46:51 -0800 (PST)" & @CRLF & _
"X-Received: by 10.68.241.35 with SMTP id wf3mr127732074pbc.22.1420231611043;" & @CRLF & _
"Fri, 02 Jan 2015 12:46:51 -0800 (PST)" & @CRLF & _
"Return-Path: "
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