[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What is wrong with a regex?
From: |
Jeffrey Walton |
Subject: |
Re: What is wrong with a regex? |
Date: |
Sat, 4 Feb 2023 01:10:09 -0500 |
On Sat, Feb 4, 2023 at 12:45 AM Koichi Murase <myoga.murase@gmail.com> wrote:
>
> 2023年2月4日(土) 14:20 Koichi Murase <myoga.murase@gmail.com>:
> > From POSIX XCU 9.5.3
>
> Sorry, it's not XCU 9.5.3, but XBD 9.5.3.
>
> ----
>
> I also tried other systems.
>
> * Solaris doesn't support `(|x)' but seems to successfully compile the
> regular expression and later fails on the tests. [[ oo =~ (|o) ]]
> returns 1. The system grep doesn't support -E, but grep '\(\|o\)' <<<
> foo returns 1. The conforming /usr/xpg4/bin/grep supports -E and it
> returns 1.
>
> * FreeBSD, OpenBSD, and Minix do not support `(|x)' and return 2 for
> both grep and [[ ]]. grep outputs an error message "grep: empty
> (sub)expression". This is consistent with the report from Dennis.
>
> * Void Linux adopts the musl libc as its default C library. In this
> system [[ oo =~ (|o) ]] seems to return 1. On the other hand, grep in
> Void Linux is GNU grep and succeeds with the empty subexpression.
You might also try the test on Linux after setting the POSIXLY_CORRECT
environmental variable. It may make GNU gear more conformant. I think
you can also start bash with --posix option.
Also see https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html
.
Jeff
- 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 <=
- Re: What is wrong with a regex?, Koichi Murase, 2023/02/04
- Re: What is wrong with a regex?, Leonid Isaev, 2023/02/04
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