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]

Add a comment

Please note that this site uses the meta tags nofollow,noindex for all pages that contain comments.
Items are closed for new comments after 1 week