Run:
str = "Revenue - Costs * (1 + Profitpercentage)" p str.scan(/[A-Za-z]+/)
at http://rubyplus.biz/
You will see:
["Revenue", "Costs", "Profitpercentage"]