Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

153
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!