-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add feature for disabling capturing groups #15
Comments
Could non-capturing groups be made the default, with the option working as opt-in rather than opt-out? The principle of least power applies here IMO. |
I thought about making capturing groups the default because they produce less visual clutter than non-capturing groups. I will make a final decision about this later but your argumentation is definitely a valid one. |
@waldyrious FYI: I've decided to make non-capturing groups the default and to enable capturing groups with an optional flag. I know that this will break backwards compatibility a little bit if someone relies already on capturing groups in their code. However, this is the more reasonable design and the principle of least power makes sense here as well. So this is it. Closed. |
Great to hear! Thanks for the update. |
grex produces regular expressions with capturing groups by default. Some users might prefer to create regexes with non-capturing groups instead, so I will add a new library method and a new command-line flag for handling this use case.
The text was updated successfully, but these errors were encountered: