Here you can find the source of IsAmericanExpressCreditCard( String UnformattedAccountNumber)
private static boolean IsAmericanExpressCreditCard( String UnformattedAccountNumber)
//package com.java2s; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { private static boolean IsAmericanExpressCreditCard( String UnformattedAccountNumber) { Pattern p = Pattern.compile("^3[47][0-9]{13}$"); Matcher m = p.matcher(UnformattedAccountNumber); return m.matches(); }/*from w w w . ja v a2 s. c om*/ }