GNU bug report logs - #2881
23.0.91; inconsistent regexps with "explicitly numbered group"

Previous Next

Package: emacs;

Reported by: Joe Corneli <holtzermann17 <at> gmail.com>

Date: Fri, 3 Apr 2009 19:20:03 UTC

Severity: normal

Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Joe Corneli <holtzermann17 <at> gmail.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 2881 <at> debbugs.gnu.org, emacs-pretest-bug <at> gnu.org
Subject: bug#2881: 23.0.91; inconsistent regexps with "explicitly numbered  group"
Date: Fri, 3 Apr 2009 16:41:39 -0400
What about the comparison between Form 4 and Form 5,
which seems to not only go against the description of `\|'
you quoted, but to contain another internal inconsistency
(whether or not the final `}' is matched)?

On Fri, Apr 3, 2009 at 3:55 PM, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
> Joe Corneli <holtzermann17 <at> gmail.com> writes:
>
>> Please execute the following forms with C-x C-e.  Form 1
>> and Form 3 return `t' (Yes, we are looking at the
>> indicated regular expression), whereas Form 2 returns
>> `nil' (even though from the Elisp reference page "34.3.1.3
>> Backslash Constructs in Regular Expressions", it appears
>> that this form ought to return `t' like the others).
>
>     `\|' applies to the largest possible surrounding expressions.
>     Only a surrounding `\( ... \)' grouping can limit the grouping
>     power of `\|'.
>
>> (let ((possible-environments
>>        "\\(?1:lisp\\)\\|\\(?1:idea\\)\\|\\(?1:common\\)") )
>>       (looking-at
>>             (concat "\n*?\\\\begin{"
>>                     possible-environments
>>                     "}")))
>
>
> The three alternatives of this regexp are "\n*?\\\\begin{\\(?1:lisp\\)",
> "\\(?1:idea\\)" and "\\(?1:common\\)".
>
> Andreas.
>
> --
> Andreas Schwab, schwab <at> linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
>




This bug report was last modified 16 years and 54 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.