Skip to content

How do I get the name for each capture group when using Captures::iter? #1268

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

You must be logged in to vote

In the future, please provide an MRE.

It looks like you should be able to just do for (name, m) in regex.capture_names().zip(c.iter()) { via Regex::capture_names.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tisonkun
Comment options

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
Converted from issue

This discussion was converted from issue #1267 on May 19, 2025 15:40.