Android Credit Card Check IsDinersClubCreditCard( String UnformattedAccountNumber)

Here you can find the source of IsDinersClubCreditCard( String UnformattedAccountNumber)

Description

Is Diners Club Credit Card

Declaration

private static boolean IsDinersClubCreditCard(
            String UnformattedAccountNumber) 

Method Source Code

//package com.java2s;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
    private static boolean IsDinersClubCreditCard(
            String UnformattedAccountNumber) {
        Pattern p = Pattern.compile("^3(?:0[0-5]|[68][0-9])[0-9]{11}$");
        Matcher m = p.matcher(UnformattedAccountNumber);
        return m.matches();
    }/*from www.  j  av a 2s.  c o  m*/
}

Related

  1. IsAmericanExpressCreditCard( String UnformattedAccountNumber)
  2. IsDiscoverCreditCard( String UnformattedAccountNumber)
  3. IsJCBCreditCard(String UnformattedAccountNumber)
  4. IsMasterCardCreditCard( String UnformattedAccountNumber)
  5. IsVISACreditCard(String UnformattedAccountNumber)