[lug] vi wildcards

Chip Atkinson catkinson at circadence.com
Thu May 24 09:04:37 MDT 2001


Agreed.

Hugh Brown wrote:

> Alan's trick should be used because of greedy matching.
> 
> This substitue line
> 
> :%s/<SPAN CLASS=".*">//g
> 
> will also match <SPAN CLASS="something"><A HREF="some other
> stuff">
> 
> because it matches all the way up to the very last "> on the line
> 
> Hugh
> 
> 
> "Chip Atkinson"
> 
>> 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
> 
> _______________________________________________
> 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