[lug] vi wildcards

Hugh Brown hugh at vecna.com
Thu May 24 08:39:21 MDT 2001


Just as an aside, if you want to do something on the whole file you can do
:%s/blah//g

instead of :1,$s/blah//g

Hugh


"Alan Robertson"
> 
> John Starkey wrote:
> > 
> > I'm trying to delete about 500 SPAN tags in a document I have to code
> > using vi. All of them include a css class. Can someone tell me how to use
> > wildcards in a :s statement?
> > 
> > I've tried:
> > 
> > :1,$s/<SPAN CLASS=\"*\">//g
> > :1,$a/<SPAN CLASS=\"\*\">//g\\
> 
> :g/SPAN/s/<SPAN CLASS=[^>]*>//g
> 
> This will delete only up to the *first*  > on the line, so if there are
> other tags on the line, they won't all get eaten up...
> 
> 
> 	-- Alan [who cut his teeth on 'ed' ] Robertson
> 	   alanr at unix.sh



More information about the LUG mailing list