public static bool IsExpression(string input) { if (cache.ContainsKey(input)) return cache[input]; try { var ignored2 = new Parser(input).Parse(); cache[input] = true; return true; } catch (Exception _) { cache[input] = false; return false; } }