#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^\s*Topic\s*\:\s*Bat[^{]+(\{.*\})\s*$"
Local $sString = "Topic:Cat [0] at offset:216712{"ID":55689534,"NAME":6}" & @CRLF & _
"Topic:Cat [1] at offset:216719{"ID":55689524,"NAME":6}" & @CRLF & _
" Topic : Bat [0] at offset:216716 {"CODE":94762151097,"AGE":32,data:{data:{} } } " & @CRLF & _
"Topic:Cat [0] at offset:216713{"ID":55689524,"NAME":6}" & @CRLF & _
"Topic:Bat [1] at offset:216723{"CODE":947080272531,"AGE":43}" & @CRLF & _
"Topic:Cat [1] at offset:216738{"ID":55689525,"NAME":6}"
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