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

[Proposal] add "split" function - array[string] split(string $separator, string $subject) #26

Open
morokin opened this issue Apr 4, 2018 · 3 comments

Comments

@morokin
Copy link

morokin commented Apr 4, 2018

Just copy of issue opened by @biochimia: jmespath/jmespath.site#35

I propose the addition of a split() function, counterpart to the already standard join() function. split breaks a string into an array of substrings that are separated by $separator in the original $subject.

(Not entirely unlike Python's string.split() function)

@morokin
Copy link
Author

morokin commented Apr 4, 2018

Personally I also looked for the split function (I'm heavily using jmespath in ansible playbooks). I mean - it's little bit uncomfortable to have join function and not to have split

@morokin morokin changed the title New function: array[string] split(string $separator, string $subject) [Proposal] add "split" function - array[string] split(string $separator, string $subject) Apr 4, 2018
@henning
Copy link

henning commented Jan 28, 2020

Maybe the concrete Python implementation is also not the right place for this issue, as the language specific implementation follows the spec... so the right place for the enhancement wishes is the spec, which has no own repository, but lives in the site? :)

Here or there, I'd also be interested in the feature.

I'd be interested to hear an idea from the project maintainer how we can go about implementing such enhancements ourselves. The issue and pull requests in the project seem to be pretty abandoned.
@jamesls are you still working on the project?

@kekscode
Copy link

We also have an issue with the absence of a string split() function which could transfor a string to a new array of values. We receive a JWT data structure which is parsed in Grafana using JMESPath for role mapping. The groups claim inside the JWT hasn't an array but a character-delimited list of groups like "|group|another|andanother|" and i'd love to have split functionality for these bogus values. I am perfectly aware that it is a problem with the system which sends the token, but i really would like to be able to fix this in-place instead of adding something like a preprocessing proxy.

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

No branches or pull requests

3 participants