bendrucker / creditcards-types

Card type definitions and methods for creditcards
MIT License
71 stars 20 forks source link

MADA regex does not match from the start of the card number #59

Closed punit-shah-cko closed 4 years ago

punit-shah-cko commented 4 years ago

When the Mada regex was updated in #51, ^ was not included at the start of the patterns.

The patterns for all other card types start with ^, meaning they will match from the start of the card number.

Because the Mada regex does not match from the start of the card number, it can incorrectly match the middle of a card number. We have noticed a few Visa/Mastercard card numbers that are incorrectly being matched as Mada as a result of this.