A vi question

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


On Tue, Sep 08, 2009 at 02:47:23PM -0400, Rashkae wrote:
> stan wrote:
> 
> > I was thinking that I needed something like:
> > 
> > :.,$s/^*OTE/OTE/
> > 
> > But * is not the appropriate wildcard here in vi.
> > 
> > Any sugestions?
> > 
> 
> 
> I don't know vi, so might be misinterpretting some of it's quirks/features.
> 
> However, strictly from a standard expression POV, you need .* rather than *
> 
> (. is the regular expression for any character.  * indicates that it
> will match any number of .)
> 
> So try: :.,$s/^.*OTE/OTE/

That was it. Thanks.

One more tool in my arsenel :-)

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