#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "{(?:[A-Za-z_][A-Za-z_0-9]*|[+\-*/%<=>&|()0-9. ])*}"
Local $sString = "// \%def{ Value3 , name.len + (i * Person.age) + ( }" & @CRLF & _
"// %if{ (name.len == 20) && (value == 20) }"
Local $sSubst = "hello"
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