Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

208
Vistas
REGEX-JAVASCRIPT Unable to find pattern

I am trying to figure how I can search for a pattern that gives me only digits or digits followed by only one letter. I know I can use /\D\g to find only digits but I dont know how to find digits with only one letter after it. The letters can only be the following:['a','A','b','B','c','C','d','D','n','N','e','E','s','S','w','W']

  const testPattern = /[A-Za-z][0-9]/
  console.log('item_10a_object10a'.pattern(testPattern))
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

First, you need to group the whole thing with (), and end with /g so it matches multiple groups.

If you want digits first then a number, you need to put the letter block after the numbers: ([0-9][A-Za-z])

If you want multiple digits to match, you need a + after the numbers block: [0-9]+

All together: /([0-9]+[A-Za-z])/g

For reference, \d does the same thing as [0-9], so you could do /(\d+[A-Za-z])/g instead

LPT: use regex101 to build and test regex queries

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda