From ba742aa24f621aef56fc7bdeefbdcc0f773eb89f Mon Sep 17 00:00:00 2001 From: Brian MacIntosh Date: Thu, 23 Feb 2023 09:15:00 -0800 Subject: [PATCH] Variable declarator 'let' will only be matched as a standalone word. Fixes custom functions containing 'let' not being parsed correctly. --- MathParser/MathParser.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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")) {