Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: fix for (#s) and (#e) in param substs
- X-seq: zsh-workers 10758
- From: Zefram <zefram@xxxxxxxx>
- To: Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Subject: Re: PATCH: fix for (#s) and (#e) in param substs
- Date: Fri, 14 Apr 2000 13:00:58 +0100 (BST)
- Cc: Zsh hackers list <zsh-workers@xxxxxxxxxxxxxx>
- In-reply-to: <0FT000MKM7T8D3@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> from Peter Stephenson at "Apr 14, 2000 12:27:09 pm"
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
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. The semantics of
negation mean that it will match any substring other than what `(#s)'
will match; i.e., it will match anything except for a zero-length
substring at the start of the string. The documentation should be made
clearer on this point. We could also do with proper negative anchors,
that will match only a zero-length string in places other than the
{start,end} of the string. Or if someone feels like implementing my
generalised anchors proposal (I don't have the time at the moment), then
`(#Aan:...)' could be used to negate the sense of an anchor.
-zefram
Messages sorted by:
Reverse Date,
Date,
Thread,
Author