Monday, June 11, 2012

RE: How to find and replace using negative lookahead

Thanks for your answer, I have tried it and it had worked fine.

Best regards,

César V.


Date: Fri, 8 Jun 2012 01:09:02 -0700
From: [hidden email]
To: [hidden email]
Subject: 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



If you reply to this email, your message will be added to the discussion below:
http://vim.1045645.n5.nabble.com/How-to-find-and-replace-using-negative-lookahead-tp5708861p5708863.html
To unsubscribe from How to find and replace using negative lookahead, click here.
NAML


View this message in context: RE: How to find and replace using negative lookahead
Sent from the Vim - General mailing list archive at Nabble.com.

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