Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: (r) flag on scalar



On Mon, Mar 9, 2015 at 10:08 AM, Peter Stephenson
<p.stephenson@xxxxxxxxxxx> wrote:
> On Sun, 8 Mar 2015 19:56:42 -0700
> Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>> The only thing not quite intuitive about this is that a wildcard (either
>> * or with extendedglob ?# ) at the end of the ending patterrn is not
>> considered part of the match for (r) but is part of the match for (R).
>> PWS's latest doc tweak still doesn't explicitly describe that.
>
> diff --git a/Doc/Zsh/params.yo b/Doc/Zsh/params.yo
> index 7b127bc..1b175b2 100644
> --- a/Doc/Zsh/params.yo
> +++ b/Doc/Zsh/params.yo
> @@ -197,7 +197,17 @@ example(string="abcdefghijklm"
>  print ${string[+LPAR()r+RPAR()d?,+LPAR()r+RPAR()h?]})
>
>  prints `tt(defghi)'.  This is an obvious generalisation of the
> -rule for single-character matches.
> +rule for single-character matches.  For a single subscript,
> +only a single character is referenced (not the range of chracters

characters*

-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author