These are chat archives for Automattic/mongoose

28th
Dec 2017
KARTHIKEYAN A
@karthikeyana__twitter
Dec 28 2017 08:32
data.replace('"[','[').replace(']"',']')
how to write this for globally replace

var reg1 = new RegExp('"[', 'g'), reg2 = new RegExp(']"', 'g')
var data = JSON.parse(data.replace(reg1,'[').replace(reg2,']')); I'm trying this way also not working.

how can achieve the same