public class LicenseNumberRegexUtil { private static final Log logger = LogFactory.getLog(LicenseNumberRegexUtil.class); /** * 营业执照注册号校验正确返回码 */ private static String error_Businesslicense_Empty = "请输入营业执照注册号"; public static String error_Businesslicense = "您输入的营业执照注册号有误,请核对后再输!"; public static String error_Businesslicense_No = "您输入的营业执照注册号不足15位,请核对后再输!"; public static String test = "110108000000016";// 营业执照号 public static void main(String[] args) { isLicense_18(test); } /** * 校验 营业执照注册号 * * @param businesslicense * @return */ public static boolean isLicense_15(String businesslicense) { if ("".equals(businesslicense) || " ".equals(businesslicense)) { logger.error(error_Businesslicense_Empty); return false; } else if (businesslicense.length() != 15) { logger.error(error_Businesslicense_No); return false; } String businesslicensePrex14 = businesslicense.substring(0, 14);// 获取营业执照注册号前14位数字用来计算校验码 String businesslicense15 = businesslicense.substring(14, businesslicense.length());// 获取营业执照号的