I've got a nested json and I would like to find a substring in any pair's value. The results should be the pair's name or None or similar if not found at all. So for example let's assume that I am looking for the substring "met"
. Then for:
{
"a": "example",
{
"b": "another example",
"c": "something else"
}
}
result should be "c"
(as "met"
is found in "something else"
)
and for:
{
"a": "example",
{
"b": "another example",
"c": "yet another one"
}
}
the result should be None
as no met
is found.
I have no additional information about json.
How to do it in the most efficient way?