Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

128
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda