CreditCardValidator used JavaScript and Luhn Formular and RegExps to validate visa, mastercard and amex.