From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19235 invoked from network); 18 Apr 2001 08:34:44 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 18 Apr 2001 08:34:44 -0000 Received: (qmail 27709 invoked by alias); 18 Apr 2001 08:34:40 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14011 Received: (qmail 27697 invoked from network); 18 Apr 2001 08:34:40 -0000 X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer goliath.siemens.de) Date: Wed, 18 Apr 2001 12:34:34 +0400 (MSD) From: Andrej Borsenkow X-X-Sender: To: Subject: Re: Patterns quoting in subscript (was: Re: PATCH: Assorted parameter stuff) In-Reply-To: <1010418073853.ZM28977@candle.brasslantern.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 18 Apr 2001, Bart Schaefer wrote: > > You just didn't try enough backslashes yet: > > schaefer[507] print -r $foo[(r)\\\\\?] > \? > > The reason you need five is that [...] is parsed as if double quoted, > except that \] is magic instead of \". Then the pattern inside it is > tokenized by (r) before being passed to patcompile(). So it goes like: > > parse tokenize pattern > \\ \\ \? --> \\ \? --> \? > > (In double quotes, \\ --> \ but \? --> \?.) > O.K., any chance to explain the above in Zsh doc? Just to make sure that I understand: - "as if in double quotes" means, that I cannot use "..." or '...' quoting inside of subscript, only back-slash is possible? - the rule for ``\\'' and ``\$'' still aplies? But ``\"'' is parsed as *two* characters? -andrej