Ingo Karkat wrote:
> >> Alternatively, couldn't something starting with a backslash be used,
> >> for example \{99}?
> >
> > That's already used. We could use \%99g, where "g" stands for group.
>
> Ah yes, I (and probably the OP with his proposed ${N} syntax) forgot that the
> capturing group can also be referenced in the regexp itself, not just in the
> replacement part.
>
> I would also prefer Tom Link's suggestion of named matching groups. \g<name>
> could be used for that, like Ruby 1.9 does.
That also requires defining the group with a name. A bit verbose but
useful. Perhaps:
\%{name}(re) define a named group
\%{name}g refer to a named group
\%99g refer to a numbered group
If we have the named gorup use up a number, then it's easy to
implemented, converting the name to the number is done at compile time.
--
He who laughs last, thinks slowest.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php