Feature: Iterate over the capture groups of a match #7
Closed
Description
I'm working on boa-dev/boa#686, and really missing the ability to do something like:
for group in mat.groups() {
// use group
}
I have implemented it with the following struct serving as the iterator:
pub struct Groups<'m> {
mat: &'m Match,
i: usize,
}
The Iterator returns Option<Option<Range>>
( Some(None)
is possible because a capture group might not exist if it is optional).
I'll open a PR soon.
Metadata
Assignees
Labels
No labels