Credit Card Validation using Regular expression

1 comments

Visa: ^4[0-9]{12}(?:[0-9]{3})?$  - Visa card will have 16 digits. Always starts with 4.

MasterCard:  ^5[1-5][0-9]{14}$ -  Master Card will have 16 digits. Always starts with 51 through 55.

American Express: ^3[47][0-9]{13}$  -   American Express will have 15 digits. Always starts with 34 or 37.
Vikram Chandra Theme by BloggerThemes & NewWPThemes Sponsored by iBlogtoBlog