[Top][All Lists]

[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: Mon, 06 Mar 2006 08:41:33 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> Note how easy this is.  Unlike for, say \\( you do not even have to
> keep track of which `[' matches which `]', because there is no
> nesting.  All you need to keep track of is whether you are inside or
> outside a character alternative.

I do not have any problems matching `[' with `]' when regexps are
written cleanly.  I do have problems when `]', `\]', or `\\]' get mixed
up as in the `gud-jdb-marker-filter' bug.

> You are making things difficult by treating `[' and `]' in regexps as
> if they had the usual open-close parentheses syntax, like \\( and \\).
> They do *not* and that is the cause of all your misunderstandings.  In
> "[1[2]3]" the first `]' closes the first `[' and "balance" makes no
> sense for the other `[' and `]'.  If `[' and `]' had the usual open-close
> parentheses syntax, the 2 would be inside a nested character
> alternative, two levels deep.  But there is no such thing as nested
> character alternatives, because, in regexps, `[' and `]' do not have
> the usual open-close parentheses syntax (unlike, say, in Lisp vectors).

We have been comparing character alternatives with strings.  Elisp
strings don't nest.

reply via email to

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