电话号码中间四位加密正则
正则实现
var yourPhoneNmber = '18888888888';
yourPhoneNmber.replace(/(\d{3})(\d{4})(\d{4})/,"$1****$3");
substr实现
var yourPhoneNmber = '18888888888';
yourPhoneNmber.substr(0,3) + '****' + yourPhoneNmber.substr(7);
var yourPhoneNmber = '18888888888';
yourPhoneNmber.replace(/(\d{3})(\d{4})(\d{4})/,"$1****$3");
var yourPhoneNmber = '18888888888';
yourPhoneNmber.substr(0,3) + '****' + yourPhoneNmber.substr(7);