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

215
Vistas
Regex that ensures if there is an opening parentheses there is a closing one

I'm writing a regex that validates a phone number and want it to to either have 3 digits matching or 3 digits wrapped in parentheses. It fails if there is only a closing parentheses but matches if there is an open one by itself. I can't figure out why. Here is the regex:

let phoneRegex = //(\d{3}|\(\d{3}\))( ?|-?)(\d{3})( ?|-?)(\d{4})//
let sampleNumber = (908-525-5565
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