Wednesday, December 26, 2012

Re: How to use %03d on existing data

Hi stosss!

On Mi, 26 Dez 2012, stosss wrote:

> What exactly is submatch(0) and submatch(1)? Obviously the 0 and 1
> mean something but I am not sure what. I understand what :help
> submatch is doing but not totally sure how. Apparently that is where
> the 0 and 1 come into play. How can I know what number needs to be in
> the ()

submatch(0) returns the complete pattern match you used in your :s
command (e.g. the same thing, & returns on the right side of an :s
command, while submatch(1) returns the first captured group within the
pattern.


regards,
Christian
--
Wer unter Toren schweigt, läßt Vernunft, wer unter Vernünftigen
schweigt, Torheit vermuten.
-- Ernst von Feuchtersleben

--
You received this message from the "vim_use" 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

No comments: