Thanks, this work well.

If I want to replace the second one, I tried to use zero-width, like:
:s/\(saw.*\)\@<=saw/seen/

So I have a problem about zero-width and non-greedy:
Is the regular express of vim is lazy or greedy when use zero-width?

--------------------------------------------------
From: "Sagdullin, Bulat" <bulat_sagdul...@mentor.com>
Sent: Tuesday, August 11, 2009 8:08 PM
To: <vim_use@googlegroups.com>
Subject: RE: Replace Just Needed

> 
>> From: Ricky
>> Sent: Tuesday, August 11, 2009 15:23
>> ---
>> I've never saw a saw saw a saw
>> I just want to replace the 2nd or 3rd "saw", Do you have any idea?
>> 
> Hi Ricky,
> 
> Not beautiful solution to replace 3rd "saw" to "seen":
> s/^\(.\{-}saw.\{-}saw.\{-}\)\(saw\)/\1seen/
> 
> Bulat.
> 
> > 
> 

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to