手机号中间4位为*

var reg = /^(\d{3})(\d*)(\d{4})$/;

var str = " 15516236523";

str = str .replace(reg,function(a,b,c,d){

return b + c.replace(\/d\g,"*") + d ;

console.log(str);

});

2019-10-08:10:40

posted on 2019-10-08 10:41  .一天  阅读(118)  评论(0)    收藏  举报

导航