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.
eddidn't supported more that 9. Probably because of memory limitations? And that sounds like a cool patch, too bad it wasn't included. – statox Sep 22 '16 at 16:08sed:s/.../.../3would replace only the 3rd occurrence of the pattern. This is probably the feature I miss the most in Vim. – Sato Katsura Sep 22 '16 at 16:18:s//NI think on vim_use a mapping to achieve this was posted several years ago by A Politz – Christian Brabandt Sep 22 '16 at 16:49\%(). – jamessan Sep 22 '16 at 20:06