i'm using node.js. i have a python dictionary returned from elasticsearch log:
{'name': 'dan',
'age': 38,
'color': 'green',
'hobbies': None,
'message': 'this message has quotes in it \' so i cannot replace all single quotes',
'happy': True}
how can i parse this in javascript? i have tried this regex solver but he could not deal with the True/False or None values, and kinda looks funky:
const regex = /('(?=(,\s*')))|('(?=:))|((?<=([:,]\s*))')|((?<={)')|('(?=}))/g;
str = str.replace(regex, '"');
str = JSON.parse(str);
any ideas would be very helpful. Thanks!