Monday, April 4, 2011

Re: Substitute via expression on matched text

Venu Gopal, Tue, Apr 05, 2011 at 12:35:09AM +0530:
> Hi,
> You can use submatch(<number>).
> In your example:
> :%s/\(PP \d\+,\)\(\d\+\)/\=submatch(1).(submatch(2)-120)/
>
> submatch(0) will contain whole string like &.
>
> Thanks
> Venu

Perfect, thanks!

--
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: