Here you can find the source of IsVISACreditCard(String UnformattedAccountNumber)
private static boolean IsVISACreditCard(String UnformattedAccountNumber)
//package com.java2s; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { private static boolean IsVISACreditCard(String UnformattedAccountNumber) { Pattern p = Pattern.compile("^4[0-9]{12}(?:[0-9]{3})?$"); Matcher m = p.matcher(UnformattedAccountNumber); return m.matches(); }//ww w.j a v a2 s. c o m }