Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

80
Views
Regex for Mastercard Card Number Range

I could use some help developing a regex for the following range:

222100‑272099

This is what I have so far, but I am having trouble figuring out how to make it work for the entire range. I get caught up on the 3rd and 4th digit.

^2[2-7][0-9][0-9][0-9][0-9]

This is a part of this

var optCC = '2221000000000000';

if(optCC.match(/^2[2-7][0-9][0-9][0-9][0-9]/)){
//do stuff
}

Basically I am trying to detect if someone is using a legacy Mastercard credit card number and this is the range I've found through my searching.

Thanks in advance!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!