Merge pull request #9487 from iwubcode/qt_regex_regression

DolphinQt: Fix regression in input expressions
This commit is contained in:
LC authored and GitHub committed 2021-02-02 22:00:11 -05:00
commit 7250d6e4e0
1 file changed
+4 -2
@@ -51,8 +51,10 @@ QString GetExpressionForControl(const QString& control_name,
if (quote == Quote::On) if (quote == Quote::On)
{ {
const QRegularExpression reg(QStringLiteral("[a-zA-Z]+")); // If our expression contains any non-alpha characters
if (!reg.match(expr).hasMatch()) // we should quote it
const QRegularExpression reg(QStringLiteral("[^a-zA-Z]"));
if (reg.match(expr).hasMatch())
expr = QStringLiteral("`%1`").arg(expr); expr = QStringLiteral("`%1`").arg(expr);
} }