问题:去除字符串中的标签,但不包括<br>
'<p>No one should be alone in their old age.<br></p>'
.replace(/<((?!br).)*?>/g, '')
// 结果
"No one should be alone in their old age.<br>"
问题:去除字符串中的标签,但不包括<br>
'<p>No one should be alone in their old age.<br></p>'
.replace(/<((?!br).)*?>/g, '')
// 结果
"No one should be alone in their old age.<br>"