1. 程式人生 > >手機號碼正則驗證

手機號碼正則驗證

final String telRegex  = "[1][3578]\\d{9}";
trim.matches(telRegex) //判斷他的返回值是true 還是false  

true 是正確的手機號

false 是錯誤的手機號