zsh-users
 help / color / mirror / code / Atom feed
From: Michele Venturi <dardo82@gmail.com>
To: "Lawrence Velázquez" <larryv@zsh.org>
Cc: zsh-users@zsh.org
Subject: Re: Substitute the last match of a pattern during parameters expansion.
Date: Tue, 13 Sep 2022 06:19:25 +0200	[thread overview]
Message-ID: <CA+Ds4NuuAMiKoi9D=hgyY-RbySais1eEgZHbivx=L68KUWv1bg@mail.gmail.com> (raw)
In-Reply-To: <a0ea450b-eb84-47d1-a4ae-bd0bfbef51ea@www.fastmail.com>

[-- Attachment #1: Type: text/plain, Size: 957 bytes --]

On Mon, Sep 12, 2022, 08:01,
Lawrence Velázquez,
<larryv@zsh.org>, wrote:

On Mon, Sep 12, 2022, 12:20,

Michele Venturi,

<dardo82@gmail.com>, wrote:


> > Hello, I have a problem, can you help me?
> > I would like to substitute the last match of
> > a pattern during the parameters expansion:

>

> the string aXbXc should become aXbYc;
> > I have not found a direct and general way
> > of doing it, but there are some solutions…
>
> > I would suggest a new flag like % or $ for it.
> > I wonder if the syntax ${(%)str/X/Y} is going
> > to conflict with other functionalities of ZSH…
>
> But there is already a '%' flag...

This doesn't merits a new one.
>

What merits a new one then?


> Adding negative indexes support to the 'I' flag

> would be very good but verbose in my opinion.
>
> Extending the 'I' flag in this way would be ideal.
>

How do you extend the I flag?


--
https://about.me/dardo82

[-- Attachment #2: Type: text/html, Size: 3246 bytes --]

  reply	other threads:[~2022-09-13  4:20 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12  4:20 Michele Venturi
2022-09-12  6:01 ` Lawrence Velázquez
2022-09-13  4:19   ` Michele Venturi [this message]
2022-09-13  6:06     ` Lawrence Velázquez
2022-09-13 23:11       ` Bart Schaefer
2022-09-14  3:20         ` Michele Venturi
2022-09-14 18:56           ` Bart Schaefer
2022-09-14 20:06             ` Ray Andrews
2022-09-14 21:59             ` Michele Venturi
2022-09-14 22:04               ` Bart Schaefer
2022-09-14 22:20                 ` Michele Venturi
2022-09-15  0:00                   ` Alex Satrapa
2022-09-15  0:29               ` Lawrence Velázquez
2022-09-15  1:45                 ` Michele Venturi
2022-09-15 12:01                   ` Roman Perepelitsa
2022-09-15 23:29                     ` Michele Venturi
2022-09-16  6:37                       ` Roman Perepelitsa
2022-09-16  7:52                         ` Michele Venturi
2022-09-16  7:57                           ` Roman Perepelitsa
2022-09-16  8:19                             ` Michele Venturi
2022-09-16  8:22                               ` Roman Perepelitsa
2022-09-16  8:33                                 ` Michele Venturi
2022-09-16  8:36                                   ` Roman Perepelitsa
2022-09-16  9:08                                     ` Michele Venturi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+Ds4NuuAMiKoi9D=hgyY-RbySais1eEgZHbivx=L68KUWv1bg@mail.gmail.com' \
    --to=dardo82@gmail.com \
    --cc=larryv@zsh.org \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).