Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

203
Visualizações
¿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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda