Android Credit Card Check IsDiscoverCreditCard( String UnformattedAccountNumber)

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

Description

Is Discover Credit Card

Declaration

private static boolean IsDiscoverCreditCard(
            String UnformattedAccountNumber) 

Method Source Code

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

public class Main {
    private static boolean IsDiscoverCreditCard(
            String UnformattedAccountNumber) {
        Pattern p = Pattern.compile("^6(?:011|5[0-9]{2})[0-9]{12}$");
        Matcher m = p.matcher(UnformattedAccountNumber);
        return m.matches();
    }//from w w w .j ava  2  s.  c o  m
}

Related

  1. IsAmericanExpressCreditCard( String UnformattedAccountNumber)
  2. IsDinersClubCreditCard( String UnformattedAccountNumber)
  3. IsJCBCreditCard(String UnformattedAccountNumber)
  4. IsMasterCardCreditCard( String UnformattedAccountNumber)
  5. IsVISACreditCard(String UnformattedAccountNumber)
  6. FindCreditCard(String AccountNumber)