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: Mon, 27 Feb 2006 18:44:17 -0600 (CST)

Richard Stallman wrote:

   However, that doesn't necessarily mean the manual is wrong.
   There is more than one way to understand the word "special".
   At the most literal level, ] is not special; if you write it
   without \\, the regexp compiler won't misunderstand it.
   However, it does play a special role in the syntax of regexps,
   and it is not necessarily a bad thing for users to think of it
   as a special character.

It is good for users to think of `]' and `-' as characters that are
special _inside_ the context of a character alternative.  That way
they will not be confused by quotes from the Elisp manual like:

     Note that the usual regexp special characters are not special
     inside a character alternative.  A completely different set of
     characters is special inside character alternatives: `]', `-' and
     `^'.

The special meaning of `]' inside a character alternative is obviously
to close that alternative.  But the Elisp manual currently lists `]',
like `^', but unlike `-' among the characters that also have another
special meaning outside that context.  That is true for `^', but which
other special meaning does `]' have?

Sincerely,

Luc.





reply via email to

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