Issue #14669 has been updated by duerst (Martin Drst).


Can you give a few examples of how this may be used, and explain what's the purpose of getting the number of capture groups before actual matching?

Also, can you show an example what you think the actual interface (e.g. method name) would look like?

On top of that, I think not all Ruby implementations use Onigmo. Some other implementations may not have this feature.

----------------------------------------
Feature #14669: Regexp does not expose the amount of capture groups.
https://bugs.ruby-lang.org/issues/14669#change-71416

* Author: xfbs (Patrick Elsen)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
For a project we needed to know how many capture groups a Regex exposes (before actually matching it). The Onigmo regex library used by Ruby has this information, accessible with *onig_number_of_captures(const regex_t \*)*, but the Ruby Regexp class doesn't expose this information.




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>