From: Peter Stephenson <pws@cambridgesiliconradio.com>
To: zsh-workers@sunsite.auc.dk (Zsh hackers list)
Subject: Re: PATCH: fix for (#s) and (#e) in param substs
Date: Fri, 14 Apr 2000 14:03:45 +0100 [thread overview]
Message-ID: <0FT000MQQCA8D3@la-la.cambridgesiliconradio.com> (raw)
In-Reply-To: "Your message of Fri, 14 Apr 2000 13:00:58 BST." <E12g4mQ-0002EY-00@crucigera.fysh.org>
> Peter Stephenson wrote:
> >By the way, I inserted a hostage to fortune in the manual by claiming that
> >`(^(#s))' etc. also work, i.e. you can assert that you are not at the start
> >of the string.
>
> Careful. If that's been implemented correctly, `(^(#s))' will match
> an arbitrarily long substring anywhere, in addition to a zero-length
> substring anywhere other than the start of the string.
Yes, this was at the back of my mind but I didn't really work it all out.
(''~(#s)) works, though is a bit clumsy.
Index: Doc/Zsh/expn.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/expn.yo,v
retrieving revision 1.5
diff -u -r1.5 expn.yo
--- Doc/Zsh/expn.yo 2000/04/14 11:49:31 1.5
+++ Doc/Zsh/expn.yo 2000/04/14 13:01:06
@@ -1318,7 +1318,10 @@
provides a single simple and memorable method.
Note that assertions of the form `tt((^(#s)))' also work, i.e. match
-anywhere except at the start of the string.
+anywhere except at the start of the string, although this actually means
+`anything except a zero-length portion at the start of the string'; you
+need to use `tt((""~(#s)))' to match a zero-length portion of the string
+not at the start.
)
enditem()
--
Peter Stephenson <pws@cambridgesiliconradio.com>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070
prev parent reply other threads:[~2000-04-14 13:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-04-14 11:27 Peter Stephenson
2000-04-14 11:42 ` Andrej Borsenkow
2000-04-14 12:15 ` Peter Stephenson
2000-04-14 12:00 ` Zefram
2000-04-14 13:03 ` Peter Stephenson [this message]
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=0FT000MQQCA8D3@la-la.cambridgesiliconradio.com \
--to=pws@cambridgesiliconradio.com \
--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).