From ef4d5d0f6868fa6f010eaa6b427c5e84519eb37e Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Thu, 18 Feb 2021 14:29:32 +0100 Subject: [PATCH] calculatorrunner: Fix mixed hex+decimal calculations BUG: 431362 FIXED-IN: 5.21.1 --- runners/calculator/calculatorrunner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runners/calculator/calculatorrunner.cpp b/runners/calculator/calculatorrunner.cpp index 92cad35af..52ca1a516 100644 --- a/runners/calculator/calculatorrunner.cpp +++ b/runners/calculator/calculatorrunner.cpp @@ -231,7 +231,7 @@ void CalculatorRunner::match(Plasma::RunnerContext &context) bool toHex = cmd.startsWith(QLatin1String("hex=")); bool startsWithEquals = !toHex && cmd[0] == QLatin1Char('='); - const static QRegularExpression hexRegex(QStringLiteral("^=?0x.+"), QRegularExpression::CaseInsensitiveOption); + const static QRegularExpression hexRegex(QStringLiteral("0x[0-9a-f]+"), QRegularExpression::CaseInsensitiveOption); const bool parseHex = cmd.contains(hexRegex); if (!parseHex) { userFriendlyMultiplication(cmd);