- 身份证号码隐藏
const cardNo = idCard.replace(/^(.{6})(?:\w+)(.{4})$/, "\$1********\$2")
- 手机号脱敏处理
const mobile = mobile.replace(/^(.{3}).*(.{4})$/, "\$1****\$2")
const cardNo = idCard.replace(/^(.{6})(?:\w+)(.{4})$/, "\$1********\$2")
const mobile = mobile.replace(/^(.{3}).*(.{4})$/, "\$1****\$2")
本文标题:字符串脱敏
本文链接:https://www.haomeiwen.com/subject/zauigrtx.html
网友评论