3 ms·
I believe like this. $[?(@.name =~ /[^_].*/)]
by ahoka 3y ago
I believe like this.
$[?(@.name =~ /[^_].*/)]
- mdaniel 3y agoInteresting, I only knew about <https://goessner.net/articles/JsonPath/index.html https://goessner.net/articles/JsonPath/index.html> which makes no reference to =~ nor any such // syntax but it seems there's an IETF draft that is (a) an actual specification (b) includes more modern stuff like what you used: https://www.ietf.org/archive/id/draft-ietf-jsonpath-base-07.html#section-3.5.5.1-14 https://www.ietf.org/archive/id/draft-ietf-jsonpath-base-07.... And, while whatever is powering https://jsonpath.com/ https://jsonpath.com/ does honor your syntax, albeit with an absolutely useless result: [ { "name": -1 }, { "name": -1 }, { "name": -1 } ] I found that `pip install jsonpath-ng` does not accept it nor mention it <https://github.com/h2non/jsonpath-ng/tree/v1.5.3?tab=readme-ov-file#extensions https://github.com/h2non/jsonpath-ng/tree/v1.5.3?tab=readme-...> so I think it's out on the bleeding edge or something