Hi All I want to fix my json I got strings without " and I need to bring them back somehow I have found a regex that find some of the texts but still its not returning the right result
var newString2 = j.replace(/[a-zA-Z0-9@.,_+]*[^:][\w]/g, function(x){
return '"'+x+'"';
});
my json
{
User_Story_UI_24:
{
Env:Staging,
UserName:[email protected],
Password: User@SDF45sdfg,
Supplier:Xxxxx,
SupplierWebSite:www.xxxx.com,
SupplierPhone:+111 2223334440,
SupplierAddress:sss asf21, asf asf, saf
}
}
the epcepted result
{
"User_Story_UI_24":
{
"Env":"Staging",
"UserName":"[email protected]",
"Password": "User@SDF45sdfg",
"Supplier":"Xxxxx",
"SupplierWebSite":"www.xxxx.com",
"SupplierPhone":"+111 2223334440",
"SupplierAddress":"sss asf21, asf asf, saf"
}
}
User_Story_UI_24should be within single or double quotes, is what I understood