js 前端 身份证号脱敏 身份证号加密 (中间12位加星号)
// 正则替换
let certificateNumber= '370982199201303679';
certificateNumber = certificateNumber.replace(/(?<=\d{3})\d{12}(?=\d{2})/,"************")
console.log(certificateNumber )
// 正则替换
let certificateNumber= '370982199201303679';
certificateNumber = certificateNumber.replace(/(?<=\d{3})\d{12}(?=\d{2})/,"************")
console.log(certificateNumber )