#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^X-Mimecast-Spam-Score\: \b([7-9]|[12][0-9])\b\nX\-Mimecast\-Spam\-Signature\: yes$"
Local $sString = "MIME-Version: 1.0" & @CRLF & _
"X-Mailer: WebService/1.1.19306 YMailNorrin" & @CRLF & _
"Authentication-Results: relay.mimecast.com;" & @CRLF & _
"dkim=pass header.d=yahoo.com header.s=s2048 header.b=XXXXXX;" & @CRLF & _
"dmarc=pass (policy=reject) header.from=yahoo.com;" & @CRLF & _
"spf=pass (relay.mimecast.com: domain of XXXXXX@yahoo.com designates 106.10.241.82 as permitted sender) smtp.mailfrom=XXXXXXXXXX@yahoo.com" & @CRLF & _
"X-Mimecast-Spam-Score: 15" & @CRLF & _
"X-Mimecast-Spam-Signature: yes" & @CRLF & _
"Content-Type: multipart/alternative;" & @CRLF & _
"boundary="----=_Part_966462_2108451314.1637042911940"" & @CRLF & _
"Content-Length: 55093"
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