Clarifies capturing properties of square brackets in regex #2286
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Also clarifies how round brackets work in name capture.
Also take the mystery out of what we are going to see in subrules.
The problem
named capture using non-capturing group confusion #1634
Also looked like a little further clarity could be added to the way brackets work for capturing.
Solution provided
Refer to 'default' of square brackets not capturing and then highlight that it is a change to default behaviour that they capture when named. Didn't want to use round brackets in the example as think it's advisable myself (though not imperative) to use square brackets in named groupings. Highlighted that you can use round brackets in the example though.
Added a line mentioning named regexes as this is what the subrules link goes on to talk about, but no harm mentioning it here.