JS利用正则快速格式化手机号
let mobile = '13888888888'.replace(/^(.{3}).*(.{4})/, '$1****$2');console.log(mobile); // 138****8888mobile = '13888888888'.replace(/^(.{3})(.*)(.{4})/, '$1 $2 $3');console.log(mobile); // 138 8888 8888
原创
2020-12-03 10:07:53 ·
1570 阅读 ·
0 评论