Posted to tcl by dandyn at Mon Nov 11 20:35:36 GMT 2024view pretty
set words [string tolower {bartender in a bar with fools drinking from bar taps food fountain}] set re [string tolower {foo|bar}] puts [regexp -all -inline $re $words] foreach word [regexp -all -inline $re $words] { incr count($word) } puts [parray count]