2021-01-12 21:16:56
2020-08-10 07:02:12
[^<>]不包含尖括号以确保不会匹配到标签,实际情况可能要加全局g或多行m匹配
var
str =
'<p class="p1"><span>A. She has been to the market.</span></p>'
;
reg = /.*>([^<>]+)<.*/;
str.replace(reg,
'$1'
);