help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shy groups and * ...eh, what?


From: Bruno Barbier
Subject: Re: Shy groups and * ...eh, what?
Date: Sat, 22 Oct 2022 13:12:14 +0200

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Hello again,
>
> thanks for answers so far.  We may want to improve that aspect in the
> docstring of `rx' - but note that the more important question was about
> why "\\`\\(?:ab\\)*\\'" matches "a" - that looks like a bug to me.
>

Looks like a real bug to me too, when using shy groups: it should match
the whole "ab" or nothing, like it does when using implicit or explicit
groups.


And if you request exactly one "a", "a" doesn't match anymore ...

(string-match-p "\\`\\(?:a\\{1\\}b\\)*\\'" "a")
=> nil

I'm getting the same results with emacs 27, emacs 28 and emacs 29.

Shouldn't you use a more alarming title ?

Bruno
















reply via email to

[Prev in Thread] Current Thread [Next in Thread]