驗證是不是字符串是否是符合手機號

public static boolean isMobile(final String str) {code

Pattern p = null;
    Matcher m = null;
    boolean b = false;
    p = Pattern.compile("^[1][3,4,5,7,8][0-9]{9}$"); // 驗證手機號
    m = p.matcher(str);
    b = m.matches();
    return b;
}
相關文章
相關標籤/搜索