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
Essentially, it's re-seq, but on each match, you get a vector of maps, not strings; the maps identify where in the input string the pattern group matched.
So if there's interest, I'm quite happy to add docs and tests and submit as a PR.
The text was updated successfully, but these errors were encountered:
Thanks for the proposal. So if I understand this correctly, this provides the information you'd get from re-seq, but with the start and end positions of each match?
Yes, that's it. It's like re-seq, but instead of internally calling re-groups (returning a string or vector of strings) for each match, we return a map (or vector of maps) that identifies the matched string, and the input string with start and end points.
In Advent of Code there was a problem where you were parsing digits from an input line and needed to know where on the line the matched digits were. This utility made that easy, and let the regular expression executor do the ugly work (such as keeping track of the start position of the match).
For Advent of Code I found I needed a function I'm calling
re-find-groups-seq
:Essentially, it's re-seq, but on each match, you get a vector of maps, not strings; the maps identify where in the input string the pattern group matched.
So if there's interest, I'm quite happy to add docs and tests and submit as a PR.
The text was updated successfully, but these errors were encountered: