-
Notifications
You must be signed in to change notification settings - Fork 5
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
support regular expression ?? #23
Comments
I don't think regular expressions should be part of the core JMESPath syntax because different programming languages have different regular expression implementations, so it wouldn't be possible to guarantee that a regular expression run using JMESPath on Python would have the exact same results on PHP or Ruby or Lua or Go. Instead I suggest writing your own custom function that makes Python regular expressions available to your code: https://github.com/jmespath/jmespath.py/blob/0.10.0/README.rst#custom-functions |
I completely disagree with this assertion. Though many languages do indeed have different implementations, I estimate 99.999% of them use a PCRE library/implementation for regexes as PCRE has become the defacto standard for regular expressions. Moreover, if every language used the rationale to defer to implement regular expressions because other languages do it differently then no language would implement them. I find myself deferring to |
I'd be in huge support for adding regex support! |
There's a useful comparison table of the differences between different language implementations here: https://web.archive.org/web/20130830063653/http://www.regular-expressions.info:80/refflavors.html |
Tests are here: https://github.com/jmespath/jmespath.test/tree/master/tests This approach could be used to add regular expression support, by spinning up a thorough compliance test and maybe defining a subset of regular expression syntax that must be supported in order for an implementation to pass the test. It would be a lot of work though! |
Here's a really interesting proposal, for an interoperable subset of regular expressions: https://cabo.github.io/iregexp/draft-bormann-jsonpath-iregexp.html It's still in early stages, but it looks like it's directly relevant to this conversation. |
+1 vote for regex support! |
e.g.
The text was updated successfully, but these errors were encountered: