#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?x)# From object name = value " & @CRLF & _
"( # (1 start)" & @CRLF & _
" " \s* \w+ \s* " \s* : " & @CRLF & _
" " & @CRLF & _
" (?! \s* " ) # not a string" & @CRLF & _
" (?! # not a number" & @CRLF & _
" \s* \d+ \s* " & @CRLF & _
" (?: , | \] | } )" & @CRLF & _
" )" & @CRLF & _
" (?! \s* [{\[] ) # not a object or array" & @CRLF & _
" (?! # not true,false or null" & @CRLF & _
" \s* " & @CRLF & _
" (?: true | false | null )" & @CRLF & _
" \s* " & @CRLF & _
" (?: , | \] | } )" & @CRLF & _
" )" & @CRLF & _
" " & @CRLF & _
" \s* " & @CRLF & _
") # (1 end)" & @CRLF & _
"( .+? ) # (2)" & @CRLF & _
"(?= [,}] )"
Local $sString = " {"Id": "2017"," & @CRLF & _
" "Currency": "AUD"," & @CRLF & _
" "Date": 2020-06-22," & @CRLF & _
" "InCash": 0.000, " & @CRLF & _
" "Dep": "ABC90"," & @CRLF & _
" "sdf" : 739," & @CRLF & _
" "sumCash": 770.87," & @CRLF & _
" "AnotherDate": 2020-06-21}"
Local $sSubst = "$1"$2""
Local $sResult = StringRegExpReplace($sString, $sRegex, $sSubst)
MsgBox($MB_SYSTEMMODAL, "Result", $sResult)
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