[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What is wrong with a regex?
From: |
alex xmb ratchev |
Subject: |
Re: What is wrong with a regex? |
Date: |
Sun, 5 Feb 2023 03:29:21 +0100 |
On Sun, Feb 5, 2023, 3:00 AM Peng Yu <pengyu.ut@gmail.com> wrote:
> On 2/3/23, Leonid Isaev (ifax) <leonid.isaev@ifax.com> wrote:
> > 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).
>
> $ bash --version
> GNU bash, version 5.1.8(1)-release (x86_64-apple-darwin20.3.0)
> Copyright (C) 2020 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <
> http://gnu.org/licenses/gpl.html>
>
shouldnt that say 2022 / 2023
>
> This is free software; you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
>
> --
> Regards,
> Peng
>
>
- 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), 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 <=
- 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