Closed
Description
I've looked at some of the previous discussions around returning multiple matches of the same named capture in repetitions, and I agree that allowing that raises many questions around the right way.
However, a case I'm looking at is allowing duplicate named captures when they're clearly exclusive. Do you think it would make sense to allow duplicates in case like below?
Regex::new(r"r#(?P<name>.*?)#|(?P<name>\w+)")
Currently retrieving such alternate matches requires multiple name bindings and then checking which one succeeded, or separating regexp into two matches, but it seems that there is no ambiguity in case with alternation so duplicate names could be allowed as-is?
Metadata
Metadata
Assignees
Labels
No labels