Previn,

if you want a flexible solution, I'd go with an hash. Key is the tool 
name, value is an array of regexps.

tools = {
    "astro" => [ /astro/ ],
    "fm" => [ /fm_shell/, /formality/ ]
}

You can then iterate over all values, see what matches the string you've 
got, and use the key as toolName

HTH.

-- 
Posted via http://www.ruby-forum.com/.