Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name format on the creditcard #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mansi-rezdy
Copy link

  • Creditcard with dot in Name (LINCOLN/ABRAHAM J.)
  • Creditcard with only a full name (A. J. LINCOLN) - Name not separated by /

- Creditcard with only a full name (A. J. LINCOLN) - Name not separated by /
@antonskv
Copy link

antonskv commented Jun 1, 2017

I had the same issue. I changed the RegExp patterns a bit.

This is pattern for VISA, but it's same part that parses the name that goes for all, allowing commas and periods inside the name:

var pattern = new RegExp("^%B(4[0-9]{12,18})\^([a-zA-Z0-9,. ]+)/([a-zA-Z0-9,. ]+)\^([0-9]{2})([0-9]{2})");

Periods are not enough, as there are names like "James S. Johnson, III", meaning "The Third" that comes with a comma, so those must be allowed in. It's not completely horrible to allow all alpha-numberics in along with commas and periods. Should cover all scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants