Quick math-parsing algorithm based on c++ regular expressions.