Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
RE: Should we backup this change? RE: Modifier substitutions.
- X-seq: zsh-workers 10719
- From: "Andrej Borsenkow" <Andrej.Borsenkow@xxxxxxxxxxxxxx>
- To: "Peter Stephenson" <pws@xxxxxxxxxxxxxxxxxxxxxxxx>, "Zsh hackers list" <zsh-workers@xxxxxxxxxxxxxx>
- Subject: RE: Should we backup this change? RE: Modifier substitutions.
- Date: Thu, 13 Apr 2000 10:00:05 +0400
- Importance: Normal
- In-reply-to: <E12fUA0-00071y-00.2000-04-12-21-54-52@xxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
> > > ${foo/$bar/...} into ${foo/\\$bar/...}
> >
> > The problem is (as I discovered later) it is not complete.
> There is no
> > way to anchor pattern to match full string.
>
> You should now be able to do ${foo/(#s)$bar(#e)/...}.
In this particular case I was about to simply use ${...:/...}
(untested). And this is the form I was referred to - you cannot put this
anchor in pattern.
I also believe, that it should be possible to simulate left/right
anchoring by using ${...:/...} and (pat)* or *(pat). May be, it could
match too much, dunno.
BTW where are these (#s) and (#e) useful? The patterns in parameter
expansions are anchored by definition; the patterns in conditional
expressions/case statements are anchored to full word as well. Could you
provide example where you cannot do without (#s)/(#b)?
In any case, this is additional argument in favour of backing out this
change (assuming, that these (#s)/(#b) really work).
-andrej
Messages sorted by:
Reverse Date,
Date,
Thread,
Author