#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "\d+=\s*({(?:[^}{]++|(?-1))*})"
Local $sString = "1111= " & @CRLF & _
"{ " & @CRLF & _
"name="NY" " & @CRLF & _
"owner="USA" " & @CRLF & _
"controller="USA" " & @CRLF & _
"core="USA" " & @CRLF & _
"garrison=100.000 " & @CRLF & _
"artisans= " & @CRLF & _
"{ " & @CRLF & _
"id=172054 " & @CRLF & _
"size=40505 " & @CRLF & _
"american=protestant " & @CRLF & _
"money=5035.95938 " & @CRLF & _
"} " & @CRLF & _
"clerks= " & @CRLF & _
"{ " & @CRLF & _
"id=17209 " & @CRLF & _
"size=1988 " & @CRLF & _
"nahua=catholic " & @CRLF & _
"money=0.00000 " & @CRLF & _
"} " & @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