Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Beginning of line matching
- X-seq: zsh-workers 16918
- From: Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx (Zsh hackers list)
- Subject: Re: Beginning of line matching
- Date: Wed, 27 Mar 2002 21:06:15 +0000
- In-reply-to: ""Bart Schaefer""'s message of "Tue, 26 Mar 2002 17:26:29 GMT." <1020326172630.ZM32331@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
"Bart Schaefer" wrote:
> On Mar 26, 12:31pm, Ian Lynagh wrote:
> }
> } I would have expected ${FOO/(#s)/X} and ${${FOO/(#m)(#s)?/X$MATCH}:-X}
> } to be equivalent, but it seems that only the second one has the desired
> } effect when FOO is not empty. Is there a reason the first doesn't behave
> } as I expected?
>
> AFAICT, it's because "start of string" is considered to begin with the
> first real character, thus after the implicit intial empty substring.
Probably because of the special handling of parameter
substitution/head/tail matches, which are a little different from normal
pattern matches, where it seems to work.
I'm away for a week, so I'll have a look when I get back.
--
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
Work: pws@xxxxxxx
Web: http://www.pwstephenson.fsnet.co.uk
Messages sorted by:
Reverse Date,
Date,
Thread,
Author