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

regular expression support #64

Open
suntong opened this issue Dec 24, 2021 · 3 comments · Fixed by go-jsonfile/go-jmespath#1
Open

regular expression support #64

suntong opened this issue Dec 24, 2021 · 3 comments · Fixed by go-jsonfile/go-jmespath#1

Comments

@suntong
Copy link

suntong commented Dec 24, 2021

Following up on jmespath/jmespath.jep#23

different programming languages have different regular expression implementations

Fine, but how about providing a regular expressions function among the Built-in Functions.
The regular expressions will be Go specific, but that's much better than not having any regular expression support, for jp at least.

@suntong
Copy link
Author

suntong commented Dec 24, 2021

I don't mind giving it a try if it can be accepted.

@suntong
Copy link
Author

suntong commented Dec 25, 2021

Fixed in #65

    {
      "expression": "matches('This and these', 't(his|h[eo]se)')",
      "result": true
    },
    {
      "expression": "matches('Those people', 't(his|h[eo]se)')",
      "result": false
    },
    {
      "expression": "matches('THOSE people', '(?i)t(his|h[eo]se)')",
      "result": true
    },

@suntong
Copy link
Author

suntong commented Dec 25, 2021

jp v0.2.2 released -- added matches for regular expression support. See
https://github.com/go-jsonfile/jp/releases/tag/v0.2.2

image

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 a pull request may close this issue.

1 participant