Zsh Mailing List Archive
Messages sorted by:
Reverse Date
,
Date
,
Thread
,
Author
Re: string match simplification?
X-seq
: zsh-users 30070
From
: Ray Andrews <rayandrews@xxxxxxxxxxx>
To
: zsh-users@xxxxxxx
Subject
: Re: string match simplification?
Date
: Tue, 3 Sep 2024 09:38:46 -0700
Archived-at
: <https://zsh.org/users/30070>
In-reply-to
: <CAA=-s3wGUTx2-K0PjXiFt6NFf+M1AFX3LsxLyrvj613UmMfoDw@mail.gmail.com>
List-id
: <zsh-users.zsh.org>
References
: <
3d42adf7-747f-4311-a74d-a6d1439260cb@eastlink.ca
> <CAA=-s3zV-TUrd=y68aW906YfO7zVObZ+x_nphsQ=T-qLQuL6aQ@mail.gmail.com> <CAA=-s3xnBFrxFiTrgVbH4B_dNd8FZQ1K4io8AYRjt755Rzm1=w@mail.gmail.com> <CAA=-s3wGUTx2-K0PjXiFt6NFf+M1AFX3LsxLyrvj613UmMfoDw@mail.gmail.com>
On 2024-09-03 09:03, Mark J. Reed wrote:
[[ $filename =~ '\.([^.]*)$' ]]
extension=$match[1]
That does it. So that or Roman's idea are both fine. Getting these things right -- my clunky code works, but so sloppy -- this is elegant.
Follow-Ups
:
Re: string match simplification?
From:
Ray Andrews
References
:
string match simplification?
From:
Ray Andrews
Re: string match simplification?
From:
Mark J. Reed
Re: string match simplification?
From:
Mark J. Reed
Re: string match simplification?
From:
Mark J. Reed
Messages sorted by:
Reverse Date
,
Date
,
Thread
,
Author