1 var str = "13812345678";2 var a= /(\d{3})\d*(\d{4})/;3 var b = str.replace(a,'$1****$2');4 console.log(b);
本文共 164 字,大约阅读时间需要 1 分钟。
1 var str = "13812345678";2 var a= /(\d{3})\d*(\d{4})/;3 var b = str.replace(a,'$1****$2');4 console.log(b);
转载于:https://www.cnblogs.com/DreamLiFeng/p/10207642.html