GNU bug report logs - #58726
29.0.50; Bug in regexp matching with shy groups

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Sun, 23 Oct 2022 01:42:02 UTC

Severity: normal

Found in version 29.0.50

Done: Mattias EngdegÄrd <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Subject: bug#58726: closed (Re: 29.0.50; Bug in regexp matching with shy
 groups)
Date: Mon, 24 Oct 2022 11:29:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#58726: 29.0.50; Bug in regexp matching with shy groups

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 58726 <at> debbugs.gnu.org.

-- 
58726: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58726
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Mattias EngdegÄrd <mattiase <at> acm.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 58726-done <at> debbugs.gnu.org
Subject: Re: 29.0.50; Bug in regexp matching with shy groups
Date: Mon, 24 Oct 2022 13:28:27 +0200
24 okt. 2022 kl. 13.17 skrev Michael Heerdegen <michael_heerdegen <at> web.de>:

> Ok, thanks.  Can we close this one?

Of course, done.

> I'm sorry to tell you, but you messed up the example in the
> commit message (that one evals to 1).

Oh dear, sorry about that! At least there is a reference to this bug in case someone wonders.


[Message part 3 (message/rfc822, inline)]
From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; Bug in regexp matching with shy groups
Date: Sun, 23 Oct 2022 03:41:25 +0200
Hello,

  (string-match-p "\\`\\(?:ab\\)*\\'" "a") ==> 0

That's wrong, the expected result is nil.  The language matched by that
regexp is {"", "ab", "abab", "ababab", ...}.

Changing to a non-shy group doesn't exploit the issue:

  (string-match-p "\\`\\(ab\\)*\\'" "a")  ==> nil

as expected.

I've been told (emacs-help, Bruno Barbier) that the problem exists at
least in emacs 27, emacs 28 and emacs 29.


TIA,

Michael.





This bug report was last modified 2 years and 213 days ago.

Previous Next


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