Friday, June 8, 2012

Re: How to find and replace using negative lookahead

On Friday, June 8, 2012 5:12:34 PM UTC+12, César Valencia wrote:
> But, when I try to do the substitution with
>
> :%s/K Value=\(0000\)\@!/K Value=1300/gc

You're not matching the value you want to replace. Just add something to match the digits, say \d\d\d\d. The \@! negative look ahead is zero width.

:%s/K Value=\(0000\)\@!\d\d\d\d/K Value=1300/gc

Regards, John

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