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

287
Vistas
How to remove double quote in broken nested json values?

Am stuck with applying replace() with regex for broken nested json value. For example, i want to remove doublequote for origin value below.

How to change from this:

{
 "type" : "fruitList",
 "data" : [{
   "fruitName" : "test",
   "origin" : "[{"states" : "USA"}]"
 }]
}

To this:

{
 "type" : "fruitList",
 "data" : [{
   "fruitName" : "test",
   "origin" : [{"states" : "USA"}]
 }]
}

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

0

You could simply use 2 replace without RegEx:

jsonstring.replace('"[', "[").replace(']"', "]")

Or if you just want to use a single replace with RegEx:

jsonstring.replace(/("\[|\]")/g, match => {
   return match === '"[' ? "[" : "]"
})
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