if(!Pattern.matches("^1[3-9]\\d{9}$","13802026020")){ System.out.println("請求的手機號格式錯誤"); }else{ System.out.println("請求的手機號正確"); }