// 手机号码前三后四脱敏
String PHONE = listmap.get("PHONE")+"";
if (StringUtils.isEmpty(PHONE) || (PHONE.length() != 11)) {
    listmap.put("PHONE", PHONE);
}else {
    listmap.put("PHONE", PHONE.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2"));
}

//身份证前三后四脱敏
String IDNO = listmap.get("IDNO")+"";
if (StringUtils.isEmpty(IDNO) || (IDNO.length() < 8)) {
    listmap.put("IDNO", IDNO);
}else {
    listmap.put("IDNO", IDNO.replaceAll("(?<=\\w{3})\\w(?=\\w{4})", "*"));
}

 

posted on 2019-03-05 19:22  菜鸟01号  阅读(523)  评论(1编辑  收藏  举报