let htmlText = '<img style="border: 0px; width: 537px; display: block;">'
let str = htmlText.replace(/<img[^>]*>/gi, function (match, capture) {
return match.replace(/style\s*?=\s*?([‘"])[\s\S]*?\1/ig, 'style="max-width:100%;height:auto;"') // 替换style
})