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

228
Views
Regex to match all the words that is not a interpolated string

I want to match all the words except interpolated string i.e, strings which are inside #{...}

'The variable 1 is #{vf a sr} abc' 'the variable 2 is #{var}' 'the variable is something' 'The variables are #{ b } and #{&c&}'

I want to avoid matching all the strings in {..} , as well as if there is any space character or special symbols inside it.

I have written one regex : /(?<![#{\w])\w+(?![\w}])/gi. It has one negative lookbehind (?<![#{\w]) and one negative lookahead (?![\w}). The problem is its still matching the a in {vf a sr}. And the regex also breaks if there is a special character like {&c&}, in this case it now match the c.

https://regex101.com/r/lEieyw/5

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!