Evaluated proc ascii2map_line str {set out ""; array set amap "";; set parts [split $str "\x03"]; set c 0; foreach chunk $parts { array set bmap ""; set re [regexp -all -inline {^((\d+)(,(\d+))*)*(.+?)$} $chunk]; set bmap(fg) [lindex $re 2]; set bmap(bg) [lindex $re 4]; set bmap(str) [lindex $re 5]; set amap($c) [array get bmap]; incr c };array get amap}