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

133
Views
Regex for best match

I have a list of strings such as

const myCategories = ["Alligator", "Rhyno", "Elephant"]

And I want to get the best match for the string which I provide as input, for example

const userInput = "elep"

return myCategories.find(category => category.test(userInput))

However this does not work as I expect.

I need this to return a category even with a partial match, for example, if i write "eph", I should get "Elephant", or "rho" I should get "Rhyno"

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

What it sounds like you're looking for is not regex, but a fuzzy string comparison. Try Javascript fuzzy search that makes sense for more information.

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!