From :h E65
we can see that Vim doesn't allow more than 9 capture groups in a substitution command.
For example the following command will work:
s/\v(a)(b)(c)(d)(e)(f)(g)(h)(i)/\9\8\7\6\5\4\3\2\1
But this one with one more capture group will fail:
s/\v(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)/\10\9\8\7\6\5\4\3\2\1
My question is not about why it fails (it's a Vim hard limit) but about why does Vim have this limit at all?
Also, I'm aware that a real life regex with more than 9 capture group would probably be pretty monstrous to read and to maintain but I'm still curious.
sed
:s/.../.../3
would replace only the 3rd occurrence of the pattern. This is probably the feature I miss the most in Vim.\%()
.