help-bash
[Top][All Lists]
Advanced

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

Re: What is wrong with a regex?


From: Koichi Murase
Subject: Re: What is wrong with a regex?
Date: Sat, 4 Feb 2023 14:43:59 +0900

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.



reply via email to

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