Well, I found string.match_indices() but that gives me positions instead, and although I could use that It seems like I might have to write my own function.
This StackOverflow answer has an example of how to do it with match_indices; the only change necessary would be to replace the |c: char| closure with the character slice.