var text = "过滤敏感词及不文明用语";var re = /敏感词|文明/gi;var output = text.replace(re, function(sMatch){ return sMatch.replace(/./g,"*");});
本文共 180 字,大约阅读时间需要 1 分钟。
var text = "过滤敏感词及不文明用语";var re = /敏感词|文明/gi;var output = text.replace(re, function(sMatch){ return sMatch.replace(/./g,"*");});
转载于:https://www.cnblogs.com/zzzzzwt/p/10149687.html