Subject: bug#58726: closed (Re: 29.0.50; Bug in regexp matching with shy groups)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 24 Oct 2022 11:29:02 +0000

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 [email-masked].

-- 
58726: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58726
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: 29.0.50; Bug in regexp matching with shy groups
From: Mattias Engdegård <[email-masked]>
To: Michael Heerdegen <[email-masked]>
Cc: [email-masked]
Date: Mon, 24 Oct 2022 13:28:27 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

24 okt. 2022 kl. 13.17 skrev Michael Heerdegen <[email-masked]>:

> 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.

Subject: 29.0.50; Bug in regexp matching with shy groups
From: Michael Heerdegen <[email-masked]>
To: [email-masked]
Date: Sun, 23 Oct 2022 03:41:25 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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.