zsh-users
 help / color / mirror / code / Atom feed
From: Michele Venturi <dardo82@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-users@zsh.org
Subject: Re: Substitute the last match of a pattern during parameters expansion.
Date: Wed, 14 Sep 2022 23:59:31 +0200	[thread overview]
Message-ID: <CA+Ds4NuJOq0F-=ozzVxH-PV-DkUP=DUSiZ_+Cj1aK7xuvqnggQ@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7a7vHEdpXcCc3ZjHGjWnPHUjzfRB0cCett7vwaB4ib50Q@mail.gmail.com>

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

On Wed, Sep 14, 2022, 20:56 Bart Schaefer <schaefer@brasslantern.com> wrote:

> On Tue, Sep 13, 2022 at 8:20 PM Michele Venturi <dardo82@gmail.com> wrote:
> >
> > Plus you seem good at non trivial tasks if you can
> > write that monstrousity.Do you know what's trivial? > Counting, to know
> how many matches there are...
>
> Definitely keep that approach and see

how much help it gets you in the future.
>

I'm the one helping you pointing out your weaknesses
and prodding you to get better,don't get confused,ok?

> There are examples of supporting negative index,
> > so don't see a reason why it is so difficult to do it.
>
> For benefit of other readers ...
>

So you are basically saying that I'm right but you don't
like me, so you don't want to talk to me, that is surely a
grown up approach, or maybe not? Not sure about it...

To implement negative indexing, it is necessary to walk to the end of the
> string to count the number of occurrences, while "remembering" where each
> one appears, and then backtrack to the position of the Nth-from-last match
> and replace just that one.
>
> Those who think this is both easy and worthwhile,


If you have written the code for the forward indexing,
it's easy and worthwhile,otherwise not so much,no?

Anyway it seems that nobody here is able to do it now,
so maybe this is the wrong place to ask for such things.

Are there other mailing list with more knowledgeable
people on this specific subject? Maybe ZSH-workers?

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

  parent reply	other threads:[~2022-09-14 22:00 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
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 [this message]
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+Ds4NuJOq0F-=ozzVxH-PV-DkUP=DUSiZ_+Cj1aK7xuvqnggQ@mail.gmail.com' \
    --to=dardo82@gmail.com \
    --cc=schaefer@brasslantern.com \
    --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).