prolificinteractive / Caishen

A Payment Card UI & Validator for iOS
MIT License
766 stars 119 forks source link

CardNumberFormatter Regex Broken #110

Closed steven-diaz closed 6 years ago

steven-diaz commented 7 years ago

Example, American Express, debug output with a card number of "37671234561234"

CardType: AmericanExpress(name: "Amex", CVCLength: 4, numberGrouping: [4, 6, 5], identifyingDigits: Set([37, 34])), groups: [4, 6, 5] Pattern: (\d{1,4})(\d{1,6})?(\d{1,5})? Regex: <NSRegularExpression: 0x13772f8d0> (\d{1,4})(\d{1,6})?(\d{1,5})? 0x0 Formatted: 3767 1234 5612 34

DannyVancura commented 7 years ago
screen shot 2017-06-09 at 3 32 40 pm

Hey, this card number seems to be formatted correctly on my end (besides the fact that it is one digit too short to be valid).