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

298
Views
check if string contains balanced single braces, contains solely balanced double braces should return false

I am trying to write a regex test in JavaScript to check if a string solely contains balanced single braces, solely containing balanced double braces should return false.

For example:

  • if the string is "{something}", "abc{something}cbd", it should return true,

  • if the string is "{something}abc{{somethingElse}}", "{{somethingElse}}{something}", it should also return true,

  • however, if the string is "{{something}}" or "{{something}}abc{{somethingElse}}", it should return false

I have a regex solution for this, which is /(?<!{\s?){(?!\s?{)[^{}]+(?<!}\s?)}(?!\s?})/gm, however ios safari doesn't support negative lookbehind.

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!