diff --git a/MathParser/MathParser.cs b/MathParser/MathParser.cs index d0f7f57..e849f8c 100644 --- a/MathParser/MathParser.cs +++ b/MathParser/MathParser.cs @@ -305,7 +305,7 @@ public double ProgrammaticallyParse(string mathExpression, bool correctExpressio string varName; double varValue; - if (mathExpression.Contains(VariableDeclarator)) + if (System.Text.RegularExpressions.Regex.IsMatch(mathExpression, @"\b" + VariableDeclarator + @"\b")) { if (mathExpression.Contains("be")) {