https://kodejava.org/how-do-i-count-the-number-of-capturing-groups/
How do I count the number of capturing groups?