Evaluated proc ascii2map_line str {set out ""; set amap [list]; set parts [split $str "\x03"]; 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]; append out [array get $bloq]} };. $out}