DD
DevDash

Regex for JCB Credit Card

Regex Pattern

^35(?:2[89]|[3-8][0-9])[0-9]{12}$

JCB card — starts with 3528-3589, 16 digits total

Quick Answer

The regex pattern for jcb credit card is `^35(?:2[89]|[3-8][0-9])[0-9]{12}$`. JCB card — starts with 3528-3589, 16 digits total. This works in JavaScript, Python, Ruby, PHP, Java, and most regex engines that support PCRE syntax.

Test Examples

InputResult
3530111333300000✓ Matches
3566002020360505✓ Matches
3528000000000007✓ Matches
4111111111111111✗ No match
3527000000000007✗ No match
353011133330✗ No match

Code Examples

javascript

const regex = /^35(?:2[89]|[3-8][0-9])[0-9]{12}$/;
const isValid = regex.test(value);

python

import re
pattern = r'^35(?:2[89]|[3-8][0-9])[0-9]{12}$'
if re.match(pattern, value):
    print("valid")

ruby

pattern = /^35(?:2[89]|[3-8][0-9])[0-9]{12}$/
if value =~ pattern
  puts "valid"
end

php

if (preg_match('/^35(?:2[89]|[3-8][0-9])[0-9]{12}$/', $value)) {
    echo "valid";
}

java

String pattern = "^35(?:2[89]|[3-8][0-9])[0-9]{12}$";
boolean isValid = value.matches(pattern);

Frequently Asked Questions

Related Regex Patterns

Want API access + no ads? Pro coming soon.