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: martin rudalics
Subject: Re: Unquoted special characters in regexps
Date: Sun, 26 Feb 2006 20:06:45 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> 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.

In mathematics `(3 + 4' is a silly expression just like `3 + 4)'.  In
Lisp `(+ 3 4' is invalid just like `+ 3 4)'.  A regular expression
interpretation machine shouldn't handle expressions differently.

By the way try to evaluate

(regexp-opt (list "foo]" "bar]"))

You want to patch `regexp-opt.el' too?






reply via email to

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