Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [^ax-y] doesn't work but [^x-ya] does
- X-seq: zsh-workers 40690
- From: Sebastian Gniazdowski <psprint3@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [^ax-y] doesn't work but [^x-ya] does
- Date: Wed, 01 Mar 2017 23:33:25 -0800
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= mesmtp; bh=qPsG0YpPDlw0UUJb1XxodT/OP/c=; b=waTXIKGiw/oXM/IaUYpKl rSTMy5pG3jmKZSORy6MjZYgpHlBFO63lXm2icLGn4n5Dr3PfyaKANdH5OoYcb2Gt ebgnXqV3SWBaBWU1kRfGoLw4MvsU2wPuSZfRtdkINA/2/IR67tCK1MbawTrnHY50 Lk7jHHZdSEa7y+KGddGETc=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=smtpout; bh=qPsG0YpPDlw0UUJb1XxodT/OP /c=; b=flWjjdLsj9mbxwEobyYQDmrG9xa81SIPN4XnMuZ0NbEMmeLrA36AAvuvy PaWXN8dWVL5rfDSzn6N+vEXXYyDC/N+2kD3VR1I4KGpJDBGSE6p9vF7RfYCsnoJp bdNd9rxopSQJT9DUSFS/S6KCAKunfsVHT7RDi1v2P3aa2qpPMU=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Hello,
a minimal test case to investigate 1c41f98 that bisect pointed to. Dash
"-" in character [range] is treated literally. The patch is:
- if (!in_brace_param)
- in_brace_param = bct;
+ if (!in_brace_param) {
+ if ((in_brace_param = bct))
+ seen_brct = 0;
+ }
The result of script is (first line – not matched, no ^G etc.
replacement):
this module ^GON-THE-FLY^_, without list restart
this module ONTHEFLY, without list restart
Script contains alternative [^x-ya] pattern that works (and [^ax-y] that
doesn't).
--
Sebastian Gniazdowski
psprint3@xxxxxxxxxxxx
#!/usr/local/bin/zsh-5.3.1
typeset -gAH ZUI
ZUI[PLUS]=$'\21'
ZUI[COLOR_END]=$'\037'
button1='this module ON-THE-FLY, without list restart' # not working
button2='this module ONTHEFLY, without list restart' # working
local -A colormap
colormap=( "" "" )
translate_color_marks() {
# Working
# disp_list=( "${disp_list[@]//(#b)([$'\03'-$'\010'$'\022'])(${ZUI[PLUS]}([$'\011'-$'\020'])|)([^$'\03'-$'\010'${ZUI[COLOR_END]}]#)${ZUI[COLOR_END]}/${colormap[${match[1]}]}${colormap[${match[3]}]}$match[4]$RESET}" )
# Not working
disp_list=( "${disp_list[@]//(#b)([$'\03'-$'\010'$'\022'])(${ZUI[PLUS]}([$'\011'-$'\020'])|)([^${ZUI[COLOR_END]}$'\03'-$'\010']#)${ZUI[COLOR_END]}/${colormap[${match[1]}]}${colormap[${match[3]}]}$match[4]$RESET}" )
}
disp_list=( "$button1" "$button2" )
translate_color_marks
print -rl -- "${disp_list[@]}" "---" >> ~/result.txt
Messages sorted by:
Reverse Date,
Date,
Thread,
Author