Match array based on dynamic variable name?
Posted: 10 Sep 2026, 14:52
Similar to the deep regex query from ages ago, but instead of returning a value where the key->value pair is (desired value)->(regex to match) or vice-versa... key = variable name for the value to match, value = what to match it against (so return the matching array).
I have two copies of The Bad News Bears (TV series), the first available was German/PAL, then a US version was released that I also got. The German version has "PAL" as part of the a variable while the USA version has "NTSC." So to distinguish between the two versions automatically, I want to be able to pick a value to match (video[0].colourPrimaries) to see if it has the word "PAL" in it. If so, it returns "German" with array (matching key->value pair).
The arrangement I'm looking to use is...
Obviously it would only try to find matches based on the content (IMDb, TMDb, TVDb). The part I need help with is using the key for the variable to use.
I come up with some interesting concepts/ideas, don't I?
I have two copies of The Bad News Bears (TV series), the first available was German/PAL, then a US version was released that I also got. The German version has "PAL" as part of the a variable while the USA version has "NTSC." So to distinguish between the two versions automatically, I want to be able to pick a value to match (video[0].colourPrimaries) to see if it has the word "PAL" in it. If so, it returns "German" with array (matching key->value pair).
The arrangement I'm looking to use is...
Groovy: Select all
"editions":[
"tt0078566":[
"German":[ "video[0].colourPrimaries": "/PAL/" ],
],
],
I come up with some interesting concepts/ideas, don't I?