#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "([\w-]+): (.+?)\\r\\n(?:([^:]+?)\\r\\n)?"
Local $sString = "MIME-Version: 1.0\r\n" & @CRLF & _
"x-no-auto-attachment: 1\r\n" & @CRLF & _
"Received: by 10.200.36.132; Sun, 5 Feb 2017 01:21:33 -0800 (PST)\r\n" & @CRLF & _
"Date: Sun, 5 Feb 2017 01:21:33 -0800\r\n" & @CRLF & _
"Message-ID: <IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII@mail.gmail.com>\r\n" & @CRLF & _
"Subject: =?UTF-8?Q?MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM?=\r\n" & @CRLF & _
"=?UTF-8?Q?ail?=\r\n \" & @CRLF & _
"From: =?UTF-8?B?VGhlIGZ1Y2sgYXJlIHUgbG9va2luZyBmb3I/?= <noreply@mail.com>\r\n" & @CRLF & _
"To: mail mail <mail@mail.com>\r\n" & @CRLF & _
"Content-Type: multipart/alternative; boundary=1a3xca651sv561fd321c5xv61sd12\r\n" & @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