Java tutorial
//package com.java2s; import java.util.regex.Pattern; public class Main { public static boolean checkIdCard(String idCard) { String regex = "[1-9]\\d{13,16}[a-zA-Z0-9]{1}"; return Pattern.matches(regex, idCard); } }