You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a similar issue. I would like to have a built-in function that performs a similar to String.prototype.substring() operation.
For given input:
{
"foo": "bar"
}
I would like to run an expression like this:
// in JS the substring has a signature of substring(indexStart, indexEnd).search(...,'foo | substring(0, 1)')// ba.search(...,'foo | substring(0, 2)')// bar.search(...,'foo | substring(0)')// bar.search(...,'foo | substring(1)')// ar
or by using slice expression
.search(...,'foo[0:1]')// ba.search(...,'foo[0:2]')// bar.search(...,'foo[0]')// bar.search(...,'foo[1]')// ar
Activity
darrenmothersele commentedon Nov 9, 2021
Hi, sorry - I don't understand your description of what you are trying to do. Can you give an example (or two) of expected input and expected output?
jarrodek commentedon Jun 4, 2022
I have a similar issue. I would like to have a built-in function that performs a similar to
String.prototype.substring()operation.For given input:
{ "foo": "bar" }I would like to run an expression like this:
or by using slice expression
springcomp commentedon Aug 9, 2022
@zacard-orc we are standardizing a host of string manipulation functions in JMESPath Community. Substrings will be achieved using the existing
slice-expressionsyntax.jpmckinney commentedon Mar 7, 2023
JEP: jmespath/jmespath.jep#5
springcomp commentedon Mar 8, 2023
Yep ! that’s exactly where I took this piece of feedback when brainstorming the list of features to include in the next version of JMESPath. Incidentally, @glenveegee has created an awesome port of JMESPath to TypeScript but this does not seem to be maintained any longer.
So, while preparing a version for JMESPath Community, I am proposing all my changes upstream anyway. I hope to find an official maintainer then.
glenveegee commentedon Mar 16, 2023
@springcomp I'm updating it as we speak. Just been busy.