[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What is wrong with a regex?
From: |
Leonid Isaev |
Subject: |
Re: What is wrong with a regex? |
Date: |
Sat, 4 Feb 2023 15:11:50 +0000 |
User-agent: |
Mutt/1.13.4 (2020-02-15) |
On Sat, Feb 04, 2023 at 02:20:20PM +0900, Koichi Murase wrote:
> Bash relies on the system library <regex.h> for the regular
> expressions, so I guess the Bash version is not so much related to
> this behavior difference.
Thanks for the explanation.
> I also checked the behavior of Cygwin, where <regex.h> seems to be
> implemented as a part of Newlib. Newlib <regex.h> also seems to
> support an empty <ERE_branch> and thus (|_x).
FYI, on Alpine (musl libc), bash also supports empty regex branch:
-----8<-----
alp-gofax:~$ bash --version
GNU bash, version 5.2.9(1)-release (x86_64-alpine-linux-musl)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
alp-gofax:~$ ldd /bin/bash
/lib/ld-musl-x86_64.so.1 (0x7f39944cd000)
libreadline.so.8 => /usr/lib/libreadline.so.8 (0x7f39943b3000)
libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f39944cd000)
libncursesw.so.6 => /usr/lib/libncursesw.so.6 (0x7f3994356000)
alp-gofax:~$ f="row.txt"; [[ "$f" =~ ^r(|o)w ]]; echo "$?"; printf "%s|"
"${BASH_REMATCH[@]}"; echo
0
row|o|
----->8-----
--
Leonid Isaev
- What is wrong with a regex?, Peng Yu, 2023/02/03
- Re: What is wrong with a regex?, Koichi Murase, 2023/02/03
- Re: What is wrong with a regex?, Dennis Williamson, 2023/02/03
- Re: What is wrong with a regex?, Leonid Isaev, 2023/02/04
- Re: What is wrong with a regex?, Koichi Murase, 2023/02/04
- Re: What is wrong with a regex?, Koichi Murase, 2023/02/04
- Re: What is wrong with a regex?, Jeffrey Walton, 2023/02/04
- Re: What is wrong with a regex?, Koichi Murase, 2023/02/04
- Re: What is wrong with a regex?,
Leonid Isaev <=
Re: What is wrong with a regex?, Peng Yu, 2023/02/03
- Re: What is wrong with a regex?, Koichi Murase, 2023/02/03
- Re: What is wrong with a regex?, Leonid Isaev (ifax), 2023/02/04
- Re: What is wrong with a regex?, Peng Yu, 2023/02/04
- Re: What is wrong with a regex?, alex xmb ratchev, 2023/02/04
- Re: What is wrong with a regex?, Kerin Millar, 2023/02/04
- Re: What is wrong with a regex?, alex xmb ratchev, 2023/02/04
Re: What is wrong with a regex?, Chet Ramey, 2023/02/06
Re: What is wrong with a regex?, alex xmb ratchev, 2023/02/06
Re: What is wrong with a regex?, Chet Ramey, 2023/02/06