Hi, Benji
> On Tue, May 23, 2006 at 02:22:32PM +0200, Zdenek Sekera wrote:
> > > >
> > > > if (char =~ '\m[;|<>?:[EMAIL PROTECTED]&*(){}\\_+-[\]/\"]')
> > > > do something
> > > > endif
> > > >
> > > > 2. why when the pattern ends with '+' or '\+' do I get
> > > > an error?
>
> Can you be more specific? I tried
>
> :let char = "a"
> :echo char =~ '\m[;|<>?:[EMAIL PROTECTED]&*(){}\\_+-[\]/\"]+'
> :echo char =~ '\m[;|<>?:[EMAIL PROTECTED]&*(){}\\_+-[\]/\"]\+'
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?
---Zdenek