> -----Original Message----- > From: Charles E Campbell Jr [mailto:[EMAIL PROTECTED] > Sent: 24 May 2006 15:55 > To: Zdenek Sekera > Cc: vim-dev@vim.org > Subject: Re: Pattern questions > > Zdenek Sekera wrote: > > >Sorry, I should have been clearer: > > > >Note the placement of the '+' in my pattern, somewhere > >in the middle, there it doesn't cause any problem: > > > >if (char =~ '\m[;|<>?:[EMAIL PROTECTED]&*(){}\\_+-[\]/\"]' > > ^ > > | here > > > >The erroneous (in my judgement) patterns are (e.g.) are these: > > > >if (char =~ '\m[;|<>?:[EMAIL PROTECTED]&*(){}\\_-[\]/\"+]') > >if (char =~ '\m[;|<>?:[EMAIL PROTECTED]&*(){}\\_-[\]/\"\+]') > > > >So the question is why is it OK to have '+' in the middle > >and not at the end? > > > > > > It has nothing to do with +, and everything to do with - . > The "-" is a > range character, > more commonly seen with something like [a-z] (which stands > for all lower > case characters). > You need to escape the minus sign (ie. \-).
Ooooops, I missed that one. Obvious! Thanks. ---Zdenek