* David Kastrup (2005-06-07) writes:
> Ralf Angeli <[EMAIL PROTECTED]> 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
_______________________________________________
auctex-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/auctex-devel