编辑代码

let reg = /(?<=#{).*?(?=}#)/gi;
let str = '{a: "test", b="#{abc.12314}#", c:123, e:"#{def.89789}#"}';
let match = str.match(reg); // 输出 ['1234']
if (match) {
    console.log('match:'. match)
   for (const matchData of match) {
        console.log(matchData)
        str = str.replace("#{"+matchData+"}#", "翻译后1")
   }
   console.log(str)
} else {
    console.log('未找到')
}