Skip to content

How do I get all the matches in repeat capture group? #1269

Answered by BurntSushi
tisonkun asked this question in Q&A
Discussion options

You must be logged in to vote

You can't. I'm not sure why you would expect that. Most regex engines don't let you access repeated matches of a capture group within one single overall match. The regex crate does not allow it. It doesn't track the state necessary for such a thing.

You need to change your regex pattern or use additional regexes.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by BurntSushi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants