0

I use following RegEx to identify JCB credit card.

I found the RegEx from here https://www.regular-expressions.info/creditcard.html

input.startsWith(new RegExp(r'(?:2131|1800|35\d{3})\d{11}'))

When I validate the following card number, it does not identify it correctly

3088000000000009 

Any idea how to fix this?

Janaka
  • 2,505
  • 4
  • 33
  • 57
  • But your pattern clearly does not match the string. See some links to answers with matching regexps. – Wiktor Stribiżew Oct 12 '20 at 18:10
  • Yes definitely won't match. The 3088 doesn't match at the second 8. – Randal Schwartz Oct 15 '20 at 19:57
  • I've found that almost every regex from that site that is longer than a dozen chars is broken. The one matching email is laughingly wrong, except that I see it being cargo-culted into many applications, ande it makes me sad. – Randal Schwartz Oct 15 '20 at 20:00

0 Answers0