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

201
Vistas
¿Cómo elimino las llaves de las cadenas JSON usando una expresión regular?

Hola, tengo este archivo JSON. Quiero eliminar las llaves del interior de las cadenas en la matriz de capítulos, pero si estas llaves contienen más de 3 palabras (2 espacios dentro de las llaves), quiero que se elimine la llave completa. . ¿Es posible con la expresión regular ?

 { "abbrev": "gn", "name": "Genesis", "chapters": [ [ "And the earth was without form, and void; and darkness {was} upon the face of the deep. And the Spirit of God moved upon the face of the waters.", "And God said, Let there be light: and there was light.", "And God saw the light, that {it was} good: and God divided the light from the darkness. {the light from...: Heb. between the light and between the darkness}", "And God called the light Day, and the darkness he called Night. And the evening and the morning were the first day. {And the evening...: Heb. And the evening was, and the morning was etc.}", "And God said, Let there be a firmament in the midst of the waters, and let it divide the waters from the waters. {firmament: Heb. expansion}" ] ] }

Intenté resolver con una mirada negativa al futuro, resultados insatisfactorios. Y si no es posible con la expresión regular, ¿cuál sería la solución en javascript?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

No veo por qué no pudiste resolver esto usando 2 expresiones regulares:

 var regex1 = /{[^{}]+[ ][^{}]+[ ][^{}]+}/g; var regex2 = /[{}]/g; var str = ...; str = str.replace(regex1, ""); str = str.replace(regex2, "");
about 4 years ago · Juan Pablo Isaza Denunciar
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