Evaluated proc allowed {str chars} {set out ""; map [explode $str] {x { if {[instr $chars $x]} {append out $x} }}; . $out }