#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)"(?!Block\d|Field001|Field002|Field_003)[-\w]+":[^,\r\n]+,?\s*"
Local $sString = " { " & @CRLF & _
" "Block1":{ " & @CRLF & _
" "Field001":"Value001"," & @CRLF & _
" "Field002":"Value002 "," & @CRLF & _
" "Field003":1000," & @CRLF & _
" "Field004":"Value004"," & @CRLF & _
" "Field005":1000," & @CRLF & _
" "Field00N":1000" & @CRLF & _
" }," & @CRLF & _
" "Block2":{ " & @CRLF & _
" "Field-001":"Value-001"," & @CRLF & _
" "Field-002":"Value-002"," & @CRLF & _
" "Field-003":"Value-003"," & @CRLF & _
" "Field-00N":"Value-004"" & @CRLF & _
" }," & @CRLF & _
" "Block3":{ " & @CRLF & _
" "Field_001":"Value_001"," & @CRLF & _
" "Field_002":"Value_002"," & @CRLF & _
" "Field_003":"Value_003"" & @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