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

138
Views
JS Regular Expression Match a Word in String sepparated by space

i want to use this

const text = 'The silver ho house is so housey and the other house too.';
const val = 'house';
const exp = `^(.*?(\b${val}\b)[^$]*)$`;
text.match(exp); //should match.

to match a word in a string for e.g.

//The silver ho house is so housey and the other house too.
// match -------^^^^^                    match---^^^^^

But I first have to convert the exp string to a 'real' regular expression and i don't know how to do this properly. RegExp(exp) does not work by the way.

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