Evaluated proc %- {who q} {set plist ""; set parts [split [trim $::playlist($who)] \n]; set out ""; for {set i 0} {$i < [llength $parts]} {incr i 3} { set part [lrange $parts $i [+ $i 2]]; if {[regexp -nocase $q [. $part]] == 0} { append plist [join $part \n]\n } else { append out "[lindex [split [%% $who] \n] [expr $i/3]]\n"}  }; set ::playlist($who) $plist; . $out}