Java tutorial
//package com.java2s; public class Main { public static String compilePhone(String mobile) { return mobile.replaceAll("(?<=\\d{3})\\d(?=\\d{4})", "*"); } }