emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unquoted special characters in regexps


From: Luc Teirlinck
Subject: Re: Unquoted special characters in regexps
Date: Sun, 26 Feb 2006 11:42:03 -0600 (CST)

Martin Rudalics wrote:

    >>Anyway, the first `]' has a special meaning but it's not "inside" the
    >>character alternative.
    >
    >
    > It is part of it, just like the leading '['.

   As a consequence, in your model "[" is a valid regexp too.

What matters is the following.  If you type `[' it has a special
meaning if you type it _outside_ the _context_ of a character
alternative.  Its special meaning there is that it starts that
context.  Inside that special context, `[' has no special meaning.

On the other hand, if you type `]' it has no special meaning _unless_
you are in the _context_ of a character alternative.  Its special
meaning in that context is that it ends that context.

So `[' is special outside the context of a character alternative, but
not inside it, `]' is special inside that context, but not outside.

    > It's a bug in the manual.

   Please fix it.

I plan to do that.  I just want to wait to make sure that Richard agrees.

Sincerely,

Luc.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]