I have a string and I want to get only the JSON object string from the string
Tried to save duplicate unique keys (E11000 duplicate key error collection: test.users index: email_1 dup key: { email: "amit@email.com" }, full error: {'index': 0, 'code': 11000, 'errmsg': 'E11000 duplicate key error collection: test.users index: email_1 dup key: { email: "amit@email.com" }', 'keyPattern': {'email': 1}, 'keyValue': {'email': 'amit@email.com'}})
The regex pattern I am using is giving following result
{'email': 'amit@email.com'}}
I want the following result
{'email': 'amit@email.com'}
'keyValue': ({.+})
PS: Answer acceptance will be done if you will explain the regex.