JsonPath-PHP
JsonPath-PHP copied to clipboard
Allow filter keys with a regex match
Allows to apply a regular expression on a key instead of value. So you can get area only of the room entries of the house:
$.house[?(/roo.*/)][area]
https://extendsclass.com/jsonpath-tester.html
Hello @drugan, thanks for the pull request! Sorry for the delay :sweat_smile:
It looks great!
Could you add at least one test case for it and add it to the JsonPath Language
section in the readme?
With that in place I'll merge this and we can have this feature in a release!
Hi @Galbar,
Yes, I do it as soon as possible.
@Galbar
Done. I've also added the PCRE i and x modifiers which makes writing regex patterns a little easier:
https://www.php.net/manual/en/reference.pcre.pattern.modifiers.php