@@ -12,17 +12,8 @@ namespace Flow.Launcher.Plugin.Calculator
1212{
1313 public class Main : IPlugin , IPluginI18n , ISettingProvider
1414 {
15- private static readonly Regex RegValidExpressChar = new Regex (
16- @"^(" +
17- @"ceil|floor|exp|pi|e|max|min|det|abs|log|ln|sqrt|" +
18- @"sin|cos|tan|arcsin|arccos|arctan|" +
19- @"eigval|eigvec|eig|sum|polar|plot|round|sort|real|zeta|" +
20- @"bin2dec|hex2dec|oct2dec|" +
21- @"factorial|sign|isprime|isinfty|" +
22- @"==|~=|&&|\|\||(?:\<|\>)=?|" +
23- @"[ei]|[0-9]|0x[\da-fA-F]+|[\+\%\-\*\/\^\., ""]|[\(\)\|\!\[\]]" +
24- @")+$" , RegexOptions . Compiled ) ;
25- private static readonly Regex RegBrackets = new Regex ( @"[\(\)\[\]]" , RegexOptions . Compiled ) ;
15+ private static readonly Regex RegValidExpressChar = MainRegexHelper . GetRegValidExpressChar ( ) ;
16+ private static readonly Regex RegBrackets = MainRegexHelper . GetRegBrackets ( ) ;
2617 private static Engine MagesEngine ;
2718 private const string Comma = "," ;
2819 private const string Dot = "." ;
@@ -155,7 +146,7 @@ private static string ChangeDecimalSeparator(decimal value, string newDecimalSep
155146 return value . ToString ( numberFormatInfo ) ;
156147 }
157148
158- private string GetDecimalSeparator ( )
149+ private string GetDecimalSeparator ( )
159150 {
160151 string systemDecimalSeparator = CultureInfo . CurrentCulture . NumberFormat . NumberDecimalSeparator ;
161152 return _settings . DecimalSeparator switch
0 commit comments