diff --git a/Wox.Plugin.System/Calculator.cs b/Wox.Plugin.System/Calculator.cs index a1863507a2..04ddf7f060 100644 --- a/Wox.Plugin.System/Calculator.cs +++ b/Wox.Plugin.System/Calculator.cs @@ -20,6 +20,7 @@ namespace Wox.Plugin.System @"==|~=|&&|\|\||" + @"[ei]|[0-9]|[\+\-\*\/\^\., ""]|[\(\)\|\!\[\]]" + @")+$", RegexOptions.Compiled); + private static Regex regHasNumber = new Regex(@"[0-9]", RegexOptions.Compiled); private static Regex regBrackets = new Regex(@"[\(\)\[\]]", RegexOptions.Compiled); private static ParseContext yampContext = null; private PluginInitContext context { get; set; } @@ -35,6 +36,7 @@ namespace Wox.Plugin.System { if (string.IsNullOrEmpty(query.RawQuery) || query.RawQuery.Length < 2 // don't affect when user only input "e" or "i" keyword + || !regHasNumber.IsMatch(query.RawQuery) // must has one number || !regValidExpressChar.IsMatch(query.RawQuery) || !IsBracketComplete(query.RawQuery)) return new List();