Simplify a string expression.