0

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'}

Regex101 Link

'keyValue': ({.+})

PS: Answer acceptance will be done if you will explain the regex.

bobble bubble
  • 16,888
  • 3
  • 27
  • 46
tbhaxor
  • 1,659
  • 2
  • 13
  • 43

0 Answers0