Hi,

Tim Chase wrote:
> > >   :%s/\<[a-z]\+\>//gI
> > another option is to include \C in the regular expression itself:
> >
> >     :%s/\C\<[a-z]\+\>//g
> 
> One should be careful about this, as the help states:
> 
> :help /\C
> 
> 
>       Note that 'ignorecase', "\c" and "\C" are not
>       used for the character classes.

this means that \u always matches uppercase characters regardless of
whether ignorecase is set or not. \c is (at least in this case)
equivalent to setting ignorecase before search -- \u still matches
only uppercase letters. Because \C is used to make a pattern independent
of the current value of ignorecase, \u does not change when used with
\C either.

> And when you look up
> 
>       :help /character-class
> 
> it shows you what's considered a character class.  I don't know 
> if the [...] notation is considered a character-class or not, but 
> the \u \l etc are listed there.

[...] is not considered a character class but a collection. As such it
behaves differently depending on the current value of ignorecase. If
set [A-Z] matches lowercase letters, too, as is the case when \c is
included in the search pattern.

Regards,
Jürgen

-- 
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

Reply via email to