A vi question

stan stanb at panix.com
Tue Sep 8 19:59:49 UTC 2009


On Tue, Sep 08, 2009 at 03:20:06PM -0400, Brian McKee wrote:
> On Tue, Sep 8, 2009 at 2:35 PM, stan<stanb at panix.com> wrote:
> > vi is a continuing learning experinece :-)
> Until the day I die I expect :-)
> 
> > :.,$s/^*OTE/OTE/
> > But * is not the appropriate wildcard here in vi.
> As Rashkae pointed out - .*  not just *
> 
> But your data had TWO 'OTE' strings in it.
> Do you need the first one or the last one?  As shown it's the last one
> you'll get.
> If you want only up to the first one (non-greedy) try
> :.,$s/^.\{-}OTE/OTE/
> 
OH cool tht helps, thanks.

What does the \{-} syntax mean?


-- 
One of the main causes of the fall of the roman empire was that, lacking
zero, they had no way to indicate successful termination of their C
programs.




More information about the ubuntu-users mailing list