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

Re: [^ax-y] doesn't work but [^x-ya] does



The same script, but instead:

    $'\03'-$'\010'

it does:

    A-G

etc. Behaves the same.

-- 
  Sebastian Gniazdowski
  psprint3@xxxxxxxxxxxx
#!/usr/local/bin/zsh-5.3.1

typeset -A ZUI
ZUI[PLUS]="X"
ZUI[COLOR_END]="Z"

button1='this module Gon-the-flyZ, DwithoutZ list restart'  # not working
button2='this module GontheflyZ, DwithoutZ list restart'    # working

local -A colormap
colormap=( "" "" )

translate_color_marks() {
    # Working
    #disp_list=( "${disp_list[@]//(#b)([A-G])(${ZUI[PLUS]}([H-I])|)([^H-I${ZUI[COLOR_END]}]#)${ZUI[COLOR_END]}/${colormap[${match[1]}]}${colormap[${match[3]}]}$match[4]$RESET}" )
    # Not working
    disp_list=( "${disp_list[@]//(#b)([A-G])(${ZUI[PLUS]}([H-I])|)([^${ZUI[COLOR_END]}H-I]#)${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