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