Launching a SaaS?·Collect waitlist signups before you build — before.run
SandboxPatternsDetectDocs
Finance
#payment
#credit-card
#finance
#visa

Credit Card Number

Generic credit card number validator supporting Visa, Mastercard, American Express, and Discover card formats.

Payment form validationE-commerce checkoutSubscription billing
/
/
Test String
3 matches
(?:…)Non-capturing groupNon-capturing group — groups without capturing (no index assigned)
44'4' — literal character
[…]{12}Character class […]Matches any single character listed in this set — repeated exactly 12 times · {12} — exactly 12 times
(?:…)?Non-capturing groupNon-capturing group — groups without capturing (no index assigned) — repeated zero or one time (optional) · ? — zero or one time (optional)
||| — alternation: matches expression on left OR right
[…]Character class […]Matches any single character listed in this set
[…]Character class […]Matches any single character listed in this set
[…]{14}Character class […]Matches any single character listed in this set — repeated exactly 14 times · {14} — exactly 14 times
||| — alternation: matches expression on left OR right
66'6' — literal character
(?:…)Non-capturing groupNon-capturing group — groups without capturing (no index assigned)
[…]{12}Character class […]Matches any single character listed in this set — repeated exactly 12 times · {12} — exactly 12 times
||| — alternation: matches expression on left OR right
33'3' — literal character
[…]Character class […]Matches any single character listed in this set
[…]{13}Character class […]Matches any single character listed in this set — repeated exactly 13 times · {13} — exactly 13 times
||| — alternation: matches expression on left OR right
33'3' — literal character
(?:…)Non-capturing groupNon-capturing group — groups without capturing (no index assigned)
[…]{11}Character class […]Matches any single character listed in this set — repeated exactly 11 times · {11} — exactly 11 times
||| — alternation: matches expression on left OR right
(?:…)Non-capturing groupNon-capturing group — groups without capturing (no index assigned)
\d{11}digit\d — digit (0–9) — repeated exactly 11 times · {11} — exactly 11 times
Pattern: 150 charsInput: 49 chars
100% client-side · private

Valid Examples

  • 4111111111111111
  • 5500005555555559
  • 371449635398431

Invalid Examples

  • 1234567890123456
  • 411111111111
  • 0000000000000000