[lug] vi wildcards

Chip Atkinson catkinson at circadence.com
Thu May 24 08:41:26 MDT 2001


Are you trying to delete all the tags that start with "<SPAN CLASS" and 
end with ">" ?  If so, it looks like you need the . metacharacter.  It 
represents the character generated by the "any" key.  :-)

The patterns you have below will match
<SPAN CLASS="""""""""""""""""""""">
or
<SPAN CLASS=">
or anything with only quotes and a > following the CLASS.  I believe if 
you use
:%s/<SPAN CLASS=".*">//g
that it will work.  Also, 1,$s works as well.  The % is the same as 1,$.
The * is a count qualifier and means match 0 or more of the preceeding 
character.  This is not to be confused with glob matching like you get 
in the shell.  A glob type pattern of  "* would match "abc or """"" , 
where as a regular expression pattern of "* would match """"" but *not* "abc

Chip

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
> 
> Help????
> 
> Thanks,
> 
> John
> 
> 
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug




More information about the LUG mailing list