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

133
Views
Regular expressions in Javascript with limiting amount of numbers/letters

I am trying to figure out how to write regular expressions in javascript i need to have a three letter group of either ACF, ABQ, or BXD the character after must be hyphen followed by either 6 or 9 then 5 numbers between 0-9

This is my attempt i'm not sure where I am going wrong?

/ACF|ABQ|BXD-^6|9[0-9]{5}

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can group the first 3 alternations in a non capture group, and you should put the ^ at the start of the pattern.

If you want to match 6 or 9 you can use a character class [69]

The $ at the end denotes the end of the string.

The pattern can be written as:

^(?:ACF|ABQ|BXD)-[69][0-9]{5}$

Regex demo

about 4 years ago · Juan Pablo Isaza Report
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!