Posted to tcl by dandyn at Mon Nov 11 20:35:36 GMT 2024view raw

  1. set words [string tolower {bartender in a bar with fools drinking from bar taps food fountain}]
  2. set re [string tolower {foo|bar}]
  3. puts [regexp -all -inline $re $words]
  4.  
  5.  
  6. foreach word [regexp -all -inline $re $words] {
  7. incr count($word)
  8. }
  9. puts [parray count]