#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)^(\s*"Version"\s*:\s*")[^"]*"
Local $sString = "{" & @CRLF & _
" "FramewokSettings": {" & @CRLF & _
" "Name": "VX"," & @CRLF & _
" "Version": "8", // The value here is not constant. It can be something like v1.4.56.456 also" & @CRLF & _
" "GitVersion": "v5"," & @CRLF & _
" "DatabaseVersion": "7"," & @CRLF & _
" // Doing xyz " & @CRLF & _
" "CounterVersion": "2"" & @CRLF & _
" // Doing ABC. " & @CRLF & _
" // Start" & @CRLF & _
" }" & @CRLF & _
"}"
Local $sSubst = "${1}10"
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