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

159
Vistas
Building a very simple regex

I need to match "-" or "_" followed by an alphabetic character (A-Z,a-z). So for example, for "simple-hello_world-" i need to match the "-h" and the "_w".

This is my regex: /-|_[A-Z]/i

But it appears that the [A-Z] is an optional match because it matchs if the string ends with a "-" or with a "_":

"hellogworld-".match(/-|_[A-Z]/i)

[ '-', undefined, index: 11, input: 'hellogworld-', groups: undefined ]

Any help is appreciated.

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