[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to substitute in a string for the first n matches?
From: |
Peng Yu |
Subject: |
Re: How to substitute in a string for the first n matches? |
Date: |
Mon, 29 Mar 2021 09:44:38 -0500 |
On Mon, Mar 29, 2021 at 9:38 AM <arnold@skeeve.com> wrote:
>
> Unless your string is many megabytes long, you won't notice the time
> issue.
I don't want to assume how small the input is.
> There are other options, for example using patsplit and then putting
> the string back together as desired.
This incurs extra copying.
> In any case, gensub isn't going to be extended to allow arbitrary
> ranges and/or lists of occurrences to substitute.
Why it can not be extended? After all, the extension won't break any
existing function call convention.
> Gawk provides
> the basic building blocks as built-in functionality; more specific
> use cases should be dealt with in user defined functions.
The problem is that no current functionality in awk support efficient
implementation of this feature.
--
Regards,
Peng
- How to substitute in a string for the first n matches?, Peng Yu, 2021/03/26
- Re: How to substitute in a string for the first n matches?, david kerns, 2021/03/26
- Re: How to substitute in a string for the first n matches?, arnold, 2021/03/29
- Re: How to substitute in a string for the first n matches?, arnold, 2021/03/29
- Re: How to substitute in a string for the first n matches?, Wolfgang Laun, 2021/03/29
- Re: How to substitute in a string for the first n matches?,
Peng Yu <=
- Re: How to substitute in a string for the first n matches?, Wolfgang Laun, 2021/03/29
- Re: How to substitute in a string for the first n matches?, arnold, 2021/03/29
- Message not available
- Message not available
- Message not available
- Message not available
- Re: How to substitute in a string for the first n matches?, Denis Shirokov, 2021/03/31