symfony/symfony — pull request #6583 by ricardclau (2013-01-05 18:41:39+00:00)
Title: [Validator] Improve regexp for Credit Cards and some more tests

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets:
Todo: Ensure these regexps are proper (credit card validation is always a pain)
License of the code: MIT
Documentation PR:

Regarding Cases excluded from new Regular Expressions:

- Credit card lengths should be respected, these regexp cover lengths in http://en.wikipedia.org/wiki/Bank_card_number
- Visa length can only be 16 and 13 (older ones)
- Diners Cards starting by 5 come from a joint venture between Diners Club and MasterCard, and should be processed like a MasterCard (according to http://www.regular-expressions.info/creditcard.html).
- There seems to be JCB cards starting by 2131 and 1800, I could find them is some places, also found these numbers being tested in Credit Card generators, but some people don't cover them. I don't know their story either

Any comments will be much appreciated!