MvcValidatorToolkit/Validators/ValidateCreditCardNumber.cs
/// <summary>
/// Validates the given value against the regular expression for credit card numbers.
/// </summary>
Validates the given value against the regular expression for credit card numbers.
Validates the given value against the regular expression for credit card numbers .
private bool ValidateRegexForCreditCardNumber(string value)
		{
			string pattern = @"^((4\d{3})|(5[1-5]\d{2})|(6011))-?\d{4}-?\d{4}-?\d{4}|3[4,7][\d\s-]{13}$";
			return new Regex(pattern).IsMatch(value);
		}
private bool ValidateRegexForCreditCardNumber ( string value ) { string pattern = @"^((4\d{3})|(5[1-5]\d{2})|(6011))-?\d{4}-?\d{4}-?\d{4}|3[4,7][\d\s-]{13}$" ; return new Regex ( pattern ) . IsMatch ( value ) ; }
Validates the given value against the regular expression for credit card numbers.
Validates the given value against the regular expression for credit card numbers .
// See URL for regular expression of credit card numbers: // http://www.codeasp.net/blogs/vinay_jss/microsoft-net/90/credit-card-validation-through-regular-expression-validator-in-aspnet
value
string