文章目录
代码
javascript
formatter(value) {
var regStr = /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/gi;
let reg1 = /(^\s+)|(\s+$)/g;
let reg3 = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%......&*()------\-+={}|《》?:""【】、;'',。、]/g;
if (reg1.test(value)) {
return value.replace(reg1, '');
} else if (regStr.test(value)) {
return value.replace(regStr, '');
}
else if (reg3.test(value)) {
return value.replace(reg3, "");
}
else {
return value;
}
},