const text = "用户姓名:${name},手机号:${phone},地址${address_01}"; const reg = /\$\{[^}]+\}/g; const result = text.match(reg); console.log(result);