[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX-devel] A real-life problem...
From: |
Ralf Angeli |
Subject: |
Re: [AUCTeX-devel] A real-life problem... |
Date: |
Tue, 07 Jun 2005 13:29:25 +0200 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) |
* David Kastrup (2005-06-07) writes:
> Ralf Angeli <address@hidden> writes:
>
>> * David Kastrup (2005-06-07) writes:
>>
>>> + "Return number of groups in a regexp. This assumes the following
>>> +heuristic: Any occurrence of the pattern `\\\\([^?]' is an opening group,
>>> +so if you want to have something like `\\\\\\\\(', write it as
>>> `\\\\\\\\[(]'."
>>
>> Hm, probably nobody will think about that when writing a regexp.
>> Couldn't the function recognize such constructs itself and disregard
>> them?
>
> Well, I thought about doing this "right" in every case. And then I
> thought about "[\\(]" and decided that I had no real chance.
>
> Maybe something that will work in more cases is reasonably easy to do
> and not too inefficient. I am not sure it will be worth the trouble,
> but if somebody else is of a different opinion, I don't mind if he
> comes up with something.
What about the following ol' trick?
(string-match "\\(^\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\(" "\\\\(")
As you haven't come up with this I am probably missing something. (c;
--
Ralf