日期:2014-05-16 浏览次数:20769 次
<%
s="1348769887<br/>8769887<br/>134988727764"
s=RP(s)
response.Write s
%>
<script runat="server" language="jscript">
function RP(v) {
var whiterx = /(8769887
------解决方案--------------------
8769886)/;//修改你的这个正则如果还有其他白名单
return v.replace(/(\d{3})(\d{3,})/g, function ($0, $1, $2) {
if (whiterx.test($0)) return $0;//包含白名单中不替换
return $1 + '<font color="red">' + $2.replace(/\d/g, '*') + '</font>';
});
}
</script>