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.