<script>
var regex_num_set = /&#(\d+);/g;
var str = "Here is some text: rwwhw.com"
str = str.replace(regex_num_set, function(_, $1) {
return String.fromCharCode($1);
});
document.write('<pre>'+JSON.stringify(str,0,3));
</script>包装一下变成一下方式
<script>
function ncr(str){
var regex_num_set = /&#(\d+);/g;
str = str.replace(regex_num_set, function (_, $1) {
return String.fromCharCode($1);
});
return JSON.stringify(str, 0, 3);
}
</script>

