Java tutorial
//package com.java2s; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { private static final String JCBCreditCardPattern = "^(?:2131|1800|35\\d{3})\\d{11}$"; private static boolean isJCBCard(String creditCardNumber) { Pattern pattern = Pattern.compile(JCBCreditCardPattern); Matcher matcher = pattern.matcher(creditCardNumber); return matcher.find(); } }