Evaluated set out ""; foreach line [raw_irclog] { if {[regexp "hello123" [lindex $line 3]] == 1} {append out "<[lindex $line 1]> [lindex $line 3]\n"}};. $out