In Python one can find the number of capture groups in a regular expression after compiling it:
Pattern.groups: the number of capturing groups in the pattern
Is there any equivalent to this for JavaScript e.g. if I'd expect number of capture groups in /(\w+)-(\w+)/g to be 2