Add support for hex/binary numbers to calculator (#14948)

This minor expression validation tweak allows hexadecimal and binary numbers to be entered into expressions.
This commit is contained in:
Graham Sutherland 2021-12-13 17:01:12 +00:00 committed by GitHub
parent a612ba845e
commit f5d2f86c23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator
@"sinh\s*\(|cosh\s*\(|tanh\s*\(|arsinh\s*\(|arcosh\s*\(|artanh\s*\(|" +
@"pi|" +
@"==|~=|&&|\|\||" +
@"e|[0-9]|[\+\-\*\/\^\., ""]|[\(\)\|\!\[\]]" +
@"e|[0-9]|0x[0-9a-fA-F]+|0b[01]+|[\+\-\*\/\^\., ""]|[\(\)\|\!\[\]]" +
@")+$", RegexOptions.Compiled);
public static bool InputValid(string input)