Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: regexp-replace and ^
- X-seq: zsh-workers 37023
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: regexp-replace and ^
- Date: Fri, 30 Oct 2015 14:27:21 +0000
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=UCl2jUGqfjT4pwIVQ6pvHt9VhOdQrOXxpH/4GdtkF+4=; b=QAVfklCond+4XdnVjtz8BIjeNCA+BCTR16kp0G+DuStsWYi/8Yt0F4nruswJkYB7ZK 9QTib3lVUqxP8BgHjqUTjLLUAAaDCD7UUnIgR7b4BcmiP7tGc63eRWXMYCewRzZ36iTR /tIL4NoC6c/Hs414HHF8PHzcnGnoYoUGAje4I0RAoPcV3nYB0n8/SXmTSxZZKF0Jgxm8 WRNqPVLxK49I8zV/dZBryyxXDPPY/7uqZsa3/7GEY4T3BSUkna9wC9A/xZU5CJ6tvsX0 LGiC/ceVVyPJD7NdwikDyj6y/okZy1kRk/nuuYnszN47X17J7HEn0h4gSrKNQAIsL8Py 85rA==
- In-reply-to: <151029164635.ZM18026@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20151029190807.GA18037@chaz.gmail.com> <151029164635.ZM18026@torch.brasslantern.com>
2015-10-29 16:46:35 -0700, Bart Schaefer:
> On Oct 29, 7:08pm, Stephane Chazelas wrote:
> }
> } Or maybe have a (E) for ERE and (P) for PCRE parameter expansion flags
> } for the ${var//pattern/replacement}.
>
> Each of (E) and (P) already means something else.
Indeed. Bummer.
How about some (#E), (#P)? ksh93 has some ~(E:regexp) ~(P:pcre)
and ~(E)regexp, ~(P)pcre.
Probably a lot more complicated.
A pcre_subst builtin addition to the zsh/pcre module would
probably be easy.
Or a zsubst with several options for pattern/ERE/PCRE, case
insensitive...
> It ought to be possible to fix regexp-replace. A leading "^" isn't that
> difficult, it just means the loop should only go around once (unless you
> expect it to match after embedded newlines). The tokens that match word
> breaks require more thought. I'm not sure what to make of lookaheads.
Well, there's also: (foo|^) and variations where you still want
to loop.
--
Stephane
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author