[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What is wrong with a regex?
From: |
Leonid Isaev (ifax) |
Subject: |
Re: What is wrong with a regex? |
Date: |
Sat, 4 Feb 2023 05:11:44 +0000 |
User-agent: |
Mutt/1.13.4 (2020-02-15) |
On Fri, Feb 03, 2023 at 10:10:40PM -0600, Peng Yu wrote:
> That would be a syntax error as the return status 2 indicates.
> $ f=row.txt; [[ $f =~ ^row([0-9]*)(|_x)[.]txt$ ]]; echo $?
> 2
-----8<-----
I-orca--05:07-~-> f="row.txt"; [[ "$f" =~ ^row([0-9]*)(|_x)[.]txt$ ]]; echo $?;
echo -E "${BASH_REMATCH[@]}"
0
row.txt
----->8-----
How did you get 2? Is this a new feature in bash? I get the above result in
bash 5.0.16(1)-release (ArchLinux) and 4.4.20(1)-release (AlmaLinux 8).
--
Leonid Isaev
- Re: What is wrong with a regex?, (continued)
- 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, 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) <=
- 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
Re: What is wrong with a regex?, alex xmb ratchev, 2023/02/06