[Api-addition] Regex group should provide a Name property.#1384
[Api-addition] Regex group should provide a Name property.#1384Priya91 merged 2 commits intodotnet:futurefrom
Conversation
There was a problem hiding this comment.
I would make this field readonly. The same for the _caps/_capcount fields.
There was a problem hiding this comment.
Yes, will make _name and _caps readonly. _capcount is set in Match, which derives from Group.
|
Beyond the couple of comments it looks good to me. |
There was a problem hiding this comment.
are we always going to have "0" name for the group with no specified name? what we used to return from GetGroupNames before this change?
There was a problem hiding this comment.
No, for the unspecified names, we return the index of the numbered group in the regex, as in 0,1,2. Here this Match constructor is used for initilaizing the objects, the base Group constructor, is passing 0 (number of captures), new int[2] for the start and len of the default capture, text = the whole text, hence passing "0" the default group number for the whole successful capture.
|
@weshaggard @tarekgh : Thanks for the review. Merging this. |
[Api-addition] Regex group should provide a Name property.
API review was done internally. closes #1051
cc @tarekgh @terrajobst @joshfree