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

155
Vistas
regex just adding = breaks match

Why with this regex

https://regex101.com/r/wYUZCO/1

(category\s+(\w+))(\s*=\s*)?(?:\s+(\w+))?(?:\s+(\w+))?

I can match

category fruits pear orange

but not

category fruits = pear orange
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You're matching the space after = twice; first using \s* after the = in your regex, and then with \s+ on (?:\s+(\w+)).

You could resolve this easily in many different ways, but this one is probably the simplest:

(category\s+(\w+))(\s*=\s*)?(?:\s*(\w+))?(?:\s+(\w+))?

(note, I changed (?:\s+(\w+)) to (?:\s*(\w+)), in order to match a space 0+ times instead of 1+ times.)

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