zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
To: "Zsh hackers list" <zsh-workers@sunsite.auc.dk>
Subject: Re: Should we backup this change? RE: Modifier substitutions.
Date: Wed, 12 Apr 2000 21:54:51 +0100	[thread overview]
Message-ID: <E12fUA0-00071y-00.2000-04-12-21-54-52@mail6.svr.pol.co.uk> (raw)
In-Reply-To: ""Andrej Borsenkow""'s message of "Wed, 12 Apr 2000 19:06:35 +0400." <000601bfa490$b188ed50$21c9ca95@mow.siemens.ru>

"Andrej Borsenkow" wrote:
> > ${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)/...}.  Unfortunately
there's a bug due to the implementation: (#s) always matches, because the
substitution only passes the tail end of the string.  (#e) works here, but
can fail when we are looking for the shortest match for ${...%...}.  In
principle this isn't hard to keep track of --- the calling code knows
whether the beginning or end of the string passed is really that --- but in
practice it's messy passing the status into pattry() from igetmatch() in
glob.c.  I'll think about this.  Are there any other areas apart from
parameter substitution where the string is longer than we pass to the
pattern matching routines?

-- 
Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
Work: pws@CambridgeSiliconRadio.com
Web: http://www.pwstephenson.fsnet.co.uk


  reply	other threads:[~2000-04-12 20:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-06  9:15 Peter Stephenson
2000-04-06  9:32 ` Andrej Borsenkow
2000-04-06 12:49   ` Andrej Borsenkow
2000-04-12 12:26   ` Should we backup this change? " Andrej Borsenkow
2000-04-12 12:34     ` Sven Wischnowsky
2000-04-12 14:53       ` Bart Schaefer
2000-04-12 15:06         ` Andrej Borsenkow
2000-04-12 20:54           ` Peter Stephenson [this message]
2000-04-13  6:00             ` Andrej Borsenkow
2000-04-13  8:59               ` Peter Stephenson
2000-05-04  7:02         ` Let's do it " Andrej Borsenkow
2000-05-04 15:56           ` Peter Stephenson
2000-05-05 13:32             ` PATCH:RE: Let's do it RE: Should we backup this change? RE: Modifiersubstitutions Andrej Borsenkow
2000-05-05 14:26               ` PATCH: substitution anchors Peter Stephenson
2000-05-05 14:52                 ` Bart Schaefer
2000-05-05 14:55                   ` Andrej Borsenkow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E12fUA0-00071y-00.2000-04-12-21-54-52@mail6.svr.pol.co.uk \
    --to=pws@pwstephenson.fsnet.co.uk \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).