JSONPath (RFC 9535)
$ is the root. .name or ['name'] picks a member, [0] an array element, [-1] the last one.
* selects every child. ..name searches at any depth.
[1:3] slices, with an optional step: [::2], [::-1]. [0,2] and ['a','b'] are unions.
- Filters:
[?@.price < 10 && @.stock]. @ is the current element. Comparisons are == != < <= > >=. A bare query such as @.isbn tests that it exists. ! negates.
- Functions:
length(@.tags), count(@..x), match(@.name, 'A.*') (whole string), search(@.name, 'son') (anywhere), value(...).
Each match is shown with its normalized path, for example $['store']['books'][0]. Regular expressions use JavaScript syntax here, which is close to the I-Regexp subset the RFC asks for.
jq subset
Supported: . .a.b .["a"] .[0] .[] .[1:3] .., pipes |, commas, ?, array and object construction ([...], {a, b: .c}), if/elif/else/end, //, comparison, and or not, + - * / % and string interpolation "\(.a)".
Not supported: variables (as $x), reduce, foreach, def, assignment, limit beyond the basic form, date functions and modules. Programs that run too long are stopped after 200,000 steps.