@@ -12,17 +12,8 @@ namespace Flow.Launcher.Plugin.Calculator
12
12
{
13
13
public class Main : IPlugin , IPluginI18n , ISettingProvider
14
14
{
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 ( ) ;
26
17
private static Engine MagesEngine ;
27
18
private const string Comma = "," ;
28
19
private const string Dot = "." ;
@@ -155,7 +146,7 @@ private static string ChangeDecimalSeparator(decimal value, string newDecimalSep
155
146
return value . ToString ( numberFormatInfo ) ;
156
147
}
157
148
158
- private string GetDecimalSeparator ( )
149
+ private string GetDecimalSeparator ( )
159
150
{
160
151
string systemDecimalSeparator = CultureInfo . CurrentCulture . NumberFormat . NumberDecimalSeparator ;
161
152
return _settings . DecimalSeparator switch
0 commit comments