Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Patterns quoting in subscript (was: Re: PATCH: Assorted parameter stuff)
- X-seq: zsh-workers 14011
 
- From: Andrej Borsenkow <Andrej.Borsenkow@xxxxxxxxxxxxxx>
 
- To: <zsh-workers@xxxxxxxxxx>
 
- Subject: Re: Patterns quoting in subscript (was: Re: PATCH: Assorted parameter stuff)
 
- Date: Wed, 18 Apr 2001 12:34:34 +0400 (MSD)
 
- In-reply-to: <1010418073853.ZM28977@xxxxxxxxxxxxxxxxxxxxxxx>
 
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
 
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author