Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow filter keys with a regex match #59

Merged
merged 6 commits into from
Aug 18, 2022
Merged

Allow filter keys with a regex match #59

merged 6 commits into from
Aug 18, 2022

Conversation

drugan
Copy link

@drugan drugan commented Jun 30, 2022

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

@Galbar
Copy link
Owner

Galbar commented Jul 26, 2022

Hello @drugan, thanks for the pull request! Sorry for the delay 😅

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!

@drugan
Copy link
Author

drugan commented Jul 26, 2022

Hi @Galbar,

Yes, I do it as soon as possible.

@drugan
Copy link
Author

drugan commented Aug 2, 2022

@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

Copy link
Owner

@Galbar Galbar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I added a small change suggestion for the documentation.

I'll try it and run the tests (nice job, btw!) some time this week and if all goes well I'll merge it afterwards (and make a new release shortly after).

Cheers!

@Galbar Galbar merged commit 2cb34e8 into Galbar:master Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants