Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Prepend/append to the members of a list

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

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