I have a file the contents of which are formatted as follows:
{
"title": "This is a test }",
"date": "2017-11-16T20:47:16+00:00"
}
This is a test }
I'd like to extract just the JSON heading via regex (which I think is the most sensible approach here). However, in the future the JSON might change, (e.g. it might have extra fields added, or the current fields could change), so I'd like to keep the regex flexible. I have tried with the solution suggested here, however, that seems a bit too simplistic for my use case: in fact, the above "tricks" the regex, as shown in this regex101.com example.
Since my knowledge of regex is not that advanced, I'd like to know whether there's a regex approach that is able to cover my use case.
Thank you!