[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Shy groups and * ...eh, what?
From: |
Michael Heerdegen |
Subject: |
Shy groups and * ...eh, what? |
Date: |
Sat, 22 Oct 2022 06:24:39 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hello,
I wanted to be sure I correctly understood that if you give multiple RX
arguments to the `rx' `*' operator, they are implicitly interpreted as a
sequence (AFAIU, that's the case. An implicit `or' would also make
sense, that's why I wondered).
Anyway, here is what I tried:
(string-match-p
(rx bos (* "a" "b") eos)
"a")
==> 0
(string-match-p
(rx bos (* "a" "b") eos)
"b")
==> nil
Eh - what? With evaluated `rx' forms this is
(string-match-p
"\\`\\(?:ab\\)*\\'"
"a")
==> 0
(string-match-p
"\\`\\(?:ab\\)*\\'"
"b")
==> nil
Makes no sense to me. When I change the wrapping shy groups to normal
groups the result makes more sense to me:
(string-match-p
"\\`\\(ab\\)*\\'"
"a")
==> nil
(string-match-p
"\\`\\(ab\\)*\\'"
"b")
==> nil
Do I miss something or is it just a bug?
TIA,
Michael.
- Shy groups and * ...eh, what?,
Michael Heerdegen <=
- Re: Shy groups and * ...eh, what?, Heime, 2022/10/22
- Re: Shy groups and * ...eh, what?, tomas, 2022/10/22
- Re: Shy groups and * ...eh, what?, Michael Heerdegen, 2022/10/22
- Re: Shy groups and * ...eh, what?, tomas, 2022/10/24
- Re: Shy groups and * ...eh, what?, Michael Heerdegen, 2022/10/24
- Re: Shy groups and * ...eh, what?, tomas, 2022/10/25
- Re: Shy groups and * ...eh, what?, Emanuel Berg, 2022/10/25
- Re: Shy groups and * ...eh, what?, Emanuel Berg, 2022/10/25
Re: Shy groups and * ...eh, what?, Heime, 2022/10/22
Re: Shy groups and * ...eh, what?, Michael Heerdegen, 2022/10/22