#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)\/(\w+)Box\ \[\ ?([-]?\d+|[-]?\d+\.\d+) +([-]?\d+|[-]?\d+\.\d+) +([-]?\d+|[-]?\d+\.\d+)\ +([-]?\d+|[-]?\d+\.\d+)\ *?\]"
Local $sString = "8 0 obj" & @CRLF & _
"<< " & @CRLF & _
"/Type /Page " & @CRLF & _
"/Parent 3 0 R " & @CRLF & _
"/Resources 9 0 R " & @CRLF & _
"/Contents [ 40 0 R 42 0 R 44 0 R 51 0 R 53 0 R 55 0 R 57 0 R 59 0 R ] " & @CRLF & _
"/TrimBox [ 42 42 2151 1573 ] " & @CRLF & _
"/BleedBox [ 36 36 2157 1579 ] " & @CRLF & _
"/MediaBox [ 0 0 2194 1615 ] " & @CRLF & _
"/CropBox [ 0 0 2194 1615 ] " & @CRLF & _
"/Rotate 0 " & @CRLF & _
">> " & @CRLF & _
"endobj"
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