Matching credit card numbers


show more Matching credit card numbers provides you with in-depth training on Developer. Taught by Kevin Skoglund as part of the Using Regular Expressions show less
please wait ...

Matching credit card numbers

In this movie, we're going to learn to write a regular expression to match credit card number formats. We're only going to be looking at the formats, because we have no way of knowing whether a credit card is actually valid without submitting it to the payment processor. But we can check ahead of time to make sure that the credit card number is in the right format before we send it off to the credit card processor and wait for their reply. For example, if we're expecting to have a 16 digit credit card number, then if we were only given seven digits, we know that's not a valid credit card number, and there's no point in submitting it to the payment processor. We're going to be looking at four major credit cards.

We're going to look at American Express, Visa, MasterCard, and Discover. For each one of these, I've given you a sample credit card, and I've written it twice. The first time is the number without any spaces or delimiters inside it; just number...

Matching credit card numbers
Video duration: 9m 36s 5h 36m Intermediate

Viewers:

Matching credit card numbers provides you with in-depth training on Developer. Taught by Kevin Skoglund as part of the Using Regular Expressions

Subject:
Developer
Software:
Regular Expressions
Author:
please wait ...