Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: reverse string subscripting
- X-seq: zsh-workers 13913
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: PATCH: reverse string subscripting
- Date: Thu, 5 Apr 2001 18:09:50 +0000
- In-reply-to: <200104051122.NAA06140@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <200104051122.NAA06140@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
On Apr 5, 1:22pm, Sven Wischnowsky wrote:
} Subject: PATCH: reverse string subscripting
}
} This is from the debian bug list:
}
} % a=abcd
} % echo $a[1,(r)d]
}
} didn't work, because it stopped one character too early trying to find
} the matching substring for `d'.
Note the (r) is forward pattern matching, not reverse; (R) is reverse.
Your patch appears to have fixed the bug only for the forward direction:
zagzig% x=abcd
zagzig% echo $x[(r)d]
d
zagzig% echo $x[1,(r)d]
abcd
zagzig% echo $x[(R)d]
d
zagzig% echo $x[1,(R)d]
zagzig% echo $x[1,(R)c]
abc
zagzig%
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author