I want to obfuscate values in JSON string using regex.
JSON String:
{
"filter" : {
"_id": {
"$oid" : "5f197831618f147e681d9410"
},
"name": "John Doe",
"age": 3
}
}
Expected Obfuscation in JSON String:
{
"filter" : {
"_id": {
"$oid" : "xxx"
},
"name": "xxx",
"age": "xxx"
}
}
How can I do this with Regex?
JSONand the availableObjectandArraymethods?