#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?<=filename="Myfile\.pdf")\s+((?:\S+\s)+\S+)="
Local $sString = "--------------A5B0A8B4F69F8BD959B758D0" & @CRLF & _
"Content-Type: application/pdf;" & @CRLF & _
" name="Myfile.pdf"" & @CRLF & _
"Content-Transfer-Encoding: base64" & @CRLF & _
"Content-Disposition: attachment;" & @CRLF & _
" filename="Myfile.pdf"" & @CRLF & _
"" & @CRLF & _
"JVBERi0xLjQKJeLjz9MKMyAwIG9iago8PC9UeXBlL1hPYmplY3QvQ29sb3JT" & @CRLF & _
"ZWI0ODRmNDE1ZDE0YmIyZmU2YjAzZDMzNjU+PGU5MDFiZTMzY2FlOTY4ZDM2" & @CRLF & _
"NmFmOGNhOTUxNTE0Nzk0Pl0vSW5mbyAyMyAwIFIvU2l6ZSAyND4+CnN0YXJ0" & @CRLF & _
"eHJlZgoyMzg2NgolJUVPRgo=" & @CRLF & _
"" & @CRLF & _
"--------------A5B0A8B4F69F8BD959B758D0--"
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