Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Prepend/append to the members of a list
- X-seq: zsh-workers 22941
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Prepend/append to the members of a list
- Date: Wed, 1 Nov 2006 12:24:05 +0000
- In-reply-to: <200610311708.k9VH8UX8025695@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Organization: Cambridge Silicon Radio
- References: <20061030170919.GA9507@xxxxxxxxxxxx> <200610311452.k9VEqKNI013158@xxxxxxxxxxxxxx> <061031083123.ZM10976@xxxxxxxxxxxxxxxxxxxxxx> <200610311708.k9VH8UX8025695@xxxxxxxxxxxxxx>
Peter Stephenson <pws@xxxxxxx> wrote:
> > The PATTERN may begin with a `#', in which case the PATTERN must
> > match at the start of the string, or `%', in which case it must
> > match at the end of the string.
> >
> > Should that doc also say that #% is a legal pattern meaning "anchor
> > the match at both ends of the string"?
>
> With the current code, no, because that's not supported. I
> suppose it would be sensible to add that for compatibility---although
> it does change the syntax in the not particularly likely but by no means
> impossible case that you're substituting a % at the head of a string,
> so I'm not so sure.
I've committed the patch with this change, so ${param/#%foo/bar} does mean
"foo must match the whole element". There's a note in README about the
change.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php
Messages sorted by:
Reverse Date,
Date,
Thread,
Author