public static void main(String[] args) throws Exception {
String phone = "18501238888";String hidenPhone = phone.replaceAll("(\\d{3})\\d{4}(\\d{4})","$1****$2");
System.out.println(hidenPhone);
}
public static void main(String[] args) throws Exception {
String phone = "18501238888";