Here is a regexp:
the right group number will be:
but in regexper:
Changing when subexpression numbers are generated
Generating subexp numbers during setup was leading to nested expressions
being numbered in reverse order.
This bug actually went back to some rework I did before the site was even launched (it was caused by e362a54 for the curious). I'm amazed it has been around this long.
Thank you very much for catching and reporting it!