I have data in the following format that is not valid JSON. I am trying to convert it using regex, but the parse won't go through. For more details, refer to this question which I've tried.
The problem lies in the fact that the response string also contains HTML, variables, and trailing commas. Below is the test data that is failing:
`var _nr_metadata = {
site_base_url : "http://newsrack.in",
issue_name : "iihs_feeds",
category_name : "Chikungunya",
listing_url : "/stories/servelots/iihs_feeds/16"
}
var _nr_stories = [
{
title : "Alarm bells ringing:194 dengue cases in 2 weeks in district",
url : "http://www.tribuneindia.com/news/ludhiana/alarm-bells-ringing-194-dengue-cases-in-2-weeks-in-district/486718.html",
source : "The Tribune",
date : "25.10.2017",
desc : "Tribune News Service\nLudhiana, October 24\nThe number of dengue cases is rapidly increasing in the district as 194 confirmed cases have been recorded by the Health Department ..."
},
...
]
The expected output should be a valid JSON for use in the rest of my application. Unfortunately, I do not have control over modifying the server response.