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: Tue, 28 Feb 2006 16:57:52 -0600 (CST)

Martin Rudalics wrote:

   It would be strange to say, for example, that the double-quote
   opening an Elisp string is outside the context of the string and
   the double-quote that closes it inside.

I do not see why you consider this strange.  Quite to the contrary,
this is exactly what allows one to determine whether a `"' opens or
closes a string.  `"" is special both inside and outside the context
of a string.  But its special meaning depends on that context.
Outside the context of a string `"' starts a string, inside the
context of a string, `"' ends a string.  So an opening `"' is opening
_because_ it occurs outside of a string context and the closing `"' is
the closing one _because_ it occurs inside a string context.

Note that the GNU regexp manual, node `(regex)List Operators' agrees
with Andreas and me that `[' is special _outside_ a character alternative
(by stating that it is ordinary inside one) and explicitly states that
`]' has the special meaning of closing a character alternative
_inside_ a character alternative.  (Note that it refers to character
alternatives as "lists".)

Sincerely,

Luc.





reply via email to

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