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: Mattias Engdegård <mattiase <at> acm.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#58726: closed (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 message dated Mon, 24 Oct 2022 13:28:27 +0200
with message-id <222F93C2-0747-4A6F-AE84-E943D6FD5955 <at> acm.org>
and subject line Re: 29.0.50; Bug in regexp matching with shy groups
has caused the debbugs.gnu.org bug report #58726,
regarding 29.0.50; Bug in regexp matching with shy groups
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> 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: 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.




[Message part 3 (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.



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.