-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 Regex#capture_count #9746
Add Regex#capture_count #9746
Conversation
25adb23
to
6173422
Compare
Why is this needed? |
@asterite It's needed in cases where you need to introspect the given regex, say for generating default values for all/some of the capture groups. Obviously not a very commonly used feature, but nevertheless practical and complementary to above-mentioned |
Thanks! I was just curious because it's not there in Ruby, so I wonder how people managed to workaround that. |
Can this get a 2nd approval? |
What is this in Ruby? |
@asterite I don't there is a such thing. |
Possibly because Ruby uses oniguruma EDIT: Seems this is closest to onig_number_of_captures ? |
Thanks @Sija |
Adds missing method counterpart to
Regex#name_table
.