Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

304
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda